Assistance de TMDB

Hi, I am using the Find By ID (https://developer.themoviedb.org/reference/find-by-id) method to get some details about movies or TV shows but it keeps returning empty results. Here is an example JavaScript call, written inside of the playground component of the documentation page. The movie is 'Elemental':

const options = {
  method: 'GET',
  headers: {
    accept: 'application/json',
    Authorization: <my auth key>
  }
};

fetch('https://api.themoviedb.org/3/find/976573?external_source=imdb_id', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));

The result I am getting:

{
  "movie_results": [],
  "person_results": [],
  "tv_results": [],
  "tv_episode_results": [],
  "tv_season_results": []
}

8 réponses (sur la page 1 sur 1)

Jump to last post

For IMDb ID searches, you need to prefix them with tt.

Also, is it the latest Pixar movie Elemental you're talking about? If so, the IMDB ID is 15789038, not 976573.

https://api.themoviedb.org/3/find/tt15789038?external_source=imdb_id&api_key=###

Okay with your url I managed to retrieve Elemental data. But I am confused now by the id. I am getting this object back:

{
    "adult": false,
    "backdrop_path": "###",
    "id": 976573,
    "title": "Elemental",
    "original_language": "en",
    "original_title": "Elemental",
    "overview": "In a city where fire, water, land and air residents live together, a fiery young woman and a go-with-the-flow guy will discover something elemental: how much they have in common.",
    "poster_path": "###",
    "media_type": "movie",
    "genre_ids": [
        16,
        35,
        10751,
        14,
        10749
    ],
    "popularity": ###
    "release_date": "2023-06-14",
    "video": false,
    "vote_average": ##,
    "vote_count": ##
}

As you can see, the id property holds a different value form the one in your URL.

That’s the TMDB ID, which is completely separate from IMDB.

If you already have the TMDB ID, make a call directly to the asset:

https://api.themoviedb.org/3/movie/976573

@travisbell said:

That’s the TMDB ID, which is completely separate from IMDB.

If you already have the TMDB ID, make a call directly to the asset:

https://api.themoviedb.org/3/movie/976573

what if I want don't want a movie specifically ? I want to return either a movie or a tv show? does it still work with the prefix /movie/ before the url?

Hi @javpot, here is the API reference. As you can see on the left, there are separate calls for movie and tv. So a request for a tv series would be:

https://api.themoviedb.org/3/tv/{tv_series_id}

TMDB id numbers are not unique between movies and tv, the same number can be used for a movie and a tv series.

@travisbell said:

That’s the TMDB ID, which is completely separate from IMDB.

If you already have the TMDB ID, make a call directly to the asset:

https://api.themoviedb.org/3/movie/976573

thanks for your answer is there a way to have access to the trailer of the movie or tv show? I don't see the url of the trailer inside the json

Trailers for movies and tv can be accessed using the "videos" endpoint.

https://developer.themoviedb.org/reference/movie-videos

https://developer.themoviedb.org/reference/tv-series-videos

The youtube key returned can be accessed as https://www.youtube.com/watch?v={key}

@robbie3999 said:

Trailers for movies and tv can be accessed using the "videos" endpoint.

https://developer.themoviedb.org/reference/movie-videos

https://developer.themoviedb.org/reference/tv-series-videos

The youtube key returned can be accessed as https://www.youtube.com/watch?v={key}

alright thank you

Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.

Général

s Mettre le curseur dans la barre de recherche
p Ouvrir le menu du profil
esc Fermer une fenêtre ouverte
? Ouvrir la fenêtre des raccourcis clavier

Sur les pages des médias

b Retour (ou vers le parent si faisable)
e Afficher la page de modification

Sur les pages des saisons des émissions télévisées

Afficher la saison suivante (flèche droite)
Afficher la saison précédente (flèche gauche)

Sur les pages des épisodes des émissions télévisées

Afficher l'épisode suivant (flèche droite)
Afficher l'épisode précédent (flèche gauche)

Sur toutes les pages des images / photos

a Ouvrir la fenêtre d'ajout d'image / photo

Sur toutes les pages de modifications

t Ouvrir le sélecteur de traduction
ctrl+ s Envoyer le formulaire

Sur les pages des discussions

n Créer une nouvelle discussion
w Basculer le statut de suivi
p Basculer publique / privée
c Basculer fermer / ouvrir
a Ouvrir l'activité
r Répondre à la discussion
l Afficher la dernière réponse
ctrl+ enter Envoyer votre message
Page suivante (flèche droite)
Page précédente (flèche gauche)

Paramètres

Vous souhaitez évaluer ou ajouter cet élément à une liste ?

Connexion