Connecting to IMDB
Asked Answered
S

10

23

Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.

Salmonberry answered 19/9, 2008 at 7:36 Comment(0)
W
14

There is no webservice available.

But there are enough html scrapers written in every language to suit your needs!

I've used the .NET 3.5 Imdb Services opensource project in a few personal projects.

1 minute google results:

Weeds answered 19/9, 2008 at 7:38 Comment(1)
Thanks I'm looking for this to simplify my project job in university :)Friulian
S
18

The libraries for IMDb seem quite unreliable at present and highly inefficient. I really wish IMDb would just create a webservice.

After a bit of searching I found a reasonable alternative to IMDb. It provides all the basic information such as overview, year, ratings, posters, trailers etc.:

The Movie Database (TMDb).

It provides a webservice with wrappers for several languages and seems reliable so far. The search results have been, for myself, more accurate as well.

Surely answered 16/11, 2010 at 8:29 Comment(0)
W
14

There is no webservice available.

But there are enough html scrapers written in every language to suit your needs!

I've used the .NET 3.5 Imdb Services opensource project in a few personal projects.

1 minute google results:

Weeds answered 19/9, 2008 at 7:38 Comment(1)
Thanks I'm looking for this to simplify my project job in university :)Friulian
C
8

The only "API" the IMDb publishes is a set of plain-text data files containing formatted lists of actors, directors, movies, etc. You would likely need to write your own parser unless somebody has released one for your language. Try Google searches like "imdb api" and "imdb parser".

A screen scraper might be useful, but they specifically prohibit scrapers in their terms of use.

Centonze answered 19/9, 2008 at 7:44 Comment(1)
Your totally correct about the fact that it's prohibited to use scrapers, but because it's for personal use only I would not make that a "show stopper".Weeds
E
5

Here is my own solution using RegEx:

private const string UglyMovieRegex = "(?<=5>|3>)(Cast|Director:|Fun\\sStuff|Genre:|Plot:|Runtime:|Tagline:|Writers:)"
                                                + "|href=\"[\\w\\d/]+?(Genres|name|character)/([\\w]+?)/\".*?>([.\\-\\s\\w]+)</a>"
                                                + "|(?<=h\\d>)([.\\w\\s'\\-\"]+)(?=<a\\sc|</d|\\|)";

Regex MovieData = new Regex (UglyMovieRegex, RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline );
Embodiment answered 20/9, 2008 at 21:27 Comment(0)
C
5

Though this was posted over two years ago, here is a simple python code

import urllib2

movie_id = raw_input('Enter the ID of the movie: ')
json = urllib2.urlopen('http://imdbapi.com/?i=' + movie_id + '&r=json')

print json.read()

save as imdb.py and then run as in shell or terminal or whatever

if you want xml data just replace json with xml

please note that this is using the imdbapi.com website to return a json result visit that website to view more options.

Compline answered 27/6, 2011 at 16:0 Comment(0)
C
4

IMDB prohibits scrapers, and change the page layout every once in a while, so parsing HTML is an option, but be prepared to adjust your code 2-3 times a year (been there, done that, given up). They do have a fee-based service giving the full access to the data, but you'll also need to explain what is it for, and convince them you are not building a competitive website (I had a link to that, but it seems to have changed and can't find it now).

Colene answered 19/9, 2008 at 7:48 Comment(1)
Hi I don't understand why imdb doesn't allow webscraping but they do give you full access to thier full data? Do you know the reason? It just doesn't make sense cause web scraping is just getting data from their site which they already provide?Shrivel
P
2

Another alternative is to run the IMDB database on your local machine. Java Movie Database imports the IMDB database files, converts them and provides a locally-accessible copy of IMDB. IMDB has some functionality which Java Movie Database does not have and visa-versa but if what you're looking for is quick access to all the data it might be worth giving this a try.

Pennington answered 23/8, 2009 at 23:3 Comment(0)
H
2

Now there's is an (undocumented) API like http://www.imdb.com/xml/find?json=1&q=Harry+Potter. See Does IMDB provide an API?

Hartzel answered 20/4, 2013 at 14:7 Comment(0)
T
1

TRYNT Heavy Technologies provides (for free) a web service for retrieving basic IMDb data -- check out their site at http://www.trynt.com/trynt-movie-imdb-api/. They also have a separate service for Television data.

Talya answered 14/11, 2008 at 19:36 Comment(1)
Is Trynt dead? It's down for few days now.Sumach
T
0

There is at least one unofficial IMDb API called IMDb8. It has about 31 endpoints including

  1. actors/list-born-today
  2. actors/get-awards-summary
  3. title/get-plots
  4. title/get-top-crew

etc. Like any other API it is very straightforward to use. I used this API for building a fun trivia project. You can find a tutorial on how to get started here.

Throe answered 22/9, 2020 at 7:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.