Hi,
using /search/multi I sometimes get duplicate results on consecutive pages. For example: Jon Baker, id: 1546757 is the last item in /search/multi?query=jon&page=7 and the first item /search/multi?query=jon&page=8. Is this a bug or should I always take this into account and filter out duplicates when using pagination?
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 June 12, 2020 at 1:06 PM
In order for someone to help you with API Request questions, it is critical that you post here the API Request you are using.
Remember to replace your Key with THE_KEY , or something like that.
I made these two API requests and this ID 1546757 was not on pages 7 or 8.
https://api.themoviedb.org/3/search/multi?api_key=THE_KEY&query=jon&page=7
https://api.themoviedb.org/3/search/multi?api_key=THE_KEY&query=jon&page=8
You'd better post the API Requests you made.
Reply by Bene8493
on June 12, 2020 at 2:11 PM
I'm sorry. These were the requests:
https://api.themoviedb.org/3/search/multi?query=Jon&page=7
https://api.themoviedb.org/3/search/multi?query=Jon&page=8
I use the Authorization Header instead of the api_key query parameter. The problem is not specific to ID 1546757 it happens with many other people too. I just tested it again and there were no duplicates until page 11. Then again, the last item from page 10 was the first item on page 11: "Jon Ekstrand" ID: 1077404.
Tested again with query: "The". This time there was a duplicate Movie on page 3:
https://api.themoviedb.org/3/search/multi?query=The&page=2
https://api.themoviedb.org/3/search/multi?query=The&page=3
Again last item from page 2 is first item on page 3. There seem to be different duplicates each time I try so might not be easy to reproduce. Most of the time the first duplicate appears after page 5.
Reply by ticao2 š§š· pt-BR
on June 12, 2020 at 2:43 PM
I tried to reproduce the error and failed.
I checked in 10 pages of a Requisition.
Perhaps if I checked in 20 pages the error would arise.
I believe that only Travis Bell can have an answer.
So let's leave your question open and wait for him to see it.
Reply by Bene8493
on June 15, 2020 at 6:42 AM
Would be nice if Travis could take a look at it. I wrote a python script to reproduce it. So far I found at least one duplicate every time I run it. The results seem to change quite often, but there are always duplicates in the first 10 pages it seems. Let me know if you need anything else.
Reply by ticao2 š§š· pt-BR
on June 15, 2020 at 10:34 AM
@Bene8493
I sent a warning to Travis Bell.
This problem is far beyond my ability.
Thank you.
Reply by Travis Bell
on June 17, 2020 at 11:27 AM
Hi @Bene8493, I've created a ticket to track this here. Unfortunately I don't have any time to look at this in the near future but at least I have it tracking now.
Reply by Bene8493
on June 22, 2020 at 2:41 PM
Thanks. FYI: also happens in v4 recommendations (/account/{account_id}/movie/recommendations). I got Movie id 393 on page 2 and 4.
Reply by bicelis
on June 23, 2024 at 8:32 AM
Hello :) I'm still experiencing this issue in 2024. @travisbell, is there a fix perhaps in progress? :)
Reply by Travis Bell
on June 25, 2024 at 2:05 PM
As items shift around due to either changing data, or things like updated popularity scores during the day, we make no guarantee that there won't be duplicate items across multiple pages. This is because a lot of data is cached.
You can track which ID's have been "seen" by your app and skip ones that have already been returned.