从iTunes搜索API(苹果音乐)获取ISRC代码



苹果有一个搜索API,可以让你查询iTunes商店的音乐:

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

以下是搜索示例:https://itunes.apple.com/search?term=jack+johnson&entity=歌曲

ISRC代码允许是跨市场歌曲的标准标识符(https://en.wikipedia.org/wiki/International_Standard_Recording_Code)。例如,Spotify在其api中返回ISRC。

有没有什么办法可以让我获得iTunes曲目的代码?如果苹果自己不提供,我有没有办法用他们提供的元数据找到它?

非常感谢!

答案最终是肯定的。通过他们的Apple Music API:https://developer.apple.com/documentation/applemusicapi/song/attributes

这是每首歌曲属性的一部分

isrcstring(必需)歌曲的国际标准录音编码(isrc)。

下面列出了您获取歌曲的所有方式:https://developer.apple.com/documentation/applemusicapi/songs

例如,您可以通过提供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"
        }
    ]
}

最新更新