دعم الموقع

Hello,

How do I get all the movies using the API? I tried the popular or the top rated and it worked but it only gives me popular or top rated...how do I request for all movies?

Thanks, Regie

6 ردود (على هذه الصفحة 1 من 1)

Jump to last post

thanks for that tip...i'll try that.

it only retrieves 20 movies per page, how do i access the next page. ?

Hi coolmanhaha,

You can access subsequent pages by using the page param:

https://api.themoviedb.org/3/movie/now_playing?api_key=###&page=1
https://api.themoviedb.org/3/movie/now_playing?api_key=###&page=2
https://api.themoviedb.org/3/movie/now_playing?api_key=###&page=3

Etc...

Tell me if I'm doing some stupid mistake: at the moment the last id is 364182. So in order to retrieve all the movies I should do 364182 calls to the API, with the limit of 40 calls every 10 seconds so the time nedeed for retrieve all the movies is more than 25hours... That woud not bother me (I understand the motivations that bring to a limit in the number of calls) but the fact that many of those calls will return me a 404 error, but still will be counted against the limit is a little annoyng :) There is no way to prevent these useless calls?

P.S. English is not my first language, so please understand that if something I wrote above sounds like a critic, that was not my intention :) Thanks again for your work and support!

Would be great if there is another solution. Would love to get a list of all supported tv shows.

Hey, I wanted to do the same thing but I did it a little differently.

Using the /discover/movie endpoint and searching by year, I requested for all years from 1930-2016 and the corresponding pages. This way I got 230,294 movies. I am not sure if there is a limit to the results of /discover/movie, or maybe some movies don't have year? Currently the latest id for a movie is 402985...I ran my script in 4 child processes (only 4 in order to not exceed the request limit) and requesting and storing them in db took ~8h. The downside is that /discover/movie/ does not give you the full movie info. So after I got all the movie ids I requested /movie/:id for all of the movies. That took ~12h.

So using this method I made a total of: ((2016 - 1930) * totalPages) requests which is ~21,500. (Movies from 1940 have ~15pages and from 2015 ~600 pages) And for the second script I made another 230,294 requests to get the movie info. So the total is ~251,794 requests :) The good side of this approach is that you get the info separately. First you get the ids and then the movie info. If you are requesting and inserting in your db at the same time you can easily start over from an index if the script stops for whatever reason. So if in fact the total movies from tmdb are 230,294 this is the better approach.

Requesting all the ids from 1 to the latest id would be slower, but you are certain that you will get all the movies.

So I wanted to ask you did you do this? And how many movies were you able to get?

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول