vivek_jonam
vivek_jonam

Reputation: 3297

API or any other way to access IMDB TOP 250 list?

I have done extensive research and found that I couldn't find an API. Is there any available API to get the TOP 250 list?

Or another way to get access to the list?

I tried accessing the page HTML and parsing in my JSP backend. But the problem here is that I get only a skeleton, the list loads as AJAX.

Any way of web scraping it?

Any usage Idea would be appreciated...

Upvotes: 5

Views: 12181

Answers (5)

Chali
Chali

Reputation: 1108

https://www.theimdbapi.com/ this one is great, i am usng from sometime now

Upvotes: 0

Jabba
Jabba

Reputation: 20664

I came across this problem too and I solved it with some scraping. Here is the Python code:

import requests
import re

top250_url = "http://akas.imdb.com/chart/top"


def get_top250():
    r = requests.get(top250_url)
    html = r.text.split("\n")
    result = []
    for line in html:
        line = line.rstrip("\n")
        m = re.search(r'data-titleid="tt(\d+?)">', line)
        if m:
            _id = m.group(1)
            result.append(_id)
    #
    return result

It returns the IMDb IDs of the Top 250 movies. Then, using the imdbpy package you can ask all the information about a movie, since you have the movie ID.

Upvotes: 1

Callombert
Callombert

Reputation: 1099

Available from there:

http://api.myapifilms.com/imdb.do

Get url for it is there: (You'll need a free token)

 http://api.myapifilms.com/imdb/top?token=GET A FREE API KEY&format=json&data=0

(Not my site)

Upvotes: 0

Jaysheel Utekar
Jaysheel Utekar

Reputation: 1196

Yes now there is a API called the omdbapi

http://www.omdbapi.com/

Upvotes: 2

David Chappelle
David Chappelle

Reputation: 1243

The easiest way is to just download the data from the IMDb alternate interfaces.

The file you want is ratings.list.gz. The Top 250 films are listed in the first section.

Upvotes: 6

Related Questions