The Movie Database 지원

How do i get composer of the movie?

9 댓글 (1 / 1)

Jump to last post

Hi baskar,

You'll be able to find the "Original Music Composer" under the crew section found in the credits method.

Hi Travis,

This subject interests me, but your 11 years ago answer is left (page has been deprecated). Please, could you give me another on the new documentation location? Thank you in advance.

You can find movie credits method here. Or you can just query movie details with append_to_response=credits parameter (see here).

Thanks alot, talestalker.

Hi.

Sorry, but I still don't find how to get details of a movie... Is it possible to give me the complete URL for having the director o f the movie, the Original Music Composer, please? What do I have to add in the URL to have what I would like, please, like in the exemple "videos"? https://api.themoviedb.org/3/movie/27205?append_to_response=videos&language=en-US

Thanks, talestalker, but it's not all I need for what I would like to have... What do I have to put in the URL to have in a shield with ID "Composer" for exemple the Original Music Composer of the movie, please?

I have found we can make a request in credits, crew, job and then director, Original Music Composer... But I don't know how to use it...

Until now, I have a HTML page wich aloud me to have few details of a movie, but not all I would like... Here is it:

<html>
<head lang="fr">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Test moteur de recherche TMDB</title>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
</head>
 <body>

    <div class="box">
        <input type="text" id="query" /><button id="searchBtn1">Recherche</button><br/><br/>
        <img src="" class="poster" id="poster"/>
        <hr>
        Titre : <p id="movie_name"></p>
        <br/>
        Titre original : <p id="original_title"></p>
        <br/>
        Date de sortie : <p id="release_date"></p>
        <br/>
        Synopsis : <p id="movie_desc"></p>
        <br/>
        ID :<br/>
        <p id="id_film"></p>
        <br/>
    </div>

    <script type="text/javascript" charset="utf-8">
        $('#searchBtn1').click(function(){
            var api_key = 'MYAPIKEY';
            let query=$('#query').val();
        $.getJSON("https://api.themoviedb.org/3/search/movie?api_key="+api_key+"&language=fr-FR&query="+query+"&page=1&include_adult=false",function(data){
        console.log(data.results[0])
        $('#poster').attr("src","https://media.themoviedb.org/t/p/w600_and_h900_bestv2/"+data.results[0].poster_path)
        $('#movie_name').html(data.results[0].title)
        $('#original_title').html(data.results[0].original_title)
        $('#release_date').html(data.results[0].release_date)
        $('#movie_desc').html(data.results[0].overview)
        $('#id_film').html(data.results[0].id)
        })
        })
    </script>

    <style>
        .poster{width: 188px;}
    </style>
 </body>
</html>

I have found this other code, but I don't know what to change in it to have the Director and the Original Music Composer:

// Function to get movie detail object taking movie id as a parameter
function getMovieDetail(id) {
  return fetch('https://api.themoviedb.org/3/movie/' + id + '?language=fr-FR', options)
    .then((response) => response.json())
    .then((data) => {
      return data;
    })
    .catch(err => console.error(err));
}

// Function to open the modal and populate it with movie details
function openMovieModal(movie) {
  const modalTitle = document.getElementById("movieModalLabel");
  const modalPoster = document.getElementById("modalPoster");
  const modalReleaseDate = document.getElementById("modalReleaseDate");
  const modalRuntime = document.getElementById("modalRuntime");
  const modalOverview = document.getElementById("modalOverview");
  const modalVoteAverage = document.getElementById("modalVoteAverage");

  // Populate modal
  modalTitle.textContent = `${movie.title} (${new Date(movie.release_date).getFullYear()})`;
  modalPoster.src = `${baseImageUrl}${movie.poster_path}`;
  modalReleaseDate.textContent = movie.release_date;
  modalRuntime.textContent = `${Math.floor(movie.runtime / 60)}h ${movie.runtime % 60}min`;
  modalOverview.textContent = movie.overview;
  modalVoteAverage.textContent = movie.vote_average;

  // Open the modal
  const movieModal = new bootstrap.Modal(document.getElementById("movieModal"));
  movieModal.show();
}

Thanks, talestalker, but it's not all I need for what I would like to have... What do I have to put in the URL to have in a shield with ID "Composer" for exemple the Original Music Composer of the movie, please?

All TMDB API can do for you is provide a JSON that contains the data you want. In your case, this request (assuming you change the ### to your API key):

https://api.themoviedb.org/3/movie/27205?append_to_response=videos,credits&language=en-US&api_key=###

returns a 217 kB JSON that contains, among other things, the following (shortened and formatted for clarity):

{
  "adult": false,
  "backdrop_path": "/8ZTVqvKDQ8emSGUEMjsS4yHAwrp.jpg",
  "belongs_to_collection": null,
...
  "id": 27205,  
...
  "original_language": "en",
  "original_title": "Inception",
  "overview": "Cobb, a skilled thief who commits corporate espionage by infiltrating the subconscious of his targets is offered a chance to regain his old life as payment for a task considered to be impossible: \"inception\", the implantation of another person's idea into a target's subconscious.",
...
  "credits": {
    "cast": [
...
    ],
    "crew": [
...
      {
        "adult": false,
        "gender": 2,
        "id": 947,
        "known_for_department": "Sound",
        "name": "Hans Zimmer",
        "original_name": "Hans Zimmer",
        "popularity": 1.5703,
        "profile_path": "/tpQnDeHY15szIXvpnhlprufz4d.jpg",
        "credit_id": "56e8462cc3a368408400354c",
        "department": "Sound",
        "job": "Original Music Composer"
      },
...
      {
        "adult": false,
        "gender": 2,
        "id": 525,
        "known_for_department": "Directing",
        "name": "Christopher Nolan",
        "original_name": "Christopher Nolan",
        "popularity": 2.5244,
        "profile_path": "/xuAIuYSmsUzKlUMBFGVZaWsY3DZ.jpg",
        "credit_id": "5e83ac2ee33f830018359a00",
        "department": "Directing",
        "job": "Director"
      },
...
    ]
  }
}

TMDB support ends with the delivery of the above JSON and how you handle it is entirely up to your code. For example, if you are writing a javascript code, you will need to make a URL request and import the JSON into a javascript object (that's what the getMovieDetail(id) function does in your second example) and then find all the necessary information like director and original movie composer yourself. But for help with javascript please look somewhere else, such as Stack Overflow.

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

전체

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

미디어 페이지

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

TV 시즌 페이지

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

TV 에피소드 페이지

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

모든 이미지 페이지

a 이미지 추가 창 열기

모든 편집 페이지

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

토론 페이지

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

설정

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

로그인