Clips
Extract audio segments from videos and audio across 16 platforms.
Duration limits
FreePro, Premium10 seconds per clip15 seconds per clip
sonus.clips.getMetadata({ url })Get title, duration, and thumbnail for a URL before creating a clip.
| Parameter | Type | Description |
|---|---|---|
urlrequired | string | URL from a supported platform |
const { metadata, error } = await sonus.clips.getMetadata({
url: 'https://example.com/episode.mp3',
})sonus.clips.create({ url, start, end, name })Create an audio clip from a URL. Returns the clip with a direct download link.
| Parameter | Type | Description |
|---|---|---|
urlrequired | string | Source URL |
startrequired | number | Start time in seconds |
endrequired | number | End time in seconds |
namerequired | string | Name for the clip |
const { clip, error } = await sonus.clips.create({
url: 'https://example.com/episode.mp3',
start: 43,
end: 53,
name: 'chorus',
})sonus.clips.list({ cursor?, limit? })List your clips with cursor-based pagination.
| Parameter | Type | Description |
|---|---|---|
cursor | string | Pagination cursor from previous response |
limit | number | Items per page (max 100, default 50) |
const { clips, error } = await sonus.clips.list({ limit: 10 })
if (error) throw error
if (clips.nextCursor) {
const page2 = await sonus.clips.list({
cursor: clips.nextCursor,
limit: 10,
})
}sonus.clips.get(id)Get a single clip by ID.
const { clip, error } = await sonus.clips.get('clip_abc123')sonus.clips.delete(id)Delete a clip by ID.
const { ok, error } = await sonus.clips.delete('clip_abc123')