Поддръжка на The Movie Database

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 изпращане на вашето съобщение
(стрелка надясно) следваща страница
(стрелка наляво) предишна страница

Настройки

Искате ли да го оцените или добавите към списък?

Вход