imdbkit is a robust Python library for scraping and retrieving detailed information about movies, TV series, and celebrities from IMDb. It provides a simple API to fetch information about movies, series, episodes, and people from IMDb.
Credits: SilentXBotz
You can install the package directly from the repository:
pip3 install git+https://github.com/NBBotz/IMDBKitOr add it to your requirements.txt:
git+https://github.com/NBBotz/IMDBKit
Or install from source (locally):
pip install .To install development dependencies:
pip install .[dev]Here are some examples of how to use imdbkit.
The recommended way to use imdbkit is by creating an instance of IMDBKit.
from imdbkit import IMDBKit
kit = IMDBKit()from imdbkit import TitleType
results = kit.search_movie("The Matrix", title_type=TitleType.Movies)
for title in results.titles:
print(f"{title.title} ({title.year}) - {title.imdbId}")movie = kit.get_movie("0133093") # Matrix
print(movie.title)
print(movie.year)
print(movie.rating)
print(movie.plot)person = kit.get_name("0000206") # Keanu Reeves
print(person.name)
print(person.bio)
print(person.birth_date)# Breaking Bad
episodes = kit.get_season_episodes("0903747", season=1)
for episode in episodes.episodes:
print(f"S{episode.season}E{episode.episode}: {episode.title}")# Fetch all episodes for a series
all_episodes = kit.get_all_episodes("0903747")
print(f"Total episodes found: {len(all_episodes)}")akas = kit.get_akas("0133093")
for aka in akas:
print(f"{aka.country.name}: {aka.title}")filmography = kit.get_filmography("0000206") # Keanu Reeves
print(f"Credits found: {len(filmography)}")reviews = kit.get_reviews("0133093")
for review in reviews:
print(f"{review['author']['nickName']}: {review['summary']['originalText']}")trivia = kit.get_trivia("0133093")
for item in trivia:
print(item['displayableArticle']['body']['plaidHtml'])interests = kit.get_all_interests("0133093")
print(f"Interests: {', '.join(interests)}")To run the tests, you need to have pytest installed.
pip install .[test]
pytestThis repository is a modified version of the original imdbinfo Python package by tveronesi.
This library is intended for educational and research purposes only. It scrapes data from IMDb, which may be against their Terms of Service. Use it responsibly and at your own risk. The authors of this library are not responsible for any misuse or consequences resulting from the use of this software.