Hi Travis,
1) Will this link http://files.tmdb.org/p/exports/movie_ids_04_28_2017.json.gz always give me the most updated version containing the latest added movies?
2) When a new movie is added in the file, is it always added at the end of the file or might it be added anywhere in the file?
Thanks :)
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 March 21, 2018 at 10:19 PM
Hi there,
No. You need to query the current days export if you want the most recent export.
movie_ids_03_21_2018.json.gz
for today, as an example.I don't think the ids in the file are contiguous. This is because the file is written asynchronously with multiple workers. Therefore it is possible any one of those workers finishes before another one that is writing ids farther down the ID space.
Reply by StephanosPapastylianou
on March 22, 2018 at 1:50 PM
I am not really concerned with the id order. What I want to know is the position in the file that the movies are added.
So for example if 5 movies are added in today's file, will that be the last 5 lines of the file? Or could they be added at any line in the 300,000+ lines?
If I compare today's file and yesterday's file, will the last 5 lines be the only difference?
Reply by Travis Bell
on March 22, 2018 at 1:53 PM
I believe they could be anywhere.
Reply by StephanosPapastylianou
on March 30, 2018 at 6:06 AM
Hi again Travis,
I wasn't sure whether to open a new discussion but as my question is similar I thought it was better to reopen this one.
I have stored the movies in my database which I got from the daily export file. Now the next step I want to perform is an 'update' action to update the database with new movies and update any changed data of the existing ones.
1) Is there a way to get the new movies directly, or is the only way by comparing today's daily export file to find the movies that don't exist in yesterday's?
2) Reading through the API docs I think updating the movies already added in my database can be done with GET /movie/changes & GET /movie/{movie_id}/changes, but I wanted to make sure I understood correctly.
GET /movie/changes will give me a list of ids that are the ids of the movies that have one or more attributes changed
And then using that list, GET /movie/{movie_id}/changes will give me the specific attribute(s) of the movie that changed
Thanks in advance!
Reply by Travis Bell
on March 31, 2018 at 11:39 AM
Diffing the two files is probably the easiest. If it's something you are going to run daily, the other way would be to query the /movie/latest method and compare the value from the day before. The difference in 24 hours won't be too high, and iterating over just those ids would be easy as well.
Yes, that's correct.
Reply by StephanosPapastylianou
on April 2, 2018 at 5:42 AM
Thanks for clarifying.
So reading the docs, I understand that /movie/latest returns only the latest movie. So the result will always be just 1 movie. Am I wrong? Does it return a list of all the movie ids that have been added in the last 24 hours?
Reply by Travis Bell
on April 2, 2018 at 11:14 AM
Yes it's just a single id. What I was saying is that in a 24 hour period let's say ~170 movies get created. And by checking the latest at the same time every day you can built a simple tool to stay in sync:
You know on April 2 that you only need to start at id 515493 and iterate up to 515663 to get check the newly created items. Iterating over 170 items a night is not very much.
Reply by StephanosPapastylianou
on April 2, 2018 at 11:21 AM
Oh ok yeah that makes sense now thanks!
One more question, how often does the popularity of movies and people get updated?
Reply by Travis Bell
on April 2, 2018 at 11:22 AM
No problem
Popularity is updated every day. For ingesting popularity data, the easiest way would definitely be the ID exports.
Reply by StephanosPapastylianou
on April 2, 2018 at 11:28 AM
Ok thanks :)
Reply by StephanosPapastylianou
on April 2, 2018 at 12:03 PM
Is the popularity linked between the movies? (in order for a movie's popularity to increase, another one's has to decrease?)
If that's the case, doesn't this mean that since popularity gets updated every day, all movies would have their popularity updated and hence all be returned when using movie/changes ?
But clearly this is not the case so I'm missing something...
Reply by Travis Bell
on April 2, 2018 at 12:07 PM
No. It's an unbounded value that is solely tied to the data we track for popularity. That is detailed here.
Changes tracks data changes only. Popularity is not tracked like that. It's just a value that goes up and down.
Reply by StephanosPapastylianou
on April 2, 2018 at 12:14 PM
Ok so the only way to get the updated popularity is to get the value in the daily export? I am concerned because iterating through all the data daily is very difficult!
Reply by Travis Bell
on April 2, 2018 at 12:23 PM
The current values are also available on the get details method. Those are the two best ways.
Reply by StephanosPapastylianou
on April 2, 2018 at 12:28 PM
Ok thanks for the clarification!