When pulling from the API using my API Key, I am getting results that do not appear to be sorted properly. All of these seem to have issues...
By Popularity - when displaying the popularity of the titles, they are not sorted in descending order as requested
/discover/movie?page=1&with_original_language=en&language=en-US&adult=false&sortby=popularity.desc&with_release_type=4&primary_release_date.lte=2022-06-18
/discover/tv?page=1&with_original_language=en&language=en-US&adult=false&sortby=popularity.desc&air_date.lte=2022-06-18
By Release Date or Air Date - when displaying the release or air date of the titles, they are not sorted in descending order as requested
/discover/movie?page=1&with_original_language=en&language=en-US&adult=false&sortby=release_date.desc&vote_count.gte=100&with_release_type=4&primary_release_date.lte=2022-06-18
/discover/tv?page=1&with_original_language=en&language=en-US&adult=false&sortby=air_date.desc&vote_count.gte=100&air_date.lte=2022-06-18
Top Votes - when displaying the number of votes of the titles, they are not sorted in descending order as requested
/discover/movie?page=1&with_original_language=en&language=en-US&adult=false&sortby=vote_count.desc&vote_count.gte=5000&with_release_type=4&primary_release_date.lte=2022-06-18
/discover/tv?page=1&with_original_language=en&language=en-US&adult=false&sortby=vote_count.desc&vote_count.gte=5000&air_date.lte=2022-06-18
Is this an issue that is happening for everyone or just me? I am currently using API v3. I cannot tell what they are actually sorting by as it seems to be close to the right orders, but the titles are each off by a few positions one way or another.
Thanks, Wil
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 wilhud
on June 23, 2022 at 10:38 PM
Figured I would post my results to try and illustrate what I mean...
Popular Movies Sort (Popularity score in parenthesis)
Popular TV Shows Sort (Popularity score in parenthesis)
Movie Vote Sort (Vote count in parenthesis)
Release Date Sort (Release date in parenthesis)
Is it possible that I am maybe not understanding what is being sorted by?
Thanks, Wil
Reply by Travis Bell
on June 24, 2022 at 10:31 AM
Hi Wil,
A few things:
The param you're looking for is
sort_by
notsortby
.Also, when choosing any sort orders by date, unless you use
primary_release_date
, you'll always want to use theregion
filter. Since multiple release dates can exist on any particular item per country, and you're not specifying awith_release_type
, the earliest date is always used. However, that might not be what is displayed since you're not specifyingwith_release_type
. The default chosen order for release types are (in order)[2,3,1,4,5,6]
I do believe.Lastly, there is no guaranteed sync between the state of these three things:
All three of these individually, and especially together, will introduce some of the small differences you're noticing. We're not really concerned about everything needing to be 100% accurate (eventual sync is fine) as it's a general discovery engine and these nuances are ok with us.
Reply by wilhud
on June 24, 2022 at 12:13 PM
Perfect, thank you so much Travis! That helped a ton!!
I had previously had the sortby set to sort_by but I must have accidentally re-typed it wrong in a previous update. I had omitted the other parameters for simplicity but I do have with_release_type included in all of my requests.
Thank you for the additional info on the release type order and on the region requirement. Already tested them out and things are running well now.
Much appreciated, Wil