← 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: duration—Object with min and max in seconds |
Response
Returns tracks that are acoustically similar to the given track.
{
"tracks": [
{
"asset_id": "string",
"name": "string",
"artist": "string",
"album": "string",
"duration": number,
"genre": "string",
"bpm": number,
"score": number,
"thumbnail_url": "string"
}
],
"meta": {
"total": number,
"limit": number,
"offset": number
}
}Example Request
Here's a complete example using Roblox's HttpService:
Luau (Roblox)
-- Find tracks similar to a given track
local HttpService = game:GetService("HttpService")
local RunService = game:GetService("RunService")
-- Use a test key in Studio, Secrets in production
local apiKey = if RunService:IsStudio()
then "your-test-key"
else HttpService:GetSecret("AudioScapeKey")
local response = HttpService:RequestAsync({
Url = "https://api.audioscape.ai/developer/v1/similar",
Method = "POST",
Headers = {
["x-api-key"] = apiKey,
["Content-Type"] = "application/json"
},
Body = HttpService:JSONEncode({
asset_id = "123456789",
limit = 10
})
})
local data = HttpService:JSONDecode(response.Body)
print("Found", data.meta.total, "similar tracks")Error Responses
400Bad RequestMissing or invalid asset ID.
{
"error": "Missing required field: asset_id"
}401UnauthorizedInvalid or missing API key.
{
"error": "Invalid API key"
}429Too Many RequestsYou've exceeded your rate limit. See your current tier on the API Keys page.
{
"message": "Too Many Requests"
}500Internal Server ErrorSomething went wrong on our end. Try again or contact support if the issue persists.