Is there a way to search and sort at the same time? Appears search is /search and sort is /discover? Why not just have one ring to rule them all ;)?
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by ticao2 š§š· pt-BR
on January 1, 2021 at 7:21 AM
No.
It is not possible to use Sort as a parameter in a Search API Request.
Yes.
Sort is one of the possible parameters used in a Discover API Request.
I think you use Search to find a movie or a person you know the title or name.
Of course, there are homonyms or names that are very similar.
So I'm not really sure what criteria you want to use to Sort the items in the answer.
Can you give us an example?
Reply by mangeletti
on January 2, 2021 at 11:47 AM
Can i give an example? Of course, plenty of examples to choose from: Show me TV shows that have 'dog' in their title and sort them by ratings. Show me 'Chris Nolan' movies sorted by rating.
Reply by ticao2 š§š· pt-BR
on January 2, 2021 at 3:03 PM
Your first example I believe is not possible.
In Discovry I don't know how to filter by title.
But the second example I believe is possible.
Let's assume that the Chris Nolan you're referring to is Christopher Nolan, this:
https://www.themoviedb.org/person/525-christopher-nolan
Then we can make the following API Request:
https://api.themoviedb.org/3/discover/movie?api_key=THE_KEY&language=en-US&sort_by=vote_average.desc&page=1&with_people=525
There are other options for sort_by.