Skip to main content
The songs endpoints let you browse every song in the catalog or retrieve a single track by its stable ID. Song IDs are consistent across all endpoints and can be used to fetch lyrics.

List all songs

Get every track across the entire catalog in one request.

Get a single song

Fetch details for one track by its song_id.

List all songs

Send a GET request to /songs to retrieve every song in the catalog. The response is an array of song objects ordered by song ID.
curl https://taylor-swift-api.sarbo.workers.dev/songs
Example response (truncated)
[
  { "song_id": 1, "title": "Blank Space", "album_id": 1 },
  { "song_id": 2, "title": "Style",       "album_id": 1 },
  ...
]

Get a single song

Send a GET request to /songs/{songID} to retrieve one song by its ID. The example below fetches song 10, which is Wonderland from the debut album.
curl https://taylor-swift-api.sarbo.workers.dev/songs/10
Example response
{
  "song_id": 10,
  "song_title": "Wonderland",
  "album_id": 1
}

Song object fields

The song object returned by /songs/{songID} has three fields:
FieldTypeDescription
song_idintegerStable unique identifier for the song.
song_titlestringSong title (single-song response only).
album_idintegerID of the album this song belongs to.
The title field is named differently depending on which endpoint you call. In the list response (GET /songs), the field is title. In the single-song response (GET /songs/{songID}), the same field is named song_title. Account for this difference when writing code that handles both responses.

Finding a song’s album

Every song object includes the album_id it belongs to. You can use that value to call GET /albums/{albumID} and retrieve the full tracklist, or look up the album name from a cached call to GET /albums.
fetch
// Fetch a song and then look up its album name
const songResp = await fetch('https://taylor-swift-api.sarbo.workers.dev/songs/10');
const song = await songResp.json();

const albumsResp = await fetch('https://taylor-swift-api.sarbo.workers.dev/albums');
const albums = await albumsResp.json();

const album = albums.find(a => a.album_id === song.album_id);
console.log(`${song.song_title} is on ${album.title}`);
// Wonderland is on Taylor Swift

Build docs developers (and LLMs) love