Skip to main content
GET
/
v3
/
audio
/
sounds
Search audio (music or sound effects)
curl --request GET \
  --url https://api.heygen.com/v3/audio/sounds \
  --header 'x-api-key: <api-key>'
import requests

url = "https://api.heygen.com/v3/audio/sounds"

headers = {"x-api-key": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};

fetch('https://api.heygen.com/v3/audio/sounds', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.heygen.com/v3/audio/sounds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.heygen.com/v3/audio/sounds"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-api-key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.heygen.com/v3/audio/sounds")
.header("x-api-key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.heygen.com/v3/audio/sounds")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "description": "<string>",
      "audio_url": "<string>",
      "score": 123,
      "duration": 120,
      "peak_offset": 0.37,
      "placement": "hit"
    }
  ],
  "has_more": true,
  "next_token": "<string>"
}
{
"error": {
"code": "invalid_parameter",
"message": "'query' is required.",
"param": "query",
"doc_url": null
}
}
{
"error": {
"code": "authentication_failed",
"message": "Invalid or expired API key. Verify your x-api-key header.",
"param": null,
"doc_url": null
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Too many requests. Retry after the duration specified in the Retry-After header.",
"param": null,
"doc_url": null
}
}

Authorizations

x-api-key
string
header
required

HeyGen API key. Obtain from your HeyGen dashboard.

Query Parameters

query
string
required

Natural-language description of the audio you want, e.g. 'upbeat lofi hip-hop' or 'tense cinematic riser'. Results are ranked by semantic similarity to this text.

Required string length: 1 - 5000
type
enum<string>
default:music

Audio content type to search: 'music' (background-music catalog) or 'sound_effects' (SFX catalog). Defaults to 'music'.

Available options:
music,
sound_effects
limit
integer
default:10

Maximum number of results to return (1-50).

Required range: 1 <= x <= 50
min_score
number
default:0.7

Minimum semantic similarity score (0-1). Tracks scoring below this are omitted.

Required range: 0 <= x <= 1
token
string

Opaque cursor token for the next page, taken from 'next_token' in a prior response.

Response

Successful response

data
AudioSoundItem · object[]
has_more
boolean

Whether more pages are available

next_token
string | null

Opaque cursor for the next page