Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get ISRC code from iTunes Search API (Apple music)

Apple has a search API that allows you to query the iTunes Store for music:

https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/

Here is an example search: https://itunes.apple.com/search?term=jack+johnson&entity=song

An ISRC code allows is a standard identifier for song across markets (https://en.wikipedia.org/wiki/International_Standard_Recording_Code). Spotify for example returns the ISRC in their api.

Is there anyway I could get this code for an iTunes track? If Apple does not provide it themselves, is there someway I could find it using the metadata that they do provide?

Thanks so much!

like image 504
evenodd Avatar asked Apr 28 '16 21:04

evenodd


Video Answer


1 Answers

The answer is finally yes. Through their Apple Music API: https://developer.apple.com/documentation/applemusicapi/song/attributes

It's a part of the attributes of every song

isrc string (Required) The International Standard Recording Code (ISRC) for the song.

And here are listed all the ways you can get songs: https://developer.apple.com/documentation/applemusicapi/songs

For example you can use the Get a Catalog Song endpoint by providing an iTunes ID:

// https://api.music.apple.com/v1/catalog/us/songs/900032829
{
    "data": [
        {
            "attributes": {
                // ...
                "isrc": "NLH851300057",
                "name": "Something For the Pain"
                // ...
            },
            "href": "/v1/catalog/us/songs/900032829",
            "id": "900032829",
            "relationships": {
                "albums": { /* ... */ },
                "artists": { /* ... */ }
            },
            "type": "songs"
        }
    ]
}
like image 64
Dimitar Nestorov Avatar answered Oct 11 '22 13:10

Dimitar Nestorov