← API Reference
Find Similar
POSThttps://api.audioscape.ai/developer/v1/similarEndpoint
Given a track's asset ID, find other tracks that sound similar. Great for building "more like this" features or curating playlists based on a seed track.
Headers
| Name | Type | Description |
|---|---|---|
| x-api-key | required | Your API key |
| Content-Type | required | Must be application/json |
Request Body
| Parameter | Type | Description |
|---|---|---|
| asset_id | string required | The Roblox asset ID of the track to find similar music for |
| limit | number optional | Maximum results to return (default: 20, max: 100) |
| offset | number optional | Pagination offset (default: 0) |
| filters | object optional | Narrow your results: genres—Array of Roblox music genre slugs (e.g. "electronic")duration—Object with min and max in seconds |
Response
Returns tracks that are acoustically similar to the given track.
response.json
{
"tracks": [
{
"asset_id": "string",
"name": "string",
"artist": "string",
"album": "string",
"duration": number,
"genre": "string",
"bpm": number,
"score": number
}
],
"meta": {
"total": number,
"limit": number,
"offset": number
}
}Example Request
Radio mode: when one track finishes, queue another that sounds like it so the vibe carries. Assumes a client from the Quickstart.
Luau (Roblox)
-- Radio mode: when the current track ends, queue one that sounds like it
-- Note: bgmSound.Looped must be false, otherwise Ended never fires
local nowPlayingId = "123456789"
bgmSound.Ended:Connect(function()
local result, err = client:similar({
asset_id = nowPlayingId,
limit = 1,
})
if not result or #result.tracks == 0 then
warn(err or "no similar tracks")
return
end
nowPlayingId = result.tracks[1].asset_id
bgmSound.SoundId = "rbxassetid://" .. nowPlayingId
bgmSound:Play()
end)Error Responses
400Bad RequestMissing or invalid asset ID.
400.json
{
"error": "Missing required field: asset_id"
}401UnauthorizedInvalid or missing API key.
401.json
{
"error": "Invalid API key"
}429Too Many RequestsYou've exceeded your rate limit. See your current tier on the API Keys page.
429.json
{
"message": "Too Many Requests"
}500Internal Server ErrorSomething went wrong on our end. Try again or contact support if the issue persists.