본문 바로가기

프로그래밍/영화 TMDB API

영화 정보 앱 만들기 - TMDB API 사용법, Guest Sessions

TMDB API 활용 예제 앱입니다.

https://play.google.com/store/apps/details?id=com.enigmah2k.movieinfo

 

영화정보 - Google Play 앱

영화 또는 TV 시리즈 정보를 검색할 수 있습니다. TMDB API를 사용하여 만들었습니다. 한국에 소개되지 않은 컨텐츠를 찾을 수 있습니다.

play.google.com

 

TMDB API - Guest Sessions

게스트 세션에 의해 평가된 정보를 가져옵니다.

하지만 결과가 거의 없기 때문에 실용성은 없어 보입니다.

 

값을 가져오기 위해서는 {guest_session_id} 값이 필요합니다.

{guest_session_id} 값을 얻기 위해서는 Authentication 의 Create Guest Session 로 가져와야 합니다.

 

아래 링크가 Guest Sessions관련 API 상세입니다.

https://developers.themoviedb.org/3/guest-sessions/get-guest-session-rated-movies

 

각 API에 대해 알아보겠습니다.

 

=============================================

< API 설명 >

1. Get Rated Movies

게스트 세션에 의해 평가된 영화 정보를 가져옵니다.

먼저 {guest_session_id} 가 생성되어 있어야 합니다.

 

아래와 같이 호출하면 상세정보를 얻을 수 있습니다.

https://api.themoviedb.org/3/guest_session/{guest_session_id}/rated/movies?api_key=<<api_key>>

{"page":1,"results":[],"total_pages":0,"total_results":0}

 

게스트 세션으로 평가한 정보가 없기 때문에 결과가 위와 같이 나옵니다.

사용성은 별로 없어보입니다.

 

아래는 응답 결과 입니다.

{
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": "/fCayJrkfRaCRCTh8GqN30f8oyQF.jpg",
      "genre_ids": [
        18
      ],
      "id": 550,
      "original_language": "en",
      "original_title": "Fight Club",
      "overview": "A ticking-time-bomb insomniac and a slippery soap salesman channel primal male aggression into a shocking new form of therapy. Their concept catches on, with underground \"fight clubs\" forming in every town, until an eccentric gets in the way and ignites an out-of-control spiral toward oblivion.",
      "release_date": "1999-10-12",
      "poster_path": null,
      "popularity": 0.5,
      "title": "Fight Club",
      "video": false,
      "vote_average": 7.8,
      "vote_count": 3439,
      "rating": 4.5
    }
  ],
  "total_pages": 1,
  "total_results": 1
}

 

2. Get Rated TV Shows

게스트 세션에 의해 평가된 TV 정보를 가져옵니다.

먼저 {guest_session_id} 가 생성되어 있어야 합니다.

 

아래와 같이 호출하면 상세정보를 얻을 수 있습니다.

https://api.themoviedb.org/3/guest_session/{guest_session_id}/rated/tv?api_key=<<api_key>>

{"page":1,"results":[],"total_pages":0,"total_results":0}

게스트 세션으로 평가한 정보가 없기 때문에 결과가 위와 같이 나옵니다.

사용성은 별로 없어보입니다.

 

아래는 응답 결과 입니다.

{
  "page": 1,
  "results": [
    {
      "backdrop_path": "/aKz3lXU71wqdslC1IYRC3yHD6yw.jpg",
      "first_air_date": "2011-04-17",
      "genre_ids": [
        10765,
        18
      ],
      "id": 1399,
      "original_language": null,
      "original_name": "Game of Thrones",
      "overview": "Seven noble families fight for control of the mythical land of Westeros. Friction between the houses leads to full-scale war. All while a very ancient evil awakens in the farthest north. Amidst the war, a neglected military order of misfits, the Night's Watch, is all that stands between the realms of men and icy horrors beyond.\n\n",
      "origin_country": [
        "US"
      ],
      "poster_path": "/jIhL6mlT7AblhbHJgEoiBIOUVl1.jpg",
      "popularity": 35.072708,
      "name": "Game of Thrones",
      "vote_average": 9.1,
      "vote_count": 274,
      "rating": 9.5
    }
  ],
  "total_pages": 1,
  "total_results": 1
}

 

3. Get Rated TV Episodes

게스트 세션에 의해 평가된 TV 에피소드 정보를 가져옵니다.

먼저 {guest_session_id} 가 생성되어 있어야 합니다.

 

아래와 같이 호출하면 상세정보를 얻을 수 있습니다.

https://api.themoviedb.org/3/guest_session/{guest_session_id}/rated/tv/episodes?api_key=<<api_key>>

{"page":1,"results":[],"total_pages":0,"total_results":0}

 

게스트 세션으로 평가한 정보가 없기 때문에 결과가 위와 같이 나옵니다.

사용성은 별로 없어보입니다.

 

아래는 응답 결과 입니다.

{
  "page": 1,
  "results": [
    {
      "air_date": "2013-10-15",
      "episode_number": 5,
      "id": 64782,
      "name": "The Workplace Proximity",
      "overview": "Amy starts working at Caltech which causes friction with Sheldon. Howard agrees with Sheldon who mentions this to Bernadette causing a big fight for the Wolowitzes.",
      "production_code": null,
      "season_number": 7,
      "show_id": 1418,
      "still_path": null,
      "vote_average": 8.5,
      "vote_count": 3,
      "rating": 8
    },
...

 

 

반응형