پشتیبانی پایگاه داده‌ فیلم

I'd like to look at stats for profitable movies, i.e., where budget > 0 && revenue > budget. I think I would need to call the paginated /discover endpoint to find a list of movie IDs, and then make individual calls to /movie to get the details of each movie. That seems like it will be a lot of API calls. Also, I notice that page numbers cannot exceed 500 for /discover so I can't get all the movies I want, even if I use filters to get the movie list size down, e.g., by release date and language.

Is there a better way to do this that doesn't require making so many API calls? e.g., is there a way to get the revenue and budget information included in the /discover results so I don't have to make /movie calls? Or is there a way to filter /discover on attributes like budget and revenue so that I don't make API calls for movies that don't have this information defined?

And related, if a /discover result says there are 1,000 pages, then is it just not possible to get the data for all the movies because of the 500 page number limit?

2 پاسخ (در صفحه 1 از 1)

Jump to last post

@marred said:

I'd like to look at stats for profitable movies, i.e., where budget > 0 && revenue > budget. I think I would need to call the paginated /discover endpoint to find a list of movie IDs, and then make individual calls to /movie to get the details of each movie. That seems like it will be a lot of API calls. Also, I notice that page numbers cannot exceed 500 for /discover so I can't get all the movies I want, even if I use filters to get the movie list size down, e.g., by release date and language.

Is there a better way to do this that doesn't require making so many API calls? e.g., is there a way to get the revenue and budget information included in the /discover results so I don't have to make /movie calls? Or is there a way to filter /discover on attributes like budget and revenue so that I don't make API calls for movies that don't have this information defined?

The only Discover filter that might help you is "&sort_by=revenue.desc".
There is no other filter for Revenue and none for Budget.

And related, if a /discover result says there are 1,000 pages, then is it just not possible to get the data for all the movies because of the 500 page number limit?

The total tells you how many pages there are.
In the test I did now it reported

  "total_pages": 41113,
  "total_results": 822249

I think 822,249 is the total number of films in the Database right now.
You can use date filters to access them all by making several API Requests per year or period.
&primary_release_year=
or
&primary_release_date.gte and &primary_release_date.lte
But each Request only allows access to 500 pages and/or 10,000 items.

@ticao2 said: The only Discover filter that might help you is "&sort_by=revenue.desc".

Oh, that's great, thanks! I can construct my query to essentially return the first N highest earning movies. That would work for what I want to do.

You can use date filters to access them all by making several API Requests per year or period.
&primary_release_year=
or
&primary_release_date.gte and &primary_release_date.lte
But each Request only allows access to 500 pages and/or 10,000 items.

Got it. That makes sense, thanks for the suggestion. That helps a lot.

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود