IMDB 是否提供 API?

发布于 2024-08-16 07:36:47 字数 1539 浏览 13 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(18

握住我的手 2024-08-23 07:36:47

IMDb 有一个公共 API,虽然没有文档记录,但快速可靠(通过 AJAX 在官方网站上使用)。

搜索建议 API

// 1) Vanilla JavaScript (JSON-P)
function addScript(src) { var s = document.createElement('script'); s.src = src; document.head.appendChild(s); }
window.imdb$foo = function (results) {
  /* ... */
};
addScript('https://sg.media-imdb.com/suggests/f/foo.json');

// 2) Using jQuery (JSON-P)
jQuery.ajax({
    url: 'https://sg.media-imdb.com/suggests/f/foo.json',
    dataType: 'jsonp',
    cache: true,
    jsonp: false,
    jsonpCallback: 'imdb$foo'
}).then(function (results) {
    /* ... */
});

// 3) Pure JSON (with jQuery)
// Use a local proxy to the clean `/suggestion` API.
jQuery.getJSON('/api/imdb/?q=foo', function (results) {
    /* ... */
});

// 4) Pure JSON (plain JavaScript; Modern ES6, ES2017, and Fetch API)
// Serve a "/api" route in your app, that proxies (and caches!)
// to v2.sg.media-imdb.com/suggestion/h/hello.json
const resp = await fetch('/api/imdb/?q=foo');
const results = await resp.json();

高级搜索


请注意,这些 API 是非官方的,可能随时更改!


更新(2019 年 1 月):高级 API 不再存在。好消息是,建议 API 现在还支持按电影标题和演员姓名搜索的“高级”功能。

The IMDb has a public API that, although undocumented, is fast and reliable (used on the official website through AJAX).

Search Suggestions API

// 1) Vanilla JavaScript (JSON-P)
function addScript(src) { var s = document.createElement('script'); s.src = src; document.head.appendChild(s); }
window.imdb$foo = function (results) {
  /* ... */
};
addScript('https://sg.media-imdb.com/suggests/f/foo.json');

// 2) Using jQuery (JSON-P)
jQuery.ajax({
    url: 'https://sg.media-imdb.com/suggests/f/foo.json',
    dataType: 'jsonp',
    cache: true,
    jsonp: false,
    jsonpCallback: 'imdb$foo'
}).then(function (results) {
    /* ... */
});

// 3) Pure JSON (with jQuery)
// Use a local proxy to the clean `/suggestion` API.
jQuery.getJSON('/api/imdb/?q=foo', function (results) {
    /* ... */
});

// 4) Pure JSON (plain JavaScript; Modern ES6, ES2017, and Fetch API)
// Serve a "/api" route in your app, that proxies (and caches!)
// to v2.sg.media-imdb.com/suggestion/h/hello.json
const resp = await fetch('/api/imdb/?q=foo');
const results = await resp.json();

Advanced Search


Beware that these APIs are unofficial and could change at any time!


Update (January 2019): The Advanced API no longer exists. The good news is, that the Suggestions API now supports the "advanced" features of searching by film titles and actor names as well.

如歌彻婉言 2024-08-23 07:36:47

新的 api @ http://www.omdbapi.com

编辑:由于法律问题不得不将服务转移到新域名:)

new api @ http://www.omdbapi.com

edit: due to legal issues had to move the service to a new domain :)

不知所踪 2024-08-23 07:36:47

IMDB 本身似乎分发数据,但仅在文本文件中:

http://www.imdb.com/interfaces

有几个与此相关的 API,您可以通过 Google 搜索。明确禁止屏幕抓取。
官方 API 似乎正在开发中,但已经存在多年了。

IMDB themselves seem to distribute data, but only in text files:

http://www.imdb.com/interfaces

there are several APIs around this that you can Google. Screen scraping is explicitly forbidden.
A official API seems to be in the works, but has been that for years already.

北恋 2024-08-23 07:36:47

获取电影信息的另一个合法替代方法是 Rotten-Tomatoes API(由 Fandango 提供)。

Another legal alternative to get movie info is the Rotten-Tomatoes API (by Fandango).

一个人的旅程 2024-08-23 07:36:47

TMDb API 怎么样?

您可以使用 GET /find/{external_id} 按 imdb_id 进行搜索

https://developers.themoviedb.org/3/find/find-by-id

What about TMDb API ?

You can search by imdb_id with GET /find/{external_id}

https://developers.themoviedb.org/3/find/find-by-id

短叹 2024-08-23 07:36:47

是的,但不是免费的。

.....年费从 15,000 美元到更高不等,具体取决于数据的受众以及正在许可的数据。

网址:-
http://www.imdb.com/licensing/

Yes, but not for free.

.....annual fees ranging from $15,000 to higher depending on the audience for the data and which data are being licensed.

URL :-
http://www.imdb.com/licensing/

贱人配狗天长地久 2024-08-23 07:36:47

http://app.imdb.com 上有一个可供移动应用程序使用的 JSON API,

但是,警告相当严重:

仅供 IMDb 书面授权的客户使用。
未经授权的客户的作者和用户对其行为承担全部法律责任。

我认为这适用于那些支付许可证费用以通过 API 访问数据的开发人员。

编辑:只是为了好玩,我编写了一个客户端库来尝试从 API 读取数据,您可以在这里找到它:api-imdb

显然,你应该注意警告,实际上,使用类似 TheMovieDB 作为更好、更开放的数据库。

然后你可以使用这个Java API包装器(我写的):api-themoviedb

There is a JSON API for use by mobile applications at http://app.imdb.com

However, the warning is fairly severe:

For use only by clients authorized in writing by IMDb.
Authors and users of unauthorized clients accept full legal exposure/liability for their actions.

I presume this is for those developers that pay for the licence to access the data via their API.

EDIT: Just for kicks, I wrote a client library to attempt to read the data from the API, you can find it here: api-imdb

Obviously, you should pay attention to the warning, and really, use something like TheMovieDB as a better and more open database.

Then you can use this Java API wrapper (that I wrote): api-themoviedb

铃予 2024-08-23 07:36:47

找到了这个

IMDbPY 是一个 Python 包,可用于检索和管理以下数据:
IMDb 电影数据库,包含电影、人物、人物和
公司。

http://imdbpy.sourceforge.net/

Found this one

IMDbPY is a Python package useful to retrieve and manage the data of
the IMDb movie database about movies, people, characters and
companies.

http://imdbpy.sourceforge.net/

无法言说的痛 2024-08-23 07:36:47

https://deanclatworthy.com/tools.html 是一个 IMDB API,但由于滥用而已关闭。

https://deanclatworthy.com/tools.html is an IMDB API but has been down due to abuse.

抹茶夏天i‖ 2024-08-23 07:36:47

截至 2016 年 8 月,IMDB 似乎还没有直接的 API,但我看到很多人在写爬虫和上面的东西。 这里是使用票房访问电影数据的更标准方法嗡嗡声API。免费计划中的所有响应均采用 JSON 格式,每天 5000 次查询

API 提供的内容列表

  1. 电影制作人员
  2. 电影 ID
  3. 电影图像
  4. 通过 IMDB id 获取电影 获取
  5. 最新电影列表
  6. 获取新版本
  7. 获取电影发行日期
  8. 获取特定电影的可用翻译列表
  9. 获取电影的视频、预告片和预告片
  10. 按标题搜索电影
  11. 还支持电视节目、游戏和视频

IMDB doesn't seem to have a direct API as of August 2016 yet but I saw many people writing scrapers and stuff above. Here is a more standard way to access movie data using box office buzz API. All responses in JSON format and 5000 queries per day on a free plan

List of things provided by the API

  1. Movie Credits
  2. Movie ID
  3. Movie Images
  4. Get movie by IMDB id
  5. Get latest movies list
  6. Get new releases
  7. Get movie release dates
  8. Get the list of translations available for a specific movie
  9. Get videos, trailers, and teasers for a movie
  10. Search for a movie by title
  11. Also supports TV shows, games and videos
把时间冻结 2024-08-23 07:36:47

那个 deanclatworthy 似乎仍然有效
还有另一个:http://imdbapi.poromenos.org/

that deanclatworthy still seems to work
and there's another one: http://imdbapi.poromenos.org/

穿透光 2024-08-23 07:36:47

这里是一个简单的解决方案,它根据 Krinkle 的查询按名称获取节目:

您可以通过让服务器获取 URL 而不是尝试使用 AJAX 直接获取它来绕过同源策略,您不必使用 JSONP 来执行此操作。

Javascript (jQuery):

function getShowOptionsFromName (name) {
    $.ajax({
        url: "ajax.php",
        method: "GET",
        data: {q: name},
        dataType: "json"
    }).done(function(data){
        console.log(data);
    });
}

PHP(在文件 ajax.php 中):

$q = urlencode($_GET["q"]);
echo file_get_contents("http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=$q");

Here is a simple solution that fetches shows by name based on the query from Krinkle:

You can get around the same-origin policy by having your server fetch the URL instead of trying to fetch it directly with AJAX and you don't have to use JSONP to do it.

Javascript (jQuery):

function getShowOptionsFromName (name) {
    $.ajax({
        url: "ajax.php",
        method: "GET",
        data: {q: name},
        dataType: "json"
    }).done(function(data){
        console.log(data);
    });
}

PHP (in file ajax.php):

$q = urlencode($_GET["q"]);
echo file_get_contents("http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=$q");
清眉祭 2024-08-23 07:36:47

如果您想要电影详细信息API,那么您可以考虑

OMDB API,它是开放电影数据库。它
返回 IMDB 评级、IMDB 投票,还有烂番茄评级。

或者您可以使用

My Api Films,它允许您使用 IMDB ID 进行搜索,它会返回详细信息信息,但有请求限制。

If you want movie details API then you can consider

OMDB API which is Open movies Database. It
returns IMDB Ratings, IMDB Votes and it also has Rotten Tomato rating.

Or else You can use

My Api Films which allows you to search with IMDB ID, it returns detailed information but it has request limits.

香橙ぽ 2024-08-23 07:36:47

最近在 SXSWi 2012 上,在他们的“Mashery Lounge”中,有一个从 rovi 调用的类似 IMDB 的 API 展位。它不是免费的 API,但据我交谈过的销售人员称,他们根据您的预算提供收益分成或固定使用费。我还没用过,但看起来很酷。

Recently at SXSWi 2012, in their "Mashery Lounge", there was a booth for an IMDB-like API called from rovi. It's not a free API, but according to the sales guy I talked to they offer either a rev share or a flat fee for usage, depending on your budget. I haven't used it yet but it seems pretty cool.

隔岸观火 2024-08-23 07:36:47

NetFilx 更多的是个性化媒体服务,但您可以使用它来获取有关电影的公共信息。它支持 Javascript 和 OData。
另请参阅JMDb:信息与使用IMDb网站时获得的信息基本相同。

NetFilx is more of personalized media service but you can use it for public information regarding movies. It supports Javascript and OData.
Also look JMDb: The information is basically the same as you can get when using the IMDb website.

一桥轻雨一伞开 2024-08-23 07:36:47

好的,我找到了这个

C# 的 IMDB scraper:
http://web3o.blogspot.de/2010/11/aspnetc -imdb-scraping-api.html

PHP 在这里:
http://web3o.blogspot.de /2010/10/php-imdb-scraper-for-new-imdb-template.html

或者是 c# 的 imdbapi.org 实现:

using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Xml.Linq;
using HtmlAgilityPack; // http://htmlagilitypack.codeplex.com/


public class IMDBHelper
{

    public static imdbitem GetInfoByTitle(string Title)
    {
        string url = "http://imdbapi.org/?type=xml&limit=1&title=" + Title;
        HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
        req.Method = "GET";
        req.UserAgent = "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))";
        string source;
        using (StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream()))
        {
            source = reader.ReadToEnd();
        }
        HtmlDocument doc = new HtmlDocument();
        doc.LoadHtml(source);        
        XDocument xdoc = XDocument.Parse(doc.DocumentNode.InnerHtml, LoadOptions.None);
        imdbitem i = new imdbitem();
        i.rating = xdoc.Descendants("rating").Select(x => x.Value).FirstOrDefault();
        i.rating_count = xdoc.Descendants("rating_count").Select(x => x.Value).FirstOrDefault();
        i.year = xdoc.Descendants("year").Select(x => x.Value).FirstOrDefault();
        i.rated = xdoc.Descendants("rated").Select(x => x.Value).FirstOrDefault();
        i.title = xdoc.Descendants("title").Select(x => x.Value).FirstOrDefault();
        i.imdb_url = xdoc.Descendants("imdb_url").Select(x => x.Value).FirstOrDefault();
        i.plot_simple = xdoc.Descendants("plot_simple").Select(x => x.Value).FirstOrDefault();
        i.type = xdoc.Descendants("type").Select(x => x.Value).FirstOrDefault();
        i.poster = xdoc.Descendants("poster").Select(x => x.Value).FirstOrDefault();
        i.imdb_id = xdoc.Descendants("imdb_id").Select(x => x.Value).FirstOrDefault();
        i.also_known_as = xdoc.Descendants("also_known_as").Select(x => x.Value).FirstOrDefault();
        i.language = xdoc.Descendants("language").Select(x => x.Value).FirstOrDefault();
        i.country = xdoc.Descendants("country").Select(x => x.Value).FirstOrDefault();
        i.release_date = xdoc.Descendants("release_date").Select(x => x.Value).FirstOrDefault();
        i.filming_locations = xdoc.Descendants("filming_locations").Select(x => x.Value).FirstOrDefault();
        i.runtime = xdoc.Descendants("runtime").Select(x => x.Value).FirstOrDefault();
        i.directors = xdoc.Descendants("directors").Descendants("item").Select(x => x.Value).ToList();
        i.writers = xdoc.Descendants("writers").Descendants("item").Select(x => x.Value).ToList();
        i.actors = xdoc.Descendants("actors").Descendants("item").Select(x => x.Value).ToList();
        i.genres = xdoc.Descendants("genres").Descendants("item").Select(x => x.Value).ToList();
        return i;
    }

    public class imdbitem
    {
        public string rating { get; set; }
        public string rating_count { get; set; }
        public string year { get; set; }
        public string rated { get; set; }
        public string title { get; set; }
        public string imdb_url { get; set; }
        public string plot_simple { get; set; }
        public string type { get; set; }
        public string poster { get; set; }
        public string imdb_id { get; set; }
        public string also_known_as { get; set; }
        public string language { get; set; }
        public string country { get; set; }
        public string release_date { get; set; }
        public string filming_locations { get; set; }
        public string runtime { get; set; }
        public List<string> directors { get; set; }
        public List<string> writers { get; set; }
        public List<string> actors { get; set; }
        public List<string> genres { get; set; }
    }

}

ok i found this one IMDB scraper

for C#:
http://web3o.blogspot.de/2010/11/aspnetc-imdb-scraping-api.html

PHP here:
http://web3o.blogspot.de/2010/10/php-imdb-scraper-for-new-imdb-template.html

alternatively a imdbapi.org implementation for c#:

using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Xml.Linq;
using HtmlAgilityPack; // http://htmlagilitypack.codeplex.com/


public class IMDBHelper
{

    public static imdbitem GetInfoByTitle(string Title)
    {
        string url = "http://imdbapi.org/?type=xml&limit=1&title=" + Title;
        HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
        req.Method = "GET";
        req.UserAgent = "Mozilla/5.0 (Windows; U; MSIE 9.0; WIndows NT 9.0; en-US))";
        string source;
        using (StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream()))
        {
            source = reader.ReadToEnd();
        }
        HtmlDocument doc = new HtmlDocument();
        doc.LoadHtml(source);        
        XDocument xdoc = XDocument.Parse(doc.DocumentNode.InnerHtml, LoadOptions.None);
        imdbitem i = new imdbitem();
        i.rating = xdoc.Descendants("rating").Select(x => x.Value).FirstOrDefault();
        i.rating_count = xdoc.Descendants("rating_count").Select(x => x.Value).FirstOrDefault();
        i.year = xdoc.Descendants("year").Select(x => x.Value).FirstOrDefault();
        i.rated = xdoc.Descendants("rated").Select(x => x.Value).FirstOrDefault();
        i.title = xdoc.Descendants("title").Select(x => x.Value).FirstOrDefault();
        i.imdb_url = xdoc.Descendants("imdb_url").Select(x => x.Value).FirstOrDefault();
        i.plot_simple = xdoc.Descendants("plot_simple").Select(x => x.Value).FirstOrDefault();
        i.type = xdoc.Descendants("type").Select(x => x.Value).FirstOrDefault();
        i.poster = xdoc.Descendants("poster").Select(x => x.Value).FirstOrDefault();
        i.imdb_id = xdoc.Descendants("imdb_id").Select(x => x.Value).FirstOrDefault();
        i.also_known_as = xdoc.Descendants("also_known_as").Select(x => x.Value).FirstOrDefault();
        i.language = xdoc.Descendants("language").Select(x => x.Value).FirstOrDefault();
        i.country = xdoc.Descendants("country").Select(x => x.Value).FirstOrDefault();
        i.release_date = xdoc.Descendants("release_date").Select(x => x.Value).FirstOrDefault();
        i.filming_locations = xdoc.Descendants("filming_locations").Select(x => x.Value).FirstOrDefault();
        i.runtime = xdoc.Descendants("runtime").Select(x => x.Value).FirstOrDefault();
        i.directors = xdoc.Descendants("directors").Descendants("item").Select(x => x.Value).ToList();
        i.writers = xdoc.Descendants("writers").Descendants("item").Select(x => x.Value).ToList();
        i.actors = xdoc.Descendants("actors").Descendants("item").Select(x => x.Value).ToList();
        i.genres = xdoc.Descendants("genres").Descendants("item").Select(x => x.Value).ToList();
        return i;
    }

    public class imdbitem
    {
        public string rating { get; set; }
        public string rating_count { get; set; }
        public string year { get; set; }
        public string rated { get; set; }
        public string title { get; set; }
        public string imdb_url { get; set; }
        public string plot_simple { get; set; }
        public string type { get; set; }
        public string poster { get; set; }
        public string imdb_id { get; set; }
        public string also_known_as { get; set; }
        public string language { get; set; }
        public string country { get; set; }
        public string release_date { get; set; }
        public string filming_locations { get; set; }
        public string runtime { get; set; }
        public List<string> directors { get; set; }
        public List<string> writers { get; set; }
        public List<string> actors { get; set; }
        public List<string> genres { get; set; }
    }

}
原来分手还会想你 2024-08-23 07:36:47

这是一个 Python 模块,提供 API 以从 IMDB 网站获取数据

http:// techdiary-viki.blogspot.com/2011/03/imdb-api.html

Here is a Python module providing API's to get data from IMDB website

http://techdiary-viki.blogspot.com/2011/03/imdb-api.html

旧伤慢歌 2024-08-23 07:36:47

我非常有信心您找到的应用程序实际上从 Themoviedb.org 的 API 获取信息(他们从 IMDB 获取大部分内容)。他们有一个免费的开放 API,许多电影组织者/XMBC 应用程序都使用该 API。

Im pretty confident that the application you found actually gets their information form Themoviedb.org's API(they get most of there stuff from IMDB). They have a free open API that is used alot of the movie organizer/XMBC applications.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文