How to query the iTunes API for movies in a specific genre

753 views Asked by At

I am trying to query the iTunes API for movies in a specific genre. I have been searching for hours now but can't seem to figure it out.

Example: https://itunes.apple.com/search?term=james+cameron&limit=25&entity=movie

This will give me a list of movies made by James Cameron, but I wan't to search for all the movies that match a specific genre, ex: "Romance".

When I look at the documentation here: https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/

It states that I can search for attribute=genreIndex, but I can't find anywhere this 'genreIndex' is specified. So I have no idea what to put in here? - I found several other questions relating to the same, and they all link to this: https://affiliate.itunes.apple.com/resources/documentation/genre-mapping.html

Which no longer exists?

Is there something I don't understand, or how am I supposed to do this?

Thanks! :)

1

There are 1 answers

0
bjorn.lau On BEST ANSWER

This solutions is not in the iTunes documentation, I found it by trying around. (I think that 'genreIndex' might be deprecated, and is now 'genreTerm' (Maybe Apple forgot to update it on the documentation). However, this works perfectly:

https://itunes.apple.com/search?term=romance&entity=movie&attribute=genreTerm