Make use of recently played songs endpoint on Apple Music

295 Views Asked by At

I would like to make use of the "Get Recently Played Resources" endpoint of the Apple Music API.

More specifically, I would like to keep track of how often a user has listened to a specific song/album.

As of right now, I am not quite convinced if this is even possible with the Apple Music API (is it?)

Ideally, there would be an endpoint allowing me to retrieve a list of resources the user listened to during a specified period of time. Unfortunately, this is not the case, so I am trying to work with what I got, which is the "recently played" endpoint.

Now, I know that the endpoint returns the "recently played" songs of a user. However, it is not specified if there is a specific time range for which the history can be retrieved, or if there is any maximum amount of retrievable items. Neither does the documentation specify how frequently these informations are updated.

As I mentioned in the beginning of this post, it would be handy for me if I could determine in which time-range the user listened to the songs returned by the endpoint.

Example: I would like to fetch the latest 1.000 recently played items from this endpoint. In which period of time did the user listen to these items? 2 weeks, maybe 4?

In a nutshell, I am having a lot of questions in regards to this route, my most burning ones are the following:

  • how frequently are the "recently played" songs of a user updated?
  • is there a limited time-range for which I can retrieve the played songs, or does it go far back to when the user started using Apple Music?
  • is there a maximum amount of recently played resources I can
    retrieve?
  • do the results really include every single song a user listened to?

I would greatly appreciate any help in regards to this question and I am open for any suggestions you guys have!

0

There are 0 best solutions below