Where is IMDB’s API?

Internet Movie Database
Internet Movie Database

I really like the Internet Movie Database (IMDB). It is the largest freely available database of movie related data. I use it mainly for two things:

  1. Whenever I see an actor or actress in a movie and cannot remember in which movie I have seen that person before. IMDB list all the actors/actresses in the movie and allows you to click on the name of each person. On the page of the person it will then show you all the movies in which they played a role.
  2. Whenever I am in video store and need to know whether the movie  that I am about to rent is any good. IMDB has a ratings systems that can give you a good general idea of the quality of the movie.

This post will be about the second use case. In the video store I use the Internet connection of my mobile phone. This is a tedious and often infuriating process, especially when you want to look up multiple titles. IMDB’s pages are huge (they have many images and ads), and this makes them load very slowly. In case of an ambiguous title two pages need to load before you can see the rating. Let’s look at an example. If I search for “pulp fiction” I get the following page:

IMDB results page (click to enlarge)
IMDB results page (click to enlarge)

I then have to click on the  “Pulp Fiction” link to see the IMDB page which has the rating:

Pulp Fiction at IMDB (click to enlarge)
Pulp Fiction at IMDB (click to enlarge)

After another angry session at the video store, I decided to do something about it. First I looked for a mobile version of the IMDB website. There are some available options (see here and here), but they are geared towards iPhones and don’t really work well.

Next I decided to write my own small web application and tried to find the IMDB API. It doesn’t exist! Unfortunately there is no way to easily use and re-purpose IMDB’s data. I don’t understand why some web companies (in this case Amazon) still don’t realise that this actually inhibits the building of their brands.

Luckily there is always one last option: screen scraping. I was actually willing to try and write my own parser for this (would be great practise), but found Izzysoft‘s IMDBPHP class which makes this easy work. This class allows you to get a lot of data about each movie.

After about two hours of programming I now have the following result. I call it Rent it?:

Rent it? The results for "Pulp Fiction"
Rent it? The results for "Pulp Fiction"

I tried to design it to be as fast as possible and made it fit for purpose using the following design considerations:

  • I used a big input field at the top of the screen, with a big button underneath. This input field is also shown on the results pages, so that it is always easy to start a new query. The field gets automatic focus as soon as the page finishes loading.
  • Only relevant information about each movie is shown: rating, title, year, director, run time in minutes and a user generated plot outline. The title links to the original IMDB page which will open in a new window.
  • The standard IMDB score is converted to a percentage and gets a background colour on the basis of the height of the rating. Red has a rating of less than 60% (not worth watching), whereas movies with green ratings are above 70% and could be interesting.
  • The pages are very light: no ads or images. All the processing is done on the server. If a search has many results, then this processing can still take a while. That is why the number of results are capped at five and results are cached for a week (also on the server to benefit everybody).

I hope you are willing to try it out and look forward to any of your feedback!

Try “Rent it?

Rent it? is also accessible through my mobile start page.

7 thoughts on “Where is IMDB’s API?

  1. Well, you wrote this post more than a year back and guess what, IMDB still hasn’t woken up and they stll don’t have an API. Your webapp is really helpful. Thanks.

    One question, though, is it legal considering how most companies hate scraping ?

    1. Yes, quite amazing that they keep choosing this business strategy. I guess they really need some competition.

      I doubt IMDB approves of screen scraping techniques, but the way I used the API is not very offensive. It really is just like using the browser, so that puts it into a real grey legal area I would say (I am not the right person for legal advice though!).

      Enjoy!

  2. Yeah just a warning for screen scraping:

    “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. ”

    There’s plenty of other ways to get data from IMDB now, also it’s only for personal use. IMDB has an API but you have to pay $15,000.00 minimum for it, but as long as it’s personal I don’t think they would do anything about it.

    Just a little warning that’s all, since this blog post shows in the top of the search results when searching for IMDB API! 😛

Comments are closed.