The Movie Database Support

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.

1 reply (on page 1 of 1)

Jump to last post

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.

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login