我最近发现了一个从IMDB数据库获取数据的电影管理应用程序。
IMDB是否为此提供API,或任何可用的第三方API ?
我最近发现了一个从IMDB数据库获取数据的电影管理应用程序。
IMDB是否为此提供API,或任何可用的第三方API ?
当前回答
IMDB本身似乎在分发数据,但只是在文本文件中:
http://www.imdb.com/interfaces
有一些相关的api你可以。屏幕抓取是明确禁止的。 官方API似乎正在筹备中,但这已经是几年前的事了。
其他回答
在http://app.imdb.com上有一个供移动应用程序使用的JSON API
然而,警告是相当严重的:
仅供IMDb书面授权的客户使用。 未经授权客户端的作者和用户为他们的行为承担全部法律责任。
我认为这是为那些通过API访问数据而付费的开发者准备的。
编辑:只是为了好玩,我写了一个客户端库,试图从API读取数据,你可以在这里找到它:API -imdb
显然,您应该注意这个警告,并使用像TheMovieDB这样的数据库作为更好、更开放的数据库。
然后你可以使用这个Java API包装器(我写的):API -themoviedb
IMDb有一个公共API,虽然没有文档记载,但是快速可靠(在官方网站上通过AJAX使用)。
搜索建议API
https://sg.media-imdb.com/suggests/h/hello.json https://v2.sg.media-imdb.com/suggests/h/hello.json (as of 2019) Format: JSON-P Caveat: It's in JSON-P format, and the callback parameter can not customised. To use it cross-domain you'll have to use their function name for the callback (which is in the imdb${searchphrase} format). Alternatively, one could strip or replace the padding via a local proxy. https://v2.sg.media-imdb.com/suggestion/h/hello.json (as of 2020) Format: JSON Caveat: It's not CORS-enabled. This is fine for use in apps and server-side scripts. For use in a web app, you'll need to route it through a simple proxy (and consider enabling caching, too!)
// 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();
高级搜索
名称搜索(json): http://www.imdb.com/xml/find?json=1&nr=1&nm=on&q=jeniffer+garner 标题搜索(xml): http://www.imdb.com/xml/find?xml=1&nr=1&tt=on&q=lost 格式:XML 优点:同时支持电影名称和演员名称(与建议API不同)。
请注意,这些api是非官方的,随时都可能更改!
更新(2019年1月):高级API不再存在。好消息是,建议API现在支持“高级”功能,即通过电影名称和演员名称进行搜索。
找到了这个
IMDbPY是一个用于检索和管理数据的Python包 IMDb的电影数据库,关于电影,人物,人物和 公司。
http://imdbpy.sourceforge.net/
这种清洁似乎仍然有效 还有一个:http://imdbapi.poromenos.org/
这是一个Python模块,提供API从IMDB网站获取数据
http://techdiary-viki.blogspot.com/2011/03/imdb-api.html