Suporte do The Movie Database

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?

3 respostas (na página 1 de 1)

Jump to last post

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:

{
  "page": 1,
  "total_results": 1125,
  "total_pages": 57,
  "results": [
    {
      "vote_count": 204,
      "id": 9805,
      "video": false,
      "vote_average": 6.3,
      "title": "Dreamship Surprise - Period 1",
      "popularity": 7.289,
      "poster_path": "/w4EZC3GeNwLNo5KNkj4QLOWyGII.jpg",
      "original_language": "de",
      "original_title": "(T)Raumschiff Surprise - Periode 1",
      "genre_ids": [
        35,
        878
      ],
      "backdrop_path": "/A41kszh8uig7nWIAgEFdY6MzrLx.jpg",
      "adult": false,
      "overview": "Hundreds of years after humans have settled on Mars, Regulator Rogul and Lord Jens Maul, lead a force of Martians to Earth in order to conquer the planet. Queen Metaphor looks to the gay heroes aboard the spaceship Surprise -- Captain Kork, Mr. Spuck, and first engineer Schrotty",
      "release_date": "2004-07-14"
    },
    {
      "vote_count": 9,
      "id": 59700,
      "video": false,
      "vote_average": 5.4,
      "title": "12 Days of Christmas Eve",
      "popularity": 1.4,
      "poster_path": "/bz9uNLaf9mzopYT6aw6iuCT8E4L.jpg",
      "original_language": "en",
      "original_title": "12 Days of Christmas Eve",
      "genre_ids": [
        10770,
        10751,
        14,
        35,
        18
      ],
      "backdrop_path": "/cUd2qXmRzJEqNcn1XQcGu3CSo3y.jpg",
      "adult": false,
      "overview": "Calvin Carter, a successful business executive, has it all, but neglects those closest to him. On Christmas Eve, all that changes when the sign on his office building falls on him. He awakes in a hospital bed, attended to by Angie, a nurse who soon lets him know he has 12 days (12 chances) to get his act together and achieve the \"perfect\" Christmas Eve. If he doesn't, there will be dire consequences.",
      "release_date": "2004-12-07"
    },
    {
      "vote_count": 2354,
      "id": 10096,
      "video": false,
      "vote_average": 6.5,
      "title": "13 Going on 30",
      "popularity": 9.725,
      "poster_path": "/iSvz2Nk1vzgm7bEMqMazhQ1F3zA.jpg",
      "original_language": "en",
      "original_title": "13 Going on 30",
      "genre_ids": [
        35,
        14,
        10749
      ],
      "backdrop_path": "/1sJoLA3bjKvblPh7GR9URBWZsDO.jpg",

    etc...
    etc...
    etc...

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.

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()

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:

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  
_________________________/3/discover/movie?with_genres=35&primary_release_year=2004&page=1&language=en-US&api_key=[MY_KEY]&sort_by=popularity.desc

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 .

Não consegue encontrar um certo Filme ou Série? Inicie Sessão e adicione-o.

Geral

s focus the search bar
p abrir menu do perfil
esc close an open window
? open keyboard shortcut window

Em páginas de Média

b go back (or to parent when applicable)
e ir para a página de edição

Em Páginas de Temporadas de Séries

(seta para a direita) ir para a próxima temporada
(seta para a esquerda) ir para a temporada anterior

Em Páginas de Episódios de Séries

(seta para a direita) ir para o próximo episódio
(seta para a esquerda) ir para o episódio anterior

Em Todas as Páginas de Imagens

a abrir janela para adicionar imagem

Em Todas as Páginas de Edição

t open translation selector
ctrl+ s submit form

Em Páginas de Discussão

n criar uma nova discussão
w toggle watching status
p toggle public/private
c toggle close/open
a abrir actividade
r reply to discussion
l ir para a última resposta
ctrl+ enter submit your message
(seta para a direita) página seguinte
(seta para a esquerda) página anterior

Definições

Deseja classificar ou adicionar este item a uma lista?

Iniciar Sessão

Ainda não é um membro?

Crie uma Conta e Adere a Comunidade