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 одговора (на страни 1 од 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.

Не можеш да нађеш филм или серију? Пријави се да додаш.

Глобално

s фокусирај траку за претрагу
p отворите мени профила
esc затворити отворени прозор
? отвори прозор пречице на тастатури

На страницама медија

b вратити се назад (или родитељу кад је то применљиво)
e иди на страницу за уређивање

На страницама ТВ сезона

(стрелица надесно) пређите на следећу сезону
(лева стрелица) иди на претходну сезону

На страницама ТВ епизода

(стрелица надесно) пређите на следећу епизоду
(лева стрелица) иди на претходну епизоду

На свим страницама са сликама

a отвори прозор за додавање слике

На свим страницама за уређивање

t отвори селектор превода
ctrl+ s пошаљи образац

На страницама за дискусију

n отвори нову дискусију
w мења статус гледања
p мења јавно/приватно
c мења отвори/затвори
a отвори активност
r одговор на дискусију
l иди на последњи одговор
ctrl+ enter пошаљи поруку
(стрелица надесно) следећа страница
(лева стрелица) претходна страница

Подешавања

Желите ли да оцените или додате ову ставку у листу?

Пријави се