Assistance de TMDB

For now, I can get only 20 movies. How can I get more movies?

7 réponses (sur la page 1 sur 1)

Jump to last post

Use the page parameter. Each page has 20 movies (besides the last, usually) and by appending &page=2 (or whatever page number) to your api call, you can get the second page. There is also a total_pages parameter you can use to find the total number of pages.

Examples:

  • Page 1https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=1
  • Page 2 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=2
  • Page 3 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=3
  • Page 4 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=4

You should get a response like this:

{
  "page": 1, //or whatever page you queried
  "results": [] //movies are in this array
  "total_pages": 1000,
  "total_results": 20000
}

Hope this helps.

It works perfectly, Thanks so much!!!!!!

Sure thing. Glad to help

Sorry, one question more How can I guess how many pages are there for horror movies?

If you are searching for a specific genre, then you can use the discover feature, and add the with_genres parameter. You would need to make a call to the /genres/movies/list endpoint to get a list of genres, and their respective IDs. Once you find the ids of the genre you are looking for, then you can add them to the with_genres parameter. For instance, I believe that the Action genre's id is 28, so for action movies, you would pass with_genres=28as parameter to the discover endpoint. If you want to add more genres to search, then you can, just seperate each with a comma like so: with_genres=28, 56, 345 (these aren't real genre IDs - you will have to find them from the genre list. To get the list of genres

https://api.themoviedb.org/3/genre/movie/list?api_key=YOUR_API_KEY&language=en-US

To use the discover endpoint, see the docs:

https://developers.themoviedb.org/3/discover/movie-discover

Once you make that request, you can view the total_pages parameter in the response to find the total number of pages with your specific filters.

Thanks so much.

Sure

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion