The Movie Database Support

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 replies (on page 1 of 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
}

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login