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
}

찾으시는 영화나 TV 프로그램이 없나요? 로그인 하셔서 직접 만들어주세요.

전체

s 검색 바 띄우기
p 프로필 메뉴 열기
esc 열린 창 닫기
? 키보드 단축키 창 열기

미디어 페이지

b 돌아가기
e 편집 페이지로 이동

TV 시즌 페이지

(우 화살표) 다음 시즌으로 가기
(좌 화살표) 이전 시즌으로 가기

TV 에피소드 페이지

(우 화살표) 다음 에피소드로 가기
(좌 화살표) 이전 에피소드로 가기

모든 이미지 페이지

a 이미지 추가 창 열기

모든 편집 페이지

t 번역 선택 열기
ctrl+ s 항목 저장

토론 페이지

n 새 토론 만들기
w 보기 상태
p 공개/비공개 전환
c 열기/닫기 전환
a 활동 열기
r 댓글에 글쓰기
l 마지막 댓글로 가기
ctrl+ enter 회원님의 메세지 제출
(우 화살표) 다음 페이지
(좌 화살표) 이전 페이지

설정

이 항목을 평가하거나 목록에 추가할까요?

로그인