Music

ShortGenius also provides an AI-curated music catalog to serve as background tracks for your videos. You can explore various genres and pick specific tracks to add life to your video content.

List Music Genres

Endpoint: GET /music/genres

Retrieve the full list of available music genres. Each genre may include recommended locales where that genre is particularly popular.

import { ShortGenius } from 'shortgenius'

const client = new ShortGenius({
  bearerAuth: 'YOUR_API_TOKEN'
})

const genres = await client.getMusicGenres()

console.log(`Found ${genres.length} music genres:`)

for (const genre of genres) {
  console.log(`- ${genre.name}`)
  if (genre.recommended_for_locales && genre.recommended_for_locales.length > 0) {
    console.log(`  Recommended for: ${genre.recommended_for_locales.join(', ')}`)
  }
}

Sample Response:

[
  {
    "name": "Classical",
    "recommended_for_locales": [
      "de-DE",
      "fr-FR",
      "en-US"
    ]
  },
  {
    "name": "Jazz",
    "recommended_for_locales": [
      "en-US",
      "fr-FR"
    ]
  },
  ...
]

Response Fields

Field
Description

name

The name of the genre (e.g., "Classical").

recommended_for_locales

Array of locales where the genre is particularly popular.


List Music in a Genre

Endpoint: GET /music/genres/{id}

Use the genre's name or unique ID returned by GET /music/genres to list specific tracks.

// First get genres to find the ID
const genres = await client.getMusicGenres()
const classicalGenre = genres.find(g => g.name === 'Classical')

if (classicalGenre) {
  const tracks = await client.getMusic(classicalGenre.id)

  console.log(`Found ${tracks.length} tracks in ${classicalGenre.name}:`)

  for (const track of tracks) {
    console.log(`- ${track.name} (${track.id})`)
    if (track.preview_url) {
      console.log(`  Preview: ${track.preview_url}`)
    }
  }
}

Sample Response:

[
  {
    "id": "73f3cd22-bd13-4ec1-a675-82de290c598f",
    "name": "Moonlight Sonata (Excerpt)",
    "preview_url": "https://cdn.shortgenius.com/music/73f3cd22-preview.mp3"
  },
  {
    "id": "ee13c403-6503-49c4-9ff8-a9a45eb558bb",
    "name": "Fur Elise (Excerpt)",
    "preview_url": "https://cdn.shortgenius.com/music/ee13c403-preview.mp3"
  },
  ...
]

Response Fields

Field
Description

id

Unique ID of the track (for use in /videos or /series).

name

Track title (may be partial or excerpt).

preview_url

Direct link to a short preview audio clip of the track.


Using Music in Videos

After identifying a suitable track's id, simply include it in your request to create or update a video:

// Get a soundtrack
const genres = await client.getMusicGenres()
const tracks = await client.getMusic(genres[0].id)

// Use in video creation
const video = await client.createVideo({
  // ... other video fields ...
  soundtrack_id: tracks[0].id,
  soundtrack_volume: 80,
  soundtrack_playback_rate: 120
})

console.log(`Video created with soundtrack: ${tracks[0].name}`)

ShortGenius will overlay this music behind your AI-generated voice and scenes, producing a fully scored video.


Next Steps

Now that you can add background music:

  1. Check out Connections & Publishing to learn how to publish your videos.

  2. Monitor your Usage & Credits so you always have enough resources to generate new music-backed projects.

Last updated