← API Reference

Find Similar

POST
https://api.audioscape.ai/developer/v1/similar

Endpoint

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

NameTypeDescription
x-api-keyrequiredYour API key
Content-TyperequiredMust be application/json

Request Body

ParameterTypeDescription
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:
durationObject 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 Request

Missing or invalid asset ID.

{
  "error": "Missing required field: asset_id"
}
401Unauthorized

Invalid or missing API key.

{
  "error": "Invalid API key"
}
429Too Many Requests

You've exceeded your rate limit. See your current tier on the API Keys page.

{
  "message": "Too Many Requests"
}
500Internal Server Error

Something went wrong on our end. Try again or contact support if the issue persists.

Ready to get started?

Create your API key and start building with AudioScape today.

Get Your API Key