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

5

5

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

Sammons answered 27/7, 2012 at 13:40 Comment(4)
Why don't make a request to the endpoint the script calls (make the ajax call)?Pneumectomy
possible duplicate of Does IMDB provide an API?Impassive
The link in my comment above contains the solution.Impassive
but no solution has a way to get the TOP 250 list.. Am specific on the "TOP 250 list"Sammons
D
6

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.

Dykes answered 21/3, 2013 at 20:8 Comment(3)
I believe they are updated weekly. And the top 250 movies would not change very much day to day, anyway.Dykes
I have written a script that converts all the .list.gz files to JSON which should make it easier to work with: github.com/oxplot/imdb2jsonTransponder
Mansour: those files are enormous already, and I'd guess JSON is even larger due to the tags for formatting. What most people do is load them into a relational database for queries. I have done this for SQL Server and others have written a parser for python/mysql.Dykes
B
2

Yes now there is a API called the omdbapi

http://www.omdbapi.com/
Backsword answered 9/9, 2015 at 7:56 Comment(2)
Nice one..! But it has very limited functionality.Aldarcie
@JayModi I know still its the only one of its type as of I knowBacksword
J
1

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.

Judgment answered 19/8, 2016 at 18:41 Comment(0)
G
0

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)

Gussie answered 9/11, 2015 at 18:48 Comment(0)
K
0

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

Kantianism answered 11/2, 2021 at 19:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.