Playlist
POSThttps://api.audioscape.ai/developer/v1/playlistOn 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
| Name | Type | Description |
|---|---|---|
| x-api-key | required | Your API key |
| Content-Type | required | Must be application/json |
| X-Universe-Id | optional | Roblox Universe ID (sent automatically by SDK) |
| X-Place-Id | optional | Roblox Place ID |
| X-Player-Id | optional | Player 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.
| Field | Type | Description |
|---|---|---|
| playlist_id | string, required | The playlist ID (e.g. station-electronic-1712...) |
List Playlists
Pass {"action": "list"} to list all playlists for your API key.
| Field | Type | Description |
|---|---|---|
| action | string, required | Must be "list" |
Get Playlist Response
{
"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
{
"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:
-- 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()
endError Responses
400Bad RequestMissing or invalid playlist_id.
401UnauthorizedMissing or invalid API key. Confirm your x-api-key header is set.
404Not FoundPlaylist not found — wrong ID, or it belongs to a different API key.
429Too Many RequestsYou've exceeded your rate limit. See your current tier on the API Keys page.
500Internal Server ErrorSomething 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