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 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区