دعم الموقع

Last night I tagged some movies with a keyword, but only a few of them are showing up through my API call although all of them are displaying when I look at that keyword inside themoviedb. What's the process for making this new content available via the API? is it a matter of waiting for something to run on your end? Or is there something else that needs to happen. I appreciate the help.

I'm getting 20 out of the 631. Possibly it defaults to providing the top 20 most popular? These seem to be the most popular. How can I retrieve all of them? Thanks.

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

Jump to last post

Hi olearysreellife,

There's 2 things worth pointing out:

  1. There's a ~6 hour cache on the API so any changes you make on the website can take up to 6 hours to propagate to the API.
  2. I'm not sure what method you're calling but I would use /discover/movie and then you can have control over the sorting along with many other filters that might be useful. By default discover sort by popularity but as you can see in the docs, there are many options available to you.

Here's an example calling the 'alien' keyword, paging with the page parameter:

https://api.themoviedb.org/3/discover/movie?api_key=###&with_keywords=10270
https://api.themoviedb.org/3/discover/movie?api_key=###&with_keywords=10270&page=2
https://api.themoviedb.org/3/discover/movie?api_key=###&with_keywords=10270&page=3

Cheers.

That's informative. I'm working with themoviedb-javascript-library.

calling this method:

theMovieDb.discover.getMovies({"with_keywords": 205328, "sort_by" : "original_title.asc"}, successCB, errorCB)

In the console I see:

Object {page: 1, results: Array[20], total_pages: 32, total_results: 631}page: 1results: Array[20]total_pages: 32total_results: 631

so it seems to be only returning page 1.

I'm not sure how to indicate that I want ALL the pages returned. Is that something you could advise me on? Thanks for the help. Your response helped me focus on what to look for.. but I'm stumped about what steps to take next. Thanks.

Hi olearysreellife,

Unfortunately I can't tell you how the developer of the themoviedb-javascript-library handles pagination, you'll have to go digging in the source to find out. From an API standpoint, it's just an HTTP query parameter as illustrated in my example above.

You won't be able to get to "get all pages" in a single query, you'll have to iterate and loop through each page.

Thanks, Travis. Right. I'll iterate. And I figured out the pagination from the javascript library so I can proceed on this. Thanks. I'm sure I've got more questions on other aspects of this most excellent API, but this is giving me the boost I needed right now. Much appreciated...

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

عام

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

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

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

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

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

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

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

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

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

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

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

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

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

الاعدادات

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

تسجيل الدخول