Apple Music API search request returning no data

When I attempt to use the Apple Music API to search for items in the Apple Music Catalog, like so:

GET https://api.music.apple.com/v1/catalog/us/search?term=james+brown&limit=2&types=artists,albums

A 200 Request Sucessful code is returned, but no response is returned for any search.

Is there something else I should be doing to get valid results from the Apple Music web API?

Replies

I just ran the query and got back two results, as expected. Are you saying that no JSON is returned at all?

The request is correct to get the first two artist and album matches for the term "james brown".

Hi yapshuter63


How you developing an iOS App? how are you generating the token?


I found a python script that creates a token and confimed it works with curl how ever I can not see how this could work in production. I assume some how my app would need to create a token on demand given they expire


thanks


Andy

You don't need to generate the token on demand. The documentation says that the token can be valid for up to six months (before it expires).


I generate the token every few months with the same script (I think): https ://github.com/pelauimagineering/apple-music-token-generator