The Movie Database 지원

Hi so i am working with angular (javascript) and i was able to retrieve the data of a specific movie and now i want to access the genre but i am not sure how to approach the data. so for example if i want to access the title of the movie i would do something like this: results.original_title but with genres its in an array [id, name] and i was not able to retrieve the name of a genre like so results.genre.name so how to i access this node?

9 댓글 (1 / 1)

Jump to last post

Hi GY22,

It sounds like these results are coming from either search/discover/a featured list. You'll want to pull down /genre/movie/list and then use it as a reference. You only need to call that once and you can cache it to always have the id/name map.

Cheers.

Sorry for hijacking this topic but I have a little problem. I use /genre/movie/list to get the genres. I get a list with all the ID's, but every name = null. Anyone knows what the problem is?

Hi gekkejongen,

I don't seem to be seeing this. What's the exact request you're making?

{
  "genres": [
    {
      "id": 28,
      "name": "Action"
    },
    {
      "id": 12,
      "name": "Adventure"
    },
    {
      "id": 16,
      "name": "Animation"
    },
    {
      "id": 35,
      "name": "Comedy"
    },
    {
      "id": 80,
      "name": "Crime"
    },
    {
      "id": 99,
      "name": "Documentary"
    },
    {
      "id": 18,
      "name": "Drama"
    },
    {
      "id": 10751,
      "name": "Family"
    },
    {
      "id": 14,
      "name": "Fantasy"
    },
    {
      "id": 10769,
      "name": "Foreign"
    },
    {
      "id": 36,
      "name": "History"
    },
    {
      "id": 27,
      "name": "Horror"
    },
    {
      "id": 10402,
      "name": "Music"
    },
    {
      "id": 9648,
      "name": "Mystery"
    },
    {
      "id": 10749,
      "name": "Romance"
    },
    {
      "id": 878,
      "name": "Science Fiction"
    },
    {
      "id": 10770,
      "name": "TV Movie"
    },
    {
      "id": 53,
      "name": "Thriller"
    },
    {
      "id": 10752,
      "name": "War"
    },
    {
      "id": 37,
      "name": "Western"
    }
  ]
}

hi, i request to genre/movie/list with parameters api_key & language.

This is what i get as response:

{"genres":[{"id":28,"name":null},{"id":12,"name":null},{"id":16,"name":null},{"id":35,"name":null},{"id":80,"name":null},{"id":99,"name":null},{"id":18,"name":null},{"id":10751,"name":null},{"id":14,"name":null},{"id":10769,"name":null},{"id":36,"name":null},{"id":27,"name":null},{"id":10402,"name":null},{"id":9648,"name":null},{"id":10749,"name":null},{"id":878,"name":null},{"id":10770,"name":null},{"id":53,"name":null},{"id":10752,"name":null},{"id":37,"name":null}]}

What language are you requesting?

en-US

Hi gekkejongen,

That is not a valid language on TMDb. Try using just 'en'.

https://api.themoviedb.org/3/genre/movie/list?api_key=###&language=en

Cheers.

Hi I have the following problem:

  • Using /3/genre/list?api_key=### it works OK
  • Using /3/genre/list?api_key=###&language=en returns the ids but all the names null.
  • Using /3/genre/list?api_key=###&language=es returns the ids but all the names null.

I need the genres in Spanish (es)!

Yes, there was a bug that slipped through in yesterday's deploy. In about ~4 hours when the cached pages are purged from the cache, the names will display properly.

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

전체

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

미디어 페이지

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

TV 시즌 페이지

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

TV 에피소드 페이지

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

모든 이미지 페이지

a 이미지 추가 창 열기

모든 편집 페이지

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

토론 페이지

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

설정

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

로그인