SonusLabSonusLab

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.

ParameterTypeDescription
urlrequiredstringURL 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.

ParameterTypeDescription
urlrequiredstringSource URL
startrequirednumberStart time in seconds
endrequirednumberEnd time in seconds
namerequiredstringName 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.

ParameterTypeDescription
cursorstringPagination cursor from previous response
limitnumberItems 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')