Suport de The Movie Database

I have the imdb Ids (tconst, as they call it); what I need to know is how to get the tmdb movie Id value from that imdb movie Id value (with a REST call).

6 resposta (a les pàgines 1 de 1)

Jump to last post

Hi @bclayshannon,

Yes, you can use the /find method.

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

As an example.

Hi, for movies it works ... but not for shows

TV works just fine:

Request

curl -v "https://api.themoviedb.org/3/find/tt3581920?api_key=###&external_source=imdb_id"

*   Trying 2600:9000:20be:1800:c:174a:c400:93a1:443...
* Connected to api.themoviedb.org (2600:9000:20be:1800:c:174a:c400:93a1) port 443 (#0)
* ALPN: offers h2
* ALPN: offers http/1.1
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES128-GCM-SHA256
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=*.themoviedb.org
*  start date: Sep 20 00:00:00 2022 GMT
*  expire date: Oct 18 23:59:59 2023 GMT
*  subjectAltName: host "api.themoviedb.org" matched cert's "*.themoviedb.org"
*  issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
*  SSL certificate verify ok.
* Using HTTP2, server supports multiplexing
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* h2h3 [:method: GET]
* h2h3 [:path: /3/find/tt3581920?api_key=###&external_source=imdb_id]
* h2h3 [:scheme: https]
* h2h3 [:authority: api.themoviedb.org]
* h2h3 [user-agent: curl/7.85.0]
* h2h3 [accept: */*]
* Using Stream ID: 1 (easy handle 0x7fc10e011a00)
> GET /3/find/tt3581920?api_key=###&external_source=imdb_id HTTP/2
> Host: api.themoviedb.org
> user-agent: curl/7.85.0
> accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
< HTTP/2 200
< content-type: application/json;charset=utf-8
< content-length: 808
< date: Sun, 19 Feb 2023 20:08:16 GMT
< server: openresty
< cache-control: public, max-age=28800
< x-memc: HIT
< x-memc-key: 13bcbc85ce0120202947ea87d5749ffb737d32f9
< x-memc-age: 12585
< x-memc-expires: 9015
< etag: W/"bf5bf1295d2c0dea853d14c05641f6cb"
< vary: Accept-Encoding,Accept-Encoding,Accept-Encoding
< x-cache: Miss from cloudfront
< via: 1.1 a06140ffee86972bad90c57fc682df36.cloudfront.net (CloudFront)
< x-amz-cf-pop: SEA19-C3
< alt-svc: h3=":443"; ma=86400
< x-amz-cf-id: xlS3qgMUukDKwhyE9VIZv6CszYDPBmIrb06vtReSYzz6bjsLR5p6Pg==
< vary: Origin
<
* Connection #0 to host api.themoviedb.org left intact

Response

{
  "movie_results": [],
  "person_results": [],
  "tv_results": [
    {
      "adult": false,
      "backdrop_path": "/uDgy6hyPd82kOHh6I95FLtLnj6p.jpg",
      "id": 100088,
      "name": "The Last of Us",
      "original_language": "en",
      "original_name": "The Last of Us",
      "overview": "Twenty years after modern civilization has been destroyed, Joel, a hardened survivor, is hired to smuggle Ellie, a 14-year-old girl, out of an oppressive quarantine zone. What starts as a small job soon becomes a brutal, heartbreaking journey, as they both must traverse the United States and depend on each other for survival.",
      "poster_path": "/uKvVjHNqB5VmOrdxqAt2F7J78ED.jpg",
      "media_type": "tv",
      "genre_ids": [
        18,
        10759
      ],
      "popularity": 5706.38,
      "first_air_date": "2023-01-15",
      "vote_average": 8.807,
      "vote_count": 1803,
      "origin_country": [
        "US"
      ]
    }
  ],
  "tv_episode_results": [],
  "tv_season_results": []
}

This works if pasted into the browser url window, but not with curl.

It works for me with curl, using the command Travis provided above. Be sure to wrap the URL with quotation marks. If it doesn't work, provide an example curl command that doesn't work, removing your API key.

Hi,

Thanks for responding. I found my mistake after going through half a dozen permutations of the command line. I counted as URL from http to the question mark and quoted that and nonthing else. The entire line has to be quoted because the entire line, api key and external source option are part of the URL. Quoting the entire thing succeeded.

Thanks again, JIm J.

No trobeu una pel·lícula o una sèrie? Inicieu la sessió per a crear-la.

Global

s centra la barra de cerca
p obre el menú del perfil
esc tanca una finestra oberta
? obre la finestra de dreceres de teclat

A les pàgines de materials

b torna enrere (o la superior quan sigui aplicable)
e ves a la pàgina d’edició

A les pàgines de temporades

(fletxa dreta) ves a la temporada següent
(fletxa esquerra) ves a la temporada anterior

A les pàgines d'episodis

(fletxa dreta) ves a l'episodi següent
(fletxa esquerra) ves a l'episodi anterior

A totes les pàgines d'imatges

a obre la finestra d'afegir imatges

A totes les pàgines d'edició

t obre el selector de traducció
ctrl+ s envia el formulari

A les pàgines de debat

n crea un debat nou
w canvia l'estat de visualització
p canvia públic/privat
c tanca o obre
a obre activitat
r resposta al debat
l ves a la darrera resposta
ctrl+ enter envieu el vostre missatge
(fletxa dreta) pàgina següent
(fletxa esquerra) pàgina anterior

Configuracions

Desitgeu valorar o afegir aquest element a una llista?

Inicieu la sessió