본문 바로가기

프로그래밍/영화 TMDB API

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

TMDB API 활용 예제 앱입니다.

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

 

영화정보 - Google Play 앱

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

play.google.com

 

TMDB API - Discover

평균 평점, 투표 수, 장르 및 인증과 같은 다양한 유형의 데이터로 영화 또는 TV 정보를 찾을 수 있습니다.

필수 값은 API key 만 있습니다만 다양한 옵션이 있습니다. 

 

 

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

https://developers.themoviedb.org/3/discover/movie-discover

 

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

 

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

< API 설명 >

 

1. Movie Discover

평균 평점, 투표 수, 장르 및 인증과 같은 다양한 유형의 데이터로 영화정보를 가져옵니다.

 

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

https://api.themoviedb.org/3/discover/movie?api_key=<<api_key>>

{"page":1,"total_results":10000,"total_pages":500,"results":[{"popularity":1708.692,"vote_count":352,"video":false,"poster_path":"\/7D430eqZj8y3oVkLFfsWXGRcpEG.jpg","id":528085,"adult":false,"backdrop_path":"\/5UkzNSOK561c2QRy2Zr4AkADzLT.jpg","original_language":"en","original_title":"2067","genre_ids":[878,53,18],"title":"2067","vote_average":4.7,"overview":"A lowly utility worker is called to the future by a mysterious radio signal, he must leave his dying wife to embark on a journey that will force him to face his deepest fears in an attempt to change the fabric of reality and save humankind from its greatest environmental crisis yet.","release_date":"2020-10-01"},
...

추가로 적용할 옵션이 있으면 GET 방식으로 전달하면 됩니다.

 

아래는 응답 결과 입니다.

{
  "page": 1,
  "results": [
    {
      "poster_path": null,
      "adult": false,
      "overview": "Go behind the scenes during One Directions sell out \"Take Me Home\" tour and experience life on the road.",
      "release_date": "2013-08-30",
      "genre_ids": [
        99,
        10402
      ],
      "id": 164558,
      "original_title": "One Direction: This Is Us",
      "original_language": "en",
      "title": "One Direction: This Is Us",
      "backdrop_path": null,
      "popularity": 1.166982,
      "vote_count": 55,
      "video": false,
      "vote_average": 8.45
    },
...

 

2. TV Discover

평균 평점, 투표 수, 장르 및 인증과 같은 다양한 유형의 데이터로 TV 정보를 가져옵니다.

 

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

https://api.themoviedb.org/3/discover/tv?api_key=<<api_key>>

{"page":1,"total_results":10000,"total_pages":500,"results":[{"original_name":"The Mandalorian","genre_ids":[10765,10759,37],"name":"The Mandalorian","popularity":2016.438,"origin_country":["US"],"vote_count":2721,"first_air_date":"2019-11-12","backdrop_path":"\/9ijMGlJKqcslswWUzTEwScm82Gs.jpg","original_language":"en","id":82856,"vote_average":8.5,"overview":"After the fall of the Galactic Empire, lawlessness has spread throughout the galaxy. A lone gunfighter makes his way through the outer reaches, earning his keep as a bounty hunter.","poster_path":"\/sWgBv7LV2PRoQgkxwlibdGXKz1S.jpg"},
...

 

추가로 적용할 옵션이 있으면 GET 방식으로 전달하면 됩니다.

 

아래는 응답 결과 입니다.

{
  "page": 1,
  "results": [
    {
      "poster_path": "/dDfjzRicTeVaiysRTwx56aM8bC3.jpg",
      "popularity": 5.4,
      "id": 61889,
      "backdrop_path": null,
      "vote_average": 7.74,
      "overview": "Lawyer-by-day Matt Murdock uses his heightened senses from being blinded as a young boy to fight crime at night on the streets of Hell’s Kitchen as Daredevil.......",
      "first_air_date": "2015-04-10",
      "origin_country": [
        "US"
      ],
      "genre_ids": [
        28
      ],
      "original_language": "en",
      "vote_count": 19,
      "name": "Marvel's Daredevil",
      "original_name": "Marvel's Daredevil"
    }
  ],
  "total_results": 61470,
  "total_pages": 3074
}

 

 

 

 

반응형