Get ISRC code from iTunes Search API (Apple music)
Asked Answered
N

1

8

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?

Neurophysiology answered 28/4, 2016 at 21:37 Comment(1)
Hi, did you ever find a solution to this?Salaried
B
1

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"
        }
    ]
}
Brainard answered 28/4, 2020 at 3:41 Comment(1)
Do you know if this is possible to do on-device? Like via an MPMediaItem (developer.apple.com/documentation/mediaplayer/mpmediaitem)Goulette

© 2022 - 2024 — McMap. All rights reserved.