Sorry for my novice understanding, but I'm trying to get a simple listing of movie details from 2004 with a specific genre using python. I've referenced the developers.themoviedb.org section for support on this but can't get it to work. Any suggested approaches or resources where I can get some help?
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de ticao2 🇧🇷 pt-BR
le 16 janvier 2019 à 12h57
In order for someone to help you with API Request questions, it is critical that you post here the API Request you are using / creating / building.
Remember to replace your Key with [MY_KEY].
What I can anticipate is that it will probably be a two-step operation.
The first step will be to search for and receive the list of movies that fit your criteria / filter.
https://developers.themoviedb.org/3/discover/movie-discover
The second step, now with the IDs, will be to get the details of each movie.
https://developers.themoviedb.org/3/movies/get-movie-details
First of all, you need to know what the ID of each genre is.
https://developers.themoviedb.org/3/genres/get-movie-list
For this you need to have the list that can be received with the following Requisition:
https://api.themoviedb.org/3/genre/movie/list?api_key=[MY_KEY]&language=en-US
For example Comedy = 35
Example for first step:
https://api.themoviedb.org/3/discover/movie?api_key=[MY_KEY]&language=en-US&sort_by=original_title.asc&page=1&primary_release_year=2004&with_genres=35
And you will get something like that:
If the details you want did not come in this answer then you will have to make a Request for each ID to receive the details you want.
Réponse de mar1wvj
le 16 janvier 2019 à 15h29
Thanks for the reply. I was able to work through it by trial and error. The resulting request ended up as follows:
payload = "{}"
URL="/3/discover/movie?with_genres=35&primary_release_year=2004&page=1&language=en-US&api_key=&sort_by=popularity.desc"
conn.request("GET", URL, payload)
res = conn.getresponse()
data = res.read()
Réponse de ticao2 🇧🇷 pt-BR
le 16 janvier 2019 à 15h35
I can only help in this part of what you posted:
/3/discover/movie?with_genres=35&primary_release_year=2004&page=1&language=en-US&api_key=&sort_by=popularity.desc
And I think it does not meet the requirements. Compare with the one I posted:
I added the beginning to yours and tested it.
https://api.themoviedb.org/3/discover/movie?with_genres=35&primary_release_year=2004&page=1&language=en-US&api_key=[MY_KEY]&sort_by=popularity.desc
The result is the same as mine. So I think it's settled .