0

The Apple Music API provides a service to fetch a song via an identifier, as detailed in their documentation in this format https://api.music.apple.com/v1/catalog/us/songs/900032829

My goal is to pick songs at random, from an array of songs. My current blocker is obtaining the song IDs from the ordinary Apple Music links, which is in this format: https://music.apple.com/us/album/take-on-me-1985-12-mix-2015-remastered/1035047659?i=1035048414

What would be the best way convert normal Apple Music links (such as the one above) to a the unique song id? (For the purpose of this project, the territory could be set as us)


Edit: there is a workaround to use the Spotify API, which is to look up a song's IRSC code, and then use the Apple Music's IRSC look up to find the song ID. (more detailed here)

The constraints of this project requires that I can only use the Apple Music API/MusicKit, which means the above workaround is not possible.

daspianist
  • 5,336
  • 8
  • 50
  • 94
  • What have you already tried? – Hazel へいぜる Oct 25 '21 at 19:36
  • I tried using the IRSC code of the song per this https://leemartin.dev/how-to-match-tracks-between-spotify-and-apple-music-2d6b6159957e, but the issue with this is that it requires the Spotify API to provide the IRSC code, which I can then look up on Apple Music. I am interested in a solution without using Spotify – daspianist Oct 25 '21 at 19:59

0 Answers0