MusicGraph API Documentation

Track API

API calls for getting data about tracks.

The base URL path for album queries is: http://api.musicgraph.com/api/v2/track/

Track Endpoints

Resource URL Description
/search Return results based on search operations; described in more detail below
/suggest Return a list of tracks based on a partial name passed
/{id} Return meta about a track
/{id}/edges Return all edges for a track

Track Title and ID Lookup

The API provides auto-complete suggestions — or, “predictions” – for  track titles. Auto-complete minimizes the number of false positive for tracks searches. You can search a list of suggested tracks using a prefix; returning a list of potential song matches based upon a query string.

Parameter Required Description Example
api_key yes The developer API key api_key=c8303e90962e3a5ebd5a1f260a69b138
prefix yes Contains &prefix=wonderf
genre no Use to filter the suggest results. Values here &genre=rock
decade no Use to filter the suggest results. Values here &decade=2000s
limit no By default, the API will return 20 results. Use the limit query string parameter to return a custom number of results (max 100). &limit=20
offset no Use the offset query parameter to perform pagination on the results set. &offset=10

Example:

Track Search

You can perform simple to complex search operations using parameters and filters detailed below.

Parameter Required Description Example
api_key yes The developer API key api_key=c8303e90962e3a5ebd5a1f260a69b138
title no Return tracks that match the title; exact, case insensitive &title=Royals
artist_name no Find tracks by the given artist; prefix, case insensitive &artist_name=Pink
decade no Return tracks that were released during a given decade; case insensitive. Values here &decade=2010s
genre no Return tracks that belong to a given genre; contains, case insensitive. Values here &genre=pop
isrc no Return tracks that match a given isrc; exact, case sensitive. &isrc=GBBKS0700574
lyrics_phrase no Return tracks with lyrics that have an exact match of the given string; case insensitive &lyrics_phrase=honest
lyrics_keywords no Return tracks with lyrics that have keywords that are "most representative" (i.e. in the song's "bag of words"); case insensitive &lyrics_keywords=fly
lyrics_lang no Return tracks with lyrics of a specified language; case insensitive. Values here &lyrics_lang=es
limit no By default, the API will return 20 results. Use the limit query string parameter to return a custom number of results (max 100). &limit=10
offset no Use the offset query parameter to perform pagination on the results set. &offset=10

Examples:

You can search for tracks by Adele.

You can search for popular blues tracks.

You can search for rap/hip hop tracks with the keywords fly.

Use the `limit` query string parameter to return a custom number of results (max 100).

Track Edges

Property Name Description
/{id} Returns the metadata of the track
/{id}/artists Returns the artist(s) who performed on the track
/{id}/albums Returns the albums that contain the track

Examples for Adele's song Rolling in the Deep:

Property Name Example
Metadata /api/v2/track/f05e067b-a6c0-11e0-b446-00251188dd67
Artists /api/v2/track/f05e067b-a6c0-11e0-b446-00251188dd67/artists
Albums /api/v2/track/f05e067b-a6c0-11e0-b446-00251188dd67/albums

Choosing Fields:

By default, all the fields are returned when you make a query. You can choose the fields you want returned with the "fields" query parameter. This is really useful for making your API calls more efficient and fast.

Try it out!