← API Reference

Playlist

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

On this pageEndpoint

Endpoint

Fetch playlists configured in the Configure tab. Use this endpoint to list all playlists for your API key, or fetch a specific playlist with its ordered tracks for playback in your game.

Headers

NameTypeDescription
x-api-keyrequiredYour API key
Content-TyperequiredMust be application/json
X-Universe-IdoptionalRoblox Universe ID (sent automatically by SDK)
X-Place-IdoptionalRoblox Place ID
X-Player-IdoptionalPlayer ID for per-player analytics

Request Body

This endpoint supports two modes depending on the request body:

Get Playlist

Pass a playlist_id to fetch a specific playlist and its tracks.

FieldTypeDescription
playlist_idstring, requiredThe playlist ID (e.g. station-electronic-1712...)

List Playlists

Pass {"action": "list"} to list all playlists for your API key.

FieldTypeDescription
actionstring, requiredMust be "list"

Get Playlist Response

200 OK
{
  "playlist": {
    "id": "station-electronic-1712...",
    "name": "Electronic",
    "genre": "Electronic",
    "playback_mode": "shuffle",
    "track_count": 25
  },
  "tracks": [
    {
      "asset_id": "123456789",
      "name": "Midnight Drive",
      "artist": "Neon Pulse",
      "album": "Synthwave Dreams",
      "genre": "Electronic",          // canonical
      "genre_slug": "electronic",     // URL-safe, drill-downable via /v1/browse
      "duration": 195,
      "bpm": 128,
      "position": 1,
      "created_at": "2024-01-15T...",
      "updated_at": "2024-01-15T..."
    }
  ],
  "meta": { "total": 25 }
}

List Playlists Response

200 OK
{
  "playlists": [
    {
      "id": "station-electronic-1712...",
      "name": "Electronic",
      "genre": "Electronic",
      "track_count": 25,
      "playback_mode": "shuffle"
    }
  ],
  "meta": { "total": 1 }
}

Example

Using the Luau SDK to fetch and play a playlist:

Luau (Roblox)
-- List all playlists
local list, listErr = client:listPlaylists()
if not list or #list.playlists == 0 then
    warn(listErr or "no playlists configured")
    return
end

-- Fetch a specific playlist
local result, err = client:getPlaylist({
    playlist_id = "station-electronic-1712...",
})
if not result then warn(err) return end

print(result.playlist.name, "—", #result.tracks, "tracks")

-- Play tracks sequentially (Ended:Wait blocks until each finishes)
for _, track in result.tracks do
    local sound = Instance.new("Sound")
    sound.SoundId = "rbxassetid://" .. track.asset_id
    sound.Parent = workspace
    sound:Play()
    sound.Ended:Wait()
    sound:Destroy()
end

Error Responses

400Bad Request

Missing or invalid playlist_id.

401Unauthorized

Missing or invalid API key. Confirm your x-api-key header is set.

404Not Found

Playlist not found — wrong ID, or it belongs to a different API key.

429Too Many Requests

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

500Internal Server Error

Something went wrong on our end. Retry with backoff; if it persists, ping us on Discord.

Ready to soundtrack your game?

Wire a curated playlist into your radio, lobby, or boombox in minutes.

Get Your API Key