Published on July 10, 2026

A songs API gives your application programmatic access to search for tracks, pull metadata, and manage song data across streaming services. You need one when building search features, recommendation engines, playlist generators, or any product that works with individual tracks rather than full playlists or user libraries.
This guide covers what a songs API returns, the most common developer use cases, how to query tracks across multiple services with one integration, and how to handle the edge cases that slow down most builds.
A songs API is a REST interface for searching, retrieving, and managing individual tracks from music streaming services. It accepts queries (track name, artist, ISRC) and returns structured JSON with metadata like title, artist, album, duration, artwork, and identifiers.
You need a songs API when your product touches individual tracks:
If your feature operates at the playlist or library level, you want a playlist API instead. Most apps that grow beyond a single feature end up using both.
A well-built songs API returns a normalized track object with consistent field names and types, regardless of which streaming service the data originates from. Here are the core fields:
| Field | Type | Description |
|---|---|---|
name | string | Track title |
artists | string[] | Artist name(s) |
album.name | string | Album title |
album.images | object[] | Artwork URLs with dimensions |
durationMs | integer | Track length in milliseconds |
isrc | string or null | International Standard Recording Code |
explicit | boolean | Explicit content flag |
previewUrl | string or null | 30-second audio preview clip |
sourceId | string | Track's native ID on its streaming service |
service | string | Source streaming service name |
Raw responses from streaming services vary wildly. One platform returns duration in milliseconds, another in seconds, a third as an ISO 8601 string like PT3M24S. One returns artists as an array of objects with nested IDs; another returns a single concatenated string. A normalized songs API collapses all of that into one predictable shape.
Here is a normalized response vs. a raw one:
Raw response from a streaming service:
{
"track": {
"name": "Espresso",
"artists": [{ "id": "7n2Ycct...", "name": "Sabrina Carpenter", "type": "artist" }],
"album": {
"name": "Short n' Sweet",
"images": [
{ "url": "https://i.scdn.co/image/ab67...", "height": 640, "width": 640 },
{ "url": "https://i.scdn.co/image/ab67...", "height": 300, "width": 300 }
]
},
"duration_ms": 175492,
"explicit": true,
"external_ids": { "isrc": "USUM72404191" },
"popularity": 92
}
}
Normalized response from a songs API:
{
"type": "track",
"name": "Espresso",
"artists": ["Sabrina Carpenter"],
"album": {
"name": "Short n' Sweet",
"images": [{ "url": "https://i.scdn.co/image/ab67...", "height": 640, "width": 640 }]
},
"durationMs": 175492,
"isrc": "USUM72404191",
"explicit": true,
"sourceId": "2qSkIjg1o9h3YT9RAgYN75",
"service": "spotify"
}
Same data, cleaner shape. Your frontend code reads name, artists, durationMs, and isrc the same way whether the track came from Spotify, Apple Music, Tidal, or any other supported service.
The most common use case. Your user types a song name or artist into a search box, your backend queries the songs API, and you return ranked results. A unified songs API lets you search any connected service with the same request structure, so your users see the broadest possible catalog without you maintaining separate integrations per platform.
ISRCs (International Standard Recording Codes) are the closest thing to a universal track identifier. Every published recording gets a unique 12-character code that stays the same across all streaming services. When you have an ISRC from a label feed, a rights database, or a partner integration, you can look up that exact recording on any platform that supports ISRC search.
Service-specific IDs (like a native track ID) work when you already know the platform and track. Pass the ID and service name, get the full metadata object back.
You have a list of ISRCs from an internal database, a CSV from a distributor, or a partner catalog feed. A songs API lets you enrich each entry with album art, duration, explicit flags, and preview URLs in bulk. This pattern powers music discovery apps, analytics dashboards, and label tools that need complete metadata for large catalogs.
Here is how track search works with MusicAPI. One request, one response schema, results from whichever service you specify.
Search for tracks:
const MUSICAPI_BASE = 'https://api.musicapi.com';
async function searchTracks(userUUID, query, service) {
const response = await fetch(
`${MUSICAPI_BASE}/api/${userUUID}/search?query=${encodeURIComponent(query)}&type=tracks`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_MUSICAPI_TOKEN',
'x-service': service
}
}
);
return response.json();
}
// Same function, different service parameter. That is the entire integration difference.
const spotifyResults = await searchTracks(userUUID, 'Espresso', 'spotify');
const tidalResults = await searchTracks(userUUID, 'Espresso', 'tidal');
const deezerResults = await searchTracks(userUUID, 'Espresso', 'deezer');
Fetch a user's favorite tracks:
async function getLikedTracks(userUUID, service) {
const response = await fetch(
`${MUSICAPI_BASE}/api/${userUUID}/liked/tracks`,
{
headers: {
'Authorization': 'Bearer YOUR_MUSICAPI_TOKEN',
'x-service': service
}
}
);
return response.json();
}
Switch the service header to apple, youtube, amazon, or any of the other 19 supported services, and the response shape stays identical. No per-service parsing. No conditional field mapping. One integration covers every platform.
MusicAPI normalizes track metadata across all connected services so you write one integration instead of building and maintaining nineteen. It handles OAuth and token management, response normalization, and rate limit buffering behind the scenes. That means you skip weeks of per-service SDK work and go straight to building your product.
Not every streaming service returns every field. Here is what to expect:
| Field | Spotify | Apple Music | YouTube Music | Tidal | Deezer | Amazon Music |
|---|---|---|---|---|---|---|
| ISRC | Yes | Yes | No | Yes | Yes | Yes |
| Preview URL | Yes | Yes | No | Yes | Yes | Yes |
| Explicit flag | Yes | Yes | No | Yes | Yes | Yes |
| Genre (track-level) | No | Yes | No | No | No | No |
| Popularity score | Yes | No | No | Yes | No | No |
| Duration | Yes | Yes | Yes | Yes | Yes | Yes |
Check the full supported features matrix for detailed field availability across all 19 services.
When a field is unavailable for a given service, a well-built songs API returns null rather than omitting the key entirely. This keeps your response parsing predictable. Always code defensively for null on optional fields like isrc, previewUrl, and genres.
A track on one service in the US might not exist in Japan or Germany. Licensing agreements control regional catalogs. When a track is unavailable in the authenticated user's region, the search returns no match for that track on that service. Build your UI to handle empty results gracefully: show the track from an alternative service, display an availability notice, or let users select a different region.
Each streaming service enforces its own rate limits with different thresholds, windows, and penalty behaviors. MusicAPI abstracts this by returning a standard HTTP 429 with a Retry-After header when any upstream service throttles your request. Your retry logic stays the same regardless of which service triggered the limit. For quota details, check the rate limiting docs.
These two API categories serve different jobs. Here is a quick comparison:
| Songs API | Playlist API | |
|---|---|---|
| Unit of work | Individual tracks | Collections of tracks |
| Primary operations | Search, lookup, metadata retrieval | Create, read, update, delete playlists |
| Best for | Search bars, track matching, metadata enrichment, recommendations | Playlist sync, migration, user library management |
| Typical endpoint | POST /api/{userUUID}/search | GET /api/{userUUID}/playlists |
| Auth required | Depends (public search vs. user library) | Yes (user-scoped data) |
Use the songs API when you need to find or describe individual tracks. Use the playlist API when you need to manage grouped collections. Many features use both: a playlist generator searches for tracks (songs API), then creates a playlist and adds them (playlist API).
A songs API focuses on individual track operations: searching, retrieving metadata, and looking up recordings by title, artist, or ISRC. A music API is the broader category that also covers playlists, albums, artists, user profiles, and library management. MusicAPI is a full music API that includes songs API capabilities alongside playlist, album, and artist endpoints.
Yes. With MusicAPI, you call the same search endpoint and change the x-service header to target different platforms. The response schema stays identical regardless of the source. One parsing function handles results from all 19 supported services.
A normalized songs API returns track title, artist name(s), album name, album artwork URLs, duration in milliseconds, ISRC, explicit flag, preview URL, and the track's native service ID. Some services return additional fields like popularity scores and genre tags. See the full supported features matrix for per-service field availability.
Regional availability is controlled by each platform's licensing agreements. When a track is not available in the user's region, the search returns no match on that service. Build your app to handle empty results: show the track from an alternative service, display a regional availability notice, or query a different service where the track is licensed.
MusicAPI offers a free trial with access to all search and metadata endpoints across every supported service. Public endpoints have a baseline rate of 1 request per minute per IP. Authenticated endpoints start at 300 requests per minute. For production workloads, check the pricing page for usage-based plans.
Pass an ISRC to the search endpoint and MusicAPI queries the target service for that exact recording. ISRCs match correctly about 85% of the time across platforms. The remaining 15% can fail because the same recording sometimes has different ISRCs across regions or reissues. For highest match rates, combine ISRC lookup with fuzzy matching on title, artist, and duration as a fallback.
No. MusicAPI uses a single authentication flow that manages OAuth tokens, refresh cycles, and session state for all connected services. You initialize auth once through MusicAPI, handle one callback, and MusicAPI manages per-service credentials automatically. No need to register developer apps on each platform.
Ready to skip months of OAuth and SDK work? Start your free MusicAPI trial and connect 10+ streaming services with one unified API.