Assistance de TMDB

Hi,

I'm making a basic API call to retrieve Popular movies:

https://api.themoviedb.org/3/movie/popular?language=en-US&api_key=...&page=1

How can I filter and sort all these movies knowing that I can only get 20 for each page? There are quite a lot of results for this request:

Object { page: 1, total_results: 19634, total_pages: 982, results: Array[20] }

What would be the best approach?

Thank you in advance.

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

Jump to last post

Hi @Macxim

You can't really filter or sort most of the pre-made "featured" lists. If you want to start going down the path of customization, you should look at the discover methods. With discover you can use any one of the 30+ filters and sort options to design a query that is specific to your use case.

Thank you Travis for the prompt reply. I will look into it.

But then, it's more or less the same.
Let's say I display some movies with Discover, and I want to filter them by rating, I cannot filter them on the go.

I have to make a custom query for that, right? Each time I add a filter or sorting option, a new query must be done.

By the way, thanks for the examples of Discover here: https://www.themoviedb.org/documentation/api/discover 👍

Hi @Macxim,

I'm not sure if I understand what you mean by:

Let's say I display some movies with Discover, and I want to filter them by rating, I cannot filter them on the go.

When doing server side filtering and sorting, you will always have to query the API for an update with any potential new filters and data. There's no way around that.

By the way, thanks for the examples of Discover here: https://www.themoviedb.org/documentation/api/discover 👍

No problem wink

When doing server side filtering and sorting, you will always have to query the API for an update with any potential new filters and data. There's no way around that.

Well, what I meant was client side filtering and sorting. Thanks for clearing that up.

Have a great day!

@travisbell said:

Hi @Macxim,

I'm not sure if I understand what you mean by:

Let's say I display some movies with Discover, and I want to filter them by rating, I cannot filter them on the go.

When doing server side filtering and sorting, you will always have to query the API for an update with any potential new filters and data. There's no way around that.

By the way, thanks for the examples of Discover here: https://www.themoviedb.org/documentation/api/discover 👍

No problem wink

Hi Travis,

I am trying to retrive trending movies and also sort it by vote_count,vote_average something like that,

like this, https://api.themoviedb.org/3/trending/movie/week?api_key={API_KEY}&sort_by=vote_average.desc

but it doesn’t work right?

so how can i actually acheive it using discover or any other way.

sorry if my english is bad Thank you

Hi @Karma_haru, unfortunately, what you're looking to do is not possible. We don't support any filtering on the trending lists and discover doesn't have any access to trending scores. This is mostly because of what trending is, it's a realtime score around the "hotness" of an item which is changing every 10 minutes. Discover has popularity, which would be your next best bet.

@travisbell said:

Hi @Karma_haru, unfortunately, what you're looking to do is not possible. We don't support any filtering on the trending lists and discover doesn't have any access to trending scores. This is mostly because of what trending is, it's a realtime score around the "hotness" of an item which is changing every 10 minutes. Discover has popularity, which would be your next best bet.

hey Travis thanks for the reply , will look into it

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