Hi! I'm using the TMDB API to build a small application. I use the /search/movie
endpoint to list movies. While implementing paging I noticed that multiple pages can apparently contain the same entry. As an example, at time of testing:
https://api.themoviedb.org/3/search/movie?query=Star Wars&include_adult=false&language=en-US&page=7
https://api.themoviedb.org/3/search/movie?query=Star Wars&include_adult=false&language=en-US&page=8
Page 7 and 8 both contain the entries "The Making of Star Wars Attack of the Clones" (id: 1152956) and "Star Fleet: The Thalian Space Wars" (id: 584907).
When I make the same queries with include_adult=true
, I don't (seem to) get duplicate entries.
I don't know much about backend/db querying but I believe the filtering of adult entries is done at the wrong point in the data flow, which causes duplicate entries in separate pages.
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 Travis Bell
on August 8, 2025 at 12:14 PM
You're just running into the cache. Some previous pages were already cached but then when our nightly re-index runs (which will change the popularity) and as pages expire, the data returned can be in a different order.
By using a new parameter (
include_adult
) you're going to run into pages that have a much less chance of being cached.Bottom line though, we make no guarantees about the order of the items returned in search and discover. Requests can be cache. It's best to just grab the data from the pages you're interested in and then de-duping the data locally on your end.