Get now playing track Apple Music API


I'm developing an app that needs to retrieve information on the track the user is listening to in Apple Music, but what I found so far in the API documentation is fetching recent activity.

Does anyone know if Apple Music API provides this service?



Hey, I was searching for the same, but there is´nt a API for. Really sad... other streaming services have this

Now there is. Although this is not a "now" playing API, it is the closest.

The closest thing to this is by observing the SystemMusicPlayer.shared this class gives you queue and state instance properties . With the currentEntry.item of the queue you can get a Song or MusicVideo ID so you can use that to fetch the right content

More about SystemPlayer:

EDIT: Just noticed this was about the Apple Music API and not MusicKit