دعم الموقع

I'm trying to get the quantity of total pages a query in https://api.themoviedb.org/3/search/movie has. I would use this value for pagination. Instead, I only get the 20 results with information for the 20 first movies, but I can't see no total_pages information in the retrieved data. I've seen people talking about this value in these forums through a research I've made. So my question is: is total_pages still available?

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

Jump to last post

I found what I was doing wrong. Instead of retrieving response.data I was retrieving response.data.results.

Hi @vitorary90,

It's there point_down_tone2

Request

curl -v "http://api.themoviedb.org/3/search/movie?api_key=###&query=star+wars"

*   Trying [2600:9000:201e:1000:c:174a:c400:93a1]:80...
* Connected to api.themoviedb.org (2600:9000:201e:1000:c:174a:c400:93a1) port 80 (#0)
> GET /3/search/movie?api_key=###&query=star+wars HTTP/1.1
> Host: api.themoviedb.org
> User-Agent: curl/8.1.2
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json;charset=utf-8
< Content-Length: 12877
< Connection: keep-alive
< Date: Wed, 29 Nov 2023 17:00:17 GMT
< Server: openresty
< X-Memc: HIT
< X-Memc-Key: 6e73ab37df6c33cdea7c53426075afd8
< X-Memc-Age: 16536
< X-Memc-Expires: 7109
< ETag: W/"fb95317bb1dd498d6ae360256d0ece71"
< Vary: Accept-Encoding
< X-Cache: Miss from cloudfront
< Via: 1.1 98e30e5953336545df428a8f5923a288.cloudfront.net (CloudFront)
< X-Amz-Cf-Pop: IAD89-C3
< Alt-Svc: h3=":443"; ma=86400
< X-Amz-Cf-Id: jHpcM6qnqqNifjJieHa59DiCOL49qvXdVQdOFZDHe7ME3ZiDmXyRBA==
< Vary: Origin
<
* Connection #0 to host api.themoviedb.org left intact

Response

{
    "page": 1,
    "results": [
        {
            "adult": false,
            "backdrop_path": "/4qCqAdHcNKeAHcK8tJ8wNJZa9cx.jpg",
            "genre_ids": [
                12,
                28,
                878
            ],
            "id": 11,
            "original_language": "en",
            "original_title": "Star Wars",
            "overview": "Princess Leia is captured and held hostage by the evil Imperial forces in their effort to take over the galactic Empire. Venturesome Luke Skywalker and dashing captain Han Solo team together with the loveable robot duo R2-D2 and C-3PO to rescue the beautiful princess and restore peace and justice in the Empire.",
            "popularity": 80.819,
            "poster_path": "/6FfCtAuVAW8XJjZ7eWeLibRLWTw.jpg",
            "release_date": "1977-05-25",
            "title": "Star Wars",
            "video": false,
            "vote_average": 8.2,
            "vote_count": 19347
        },
        ...
    ],
    "total_pages": 9,
    "total_results": 177
}

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

عام

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

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

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

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

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

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

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

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

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

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

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

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

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

الاعدادات

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

تسجيل الدخول