679

I recently found a movie organizer application which fetches its data from the IMDB database.

Does IMDB provide an API for this, or any third party APIs available?

tusay
  • 6,999
  • 4
  • 18
  • 10

18 Answers18

477

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.

Timo Tijhof
  • 10,032
  • 6
  • 34
  • 48
  • 2
    RE: The JSONP API not gracefully falling back, (at least) it does return an HTTP error code, but I agree that it's funny that the response body is XML. – Omni5cience Dec 22 '11 at 05:00
  • 10
    I recently noticed that it also includes an 'i' property for images. The url mentioned therein however is a very large image (likely the original). To get a thumbnail, IMDb uses the following: `if (ua.i) { c.img = { src: ua.i[0].replace("._V1_.jpg", "._V1._SX40_CR0,0,40,54_.jpg"), width: 40, height: 54 } }`. – Timo Tijhof Sep 29 '12 at 00:01
  • 2
    could you not just specify jsonp with.Ajax if you getting json with jquery and i think getjson has been deprecated even when this was written it was deprecated i do believe – Chris McGrath Dec 08 '12 at 06:56
  • 2
    @ChrisMcGrath: I hadn't thought about using jQuery.ajax jsonpCallback, I've added it to the answer, Thanks! As for $.getJSON: No, that has most certainly not been deprecated. It is just a small wrapper around $.ajax. – Timo Tijhof Dec 09 '12 at 18:42
  • 2
    Does anyone know how to get included images in the advanced search? Seems they only come with the suggestions... – Cyril Mestrom Feb 17 '13 at 19:58
  • 1
    How do you include in the image and plot and artist on this api search? – Vincent May 19 '14 at 07:37
  • @Krinkle how 'i' property works? I tried this, but no url / raw data in the json: `http://www.imdb.com/xml/find?json=1&nr=1&tt=on&i=on&q=lost` also tried `i=1` – János Feb 06 '15 at 13:26
  • 1
    Forgive my ignorance, but how is this not screen scraping or otherwise data mining, which, as noted below, IMdB does not allow? Or is it? – user124384 Jan 26 '16 at 03:27
  • These return 404's now. – Ernest Jan 14 '19 at 01:41
  • 1
    About the size of images, you can replace the `V1` with `SX123` or `SY456` giving a result with width(X)=123 or height(Y)=456 (`...QXVyMDM2NDM2MQ@@._SY140_.jpg`) – Niek Jul 16 '19 at 13:02
  • and how to use advanced search with suggestions API? – user924 Sep 21 '21 at 09:32
225

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

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

bfritz
  • 2,416
  • 2
  • 20
  • 29
  • 1
    That's awesome, not sure if this is actually yours or you just found it but would love to see something around uptime stats so I could know how much I can count on it :D – Andrew G. Johnson Apr 13 '11 at 03:19
  • 17
    In case anyone is wondering, this is not the official API. See Pekka or Krinkle answers for that. – Jano Dec 28 '11 at 08:53
  • 7
    its really slow..;( – Daniel Magnusson Feb 17 '12 at 23:09
  • 16
    @IanDavis, I'm currently working on getting a new faster/bigger dedicated server for the API, Which isn't cheap! I've almost got enough donations to acquire this within the next few days. The API is getting over 2 million requests a day! – bfritz May 04 '12 at 23:59
  • 1
    Where can I find documentation for this API? Thanks. – Ognjen Jul 11 '12 at 08:23
  • 1
    thanks! this is awesome. using it for my app http://csomakk.github.io/IWatchSeriez/ source available on github – csomakk Dec 24 '13 at 14:52
  • 4
    @OptimusCrime I had an issue the other day with IP's from the 85.XXX.XXX.XXX range and had to temporarily block ALL of them until I could get things under control. Sadly this is one of the trade-offs I have to deal with by not requiring API keys, people tend to just abuse the hell out of it. – bfritz Jul 01 '14 at 16:14
  • do you support keyword search? – quimnuss Dec 16 '14 at 20:36
  • Very slow indeed. Tried a [search for "the" in the title](http://www.omdbapi.com/?t=the&y=&plot=short&r=json). – Dan Dascalescu Feb 18 '15 at 01:35
  • This site is not endorsed by or affiliated with IMDb.com – David Gras Sep 13 '15 at 11:14
  • 1
    @Dan Damscalescu search for an actual movie and it's actually decently fast - [search for "mad max"](http://www.omdbapi.com/?t=mad+max) – Nearoo Aug 05 '16 at 11:38
  • @bfritz You made this API.Awesome! But searching for mad+max giving me the 1979 movie, not the one released in 2015. Shouldn't the API return all matching movie results? – GorvGoyl Aug 21 '16 at 16:52
  • @JerryGoyal you aren't using the correct parameter for searching try "s" instead of "t". – bfritz Aug 23 '16 at 17:47
  • @bfritz - Great API, congratulations on this! Unfortunately, I currently have the same problem described above - when typing "Mad Max" into the example title search, it only returns one result, which in this case is the 1979 version. Any idea why this might be? – Hashim Aziz Oct 06 '16 at 01:46
  • 1
    @bfritz: where do you get your data from? – Glavić Jun 13 '17 at 17:58
  • @Glavić I believe he is getting the data from http://www.imdb.com/interfaces/ – Raja Simon Feb 06 '18 at 07:14
  • 1
    @RajaSimon actually, the majority of data comes from Wikidata.org. – bfritz Feb 08 '18 at 21:11
99

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.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • 7
    How is it possible for screen scraping to be forbidden? –  Jan 01 '11 at 21:11
  • 15
    @omouse From the [terms](http://www.imdb.com/help/show_article?conditions): `Robots and Screen Scraping: You may not use data mining, robots, screen scraping, or similar data gathering and extraction tools on this site, except with our express written consent as noted below.` that doesn't make these terms automatically enforceable in every jurisdiction, but they are in many. – Pekka Jan 01 '11 at 21:19
  • 7
    Yes but this dialog was directed at "Robots". Apparently my robot doesn't understand English so oh well. – Zombies May 12 '13 at 10:58
  • @boomhauer For many sub-folders of their main site, yes they do. The funny thing is they single out Yahoo in their [robots file](http://www.imdb.com/robots.txt) – Scott Chamberlain Dec 30 '13 at 22:02
  • Are there any known parsers to the text files imdb provides? – DataGreed Jan 31 '16 at 14:11
  • This is a pretty old thread. It was helpful only to the extent of reaching imdb interfaces page. The journey from their isn't straight. The data is available in flat files via FTP location ftp://ftp.fu-berlin.de/pub/misc/movies/database/. To convert it into a database, you need to configure and run moviedb software. https://github.com/jeffWelling/moviedb – comiventor Nov 20 '16 at 10:34
  • 2
    As of December 2017, these files are no longer being updated by IMDb. There is a new API that supplies data in a new format. While easier to parse, this new format is a very small subset of the previous format. – David Chappelle Dec 22 '17 at 04:22
  • 3
    I realize this is an extremely old question and answer. However, data mining publicly accessible data is not legally enforceable if you didn't sign a EULA. Even if you did, if the information is publicly accessible through other means, the EULA is still not legally binding. A major decision was recently made to this very effect against LinkedIn. See: https://www.eff.org/deeplinks/2019/09/victory-ruling-hiq-v-linkedin-protects-scraping-public-data IANAL but the EFF are. It's a very sensible ruling. If you put information on the Internet, you should expect people to do stuff with it. – CubicleSoft Feb 29 '20 at 22:47
  • 1
    @David Chappelle As of June 2021, I confirm the files ARE updated with recent titles from 2020 - 2021. Also there is this statement from IMDB: "The dataset files can be accessed and downloaded from https://datasets.imdbws.com/. The data is refreshed daily." – ElektroStudios Jun 12 '21 at 04:08
  • 2
    @ElektroStudios yes, this information is updated, but it is a small subset of the data that used to be available pre 2017. There was a complete archival dump available that had been updated weekly since the 90s, this is no longer available. – David Chappelle Jul 24 '21 at 00:21
  • @DavidChappelle can you elaborate? what kind of data was removed? – MOHAMMAD RASIM Oct 07 '22 at 12:14
51

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

Johann
  • 12,158
  • 11
  • 62
  • 89
  • Is the rotten tomatoes API free to use in a commercial application? Say, for example, to have users get the details of a movie from its title? – KerrM Jul 26 '12 at 21:27
  • 1
    It doesn't look like they're making any distinction between commercial or non-commercial app. You can always have a look at their TOS here: http://developer.rottentomatoes.com/apps/tos Although you will be limited to 10,000 calls per day and 10 per seconds – Johann Jul 27 '12 at 09:23
  • 1
    If you are providing a non-commercial program and need more than 10,000 calls per day, you can talk to them about licencing. The terms are fairly simple and easy to comply with, in that you have to display their logo and/or a particular phrase of wording for the rating. – Omertron Aug 21 '12 at 08:56
  • thanks! this is awesome. using it for my app csomakk.github.io/IWatchSeriez source available on github – csomakk Dec 24 '13 at 14:53
  • Additionally, you are restricted in creating derivative works i.e. you cannot create an application which creates an offline movie database using RT API. Source http://developer.rottentomatoes.com/API_Terms_of_Use – Cool_Coder Dec 28 '14 at 14:46
  • It seems the RT db is missing localized movie names – Sentinel Feb 09 '15 at 23:17
  • 7
    WTF? "The API is intended for use in the U.S. only. Deploying content outside of this territory must be approved by the Rotten Tomatoes team. The API may NOT be shared with any third parties." – Dan Dascalescu Feb 18 '15 at 01:23
  • 1
    @DanDascalescu What a pity. I was going to use it outside de US – nicolascolman Apr 05 '20 at 12:43
  • [https://developer.fandango.com/docs/API_Movie_Methods](https://developer.fandango.com/docs/API_Movie_Methods) returns not found? they removed it? – BluePie Oct 02 '20 at 17:14
50

What about TMDb API ?

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

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

hdorio
  • 12,902
  • 5
  • 34
  • 34
32

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/

MRT
  • 1,610
  • 15
  • 41
Byran Zaugg
  • 967
  • 9
  • 25
  • 3
    appears it's free for "personal" use only otherwise you have to contact them...wow we really need an open equivalent of imdb, though I suppose tmdb is close... – rogerdpack Jun 24 '11 at 21:54
  • hi, this is not really an answer to the question, more a comment to above. – Ian Vaughan Jul 21 '13 at 20:31
  • 8
    @IanVaughan, I believe my answer directly addresses this question: Q: "Does IMDB provide an API for this...?". A: "Yes...[link to data licensing info]." It's not my fault, IMDB doesn't publicly document an API reference. – Byran Zaugg Jul 22 '13 at 21:00
  • 9
    Sorry, I think you are right, I stand corrected. Apologies. – Ian Vaughan Jul 23 '13 at 13:02
22

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

Omertron
  • 864
  • 2
  • 13
  • 27
9

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/

markiv
  • 198
  • 2
  • 7
8

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

Dan Dascalescu
  • 143,271
  • 52
  • 317
  • 404
Valentin Golev
  • 9,965
  • 10
  • 60
  • 84
  • 1
    unfortunately, it will be closed down soon. Do you know how does it work? – PA. Jan 26 '10 at 15:11
  • 1
    It only offers a very limited search too, by movie title only – justinhj Jan 17 '11 at 00:15
  • 12
    As the author of this API, I should point out that the above comments are now redundant as it's not being closed down, and that you can now search by IMDB ID. – Dean Mar 17 '12 at 22:15
  • Checkout http://malhar2010.blogspot.com/2011/02/using-imdb-api-to-get-details-of-movie.html for using IMDb api. –  Feb 25 '11 at 11:54
  • for free imdb API see this http://99webtools.com/get-movie-info-imdb.php – Sunny Nov 22 '13 at 17:18
  • Yes Dan. Maybe it will be back soon. Let's see. – Dean Feb 18 '15 at 10:16
7

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
PirateApp
  • 5,433
  • 4
  • 57
  • 90
4

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.

Akshay Khale
  • 8,151
  • 8
  • 50
  • 58
3

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");
Brett Pennings
  • 1,489
  • 14
  • 19
3

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

  • 1
    and (I almost wrote, "even better!", the developer-caveman-instinct is strong ;-) the latter's source is at http://github.com/skorokithakis/imdbapi – Morten Bergfall Oct 25 '10 at 02:16
2

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.

ThePCWizard
  • 3,338
  • 2
  • 21
  • 32
  • 1
    Netflix shut down their public API almost a year ago. Since they took down the entire developer sub-domain, including the post saying they were shutting it down, here's a link to a news piece on it: https://gigaom.com/2014/11/14/netflix-is-shutting-down-its-public-api-today/ – James Skemp Aug 23 '15 at 23:31
2

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.

bpapa
  • 21,409
  • 25
  • 99
  • 147
1

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; }
    }

}
fubo
  • 44,811
  • 17
  • 103
  • 137
  • 1
    It looks good but according to IMDB, it's forbidden to use this kind of tools. More information https://help.imdb.com/article/imdb/general-information/can-i-use-imdb-data-in-my-software/G5JTRESSHJBBHTGX?ref_=helpsrall# – nicolascolman Apr 05 '20 at 12:56
0

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.

Mike
  • 1,626
  • 1
  • 12
  • 14
0

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

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

vikas
  • 11