Quick start
Install imdby from PyPI:
pip install imdby
Then import the IMDb class and create an access object. Every imdby method is called on an IMDb() instance:
from imdb.imdb import IMDb
ia = IMDb()
Fetching a title
If you already know a title's IMDb id (for example tt4154796), pass it to movie() for its core details, or to one of the other title methods for a specific slice of its page:
# Fetch core movie details
movie = ia.movie('tt4154796')
print(movie.title, movie.rating, movie.genre)
# Fetch full cast and crew
cast = ia.full_cast_and_crew('tt4154796')
print('Directors:')
for director in cast.directors_name:
print(director)
plot(), plot_keywords(), taglines(), company(), release_info(), ratings(), parental_guide(), technical_spec(), critic_reviews(), external_reviews(), external_sites(), and user_reviews() all take the same title_id and cover the rest of a title's page — see Usage for the full reference.
Searching
If you don't already know a title, person, company, event, character, or news item's IMDb id, resolve it from text with the matching search_* method. These are interactive: imdby prints up to 20 numbered suggestions to the console and calls input() to read the serial number(s) of your pick.
# Prompts for a serial number from the printed matches
people = ia.search_person('Simon Baker')
print(people.person_id, people.name)
search_movie(), search_company(), search_event(), search_character(), and search_news() work the same way.
Charts and listings
Chart methods take no arguments and return pandas DataFrames:
# Browse the IMDb Top 250 as a DataFrame
charts = ia.imdb_charts()
print(charts.top_rated_movies_df.head())
top_india_charts() and trending_now_in_india() work the same way. upcoming_releases() is also interactive — it prompts you to pick a region, then lists upcoming releases there.
Next steps
See Usage for the complete method reference, or FAQs for common questions about setup and behavior.