Scrape and Analyze IMDB Movie Reviews
A LlamaIndex data loader that fetches all user reviews for any movie or TV series from IMDB, with metadata including ratings, dates, spoiler flags, and
Why it matters
Automate the extraction and analysis of user reviews from IMDB for any movie or TV series. This asset allows for deep dives into audience sentiment and specific feedback, streamlining research for content creators and analysts.
Outcomes
What it gets done
Fetch reviews from IMDB using movie title and year.
Extract review metadata including date, rating, and helpfulness.
Optionally generate CSV files for further analysis.
Integrate with LlamaIndex and Langchain for advanced querying and agentic use.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-reader-readers-imdb-review | bash Overview
Readers Imdb Review
The IMDB Reviews loader fetches all user reviews for a specified movie or TV series directly from the official IMDB website. It extracts comprehensive review data including the review date, title, rating, spoiler status, helpfulness votes, and direct links to each review, making it ready for analysis with LlamaIndex or Langchain. Use this loader when you need to analyze audience sentiment for a specific film or series, build a question-answering system about movie reception, or aggregate user opinions. It's ideal for media research or building conversational agents that can discuss movie reviews. Do NOT use this loader if you need real-time data (reviews are fetched at load time), or if you're working on a Linux system without debugging it first (the source notes it currently works on Windows and requires further Linux debugging).
What it does
The IMDB Reviews loader fetches all user reviews for a specified movie or TV series directly from the official IMDB website. It extracts comprehensive review data including the review date, title, rating, spoiler status, helpfulness votes, and direct links to each review, making it ready for analysis with LlamaIndex or Langchain.
When to use - and when NOT to
Use this loader when you need to analyze audience sentiment for a specific film or series, build a question-answering system about movie reception, or aggregate user opinions. It's ideal for media research or building conversational agents that can discuss movie reviews.
Do NOT use this loader if you need real-time data (reviews are fetched at load time), or if you're working on a Linux system without debugging it first (the source notes it currently works on Windows and requires further Linux debugging).
Inputs and outputs
You provide two required parameters: the movie or series name with year (e.g., "The Social Network 2010") and your webdriver engine choice (edge, google, or gecko for Mozilla). Optional parameters include whether to generate a CSV file and whether to enable multithreading.
You receive a collection of documents with structured metadata: review date, title, rating, direct IMDB link, spoiler flag (boolean), number of people who found it helpful, and total vote count. The loader downloads files inside a folder named movie_reviews with the filename as the movie name.
Integrations
The loader integrates with LlamaIndex for vector-based semantic search and question answering, and with Langchain for building conversational agents and pandas-based data analysis tools. Both frameworks can query the loaded review data using natural language.
Installation and usage
pip install llama-index-readers-imdb-review
Basic usage example:
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviews(
movie_name_year="The Social Network 2010", webdriver_engine="edge"
)
docs = loader.load_data()
With LlamaIndex for question answering:
from llama_index.core import VectorStoreIndex
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviewsloader(
movie_name_year="The Social Network 2010",
webdriver_engine="edge",
generate_csv=False,
multithreading=False,
)
docs = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query(
"What did the movie say about Mark Zuckerberg?",
)
print(response)
Who it's for
This loader is designed for developers working with LlamaIndex and Langchain who need to fetch and analyze IMDB movie reviews for their applications.
Source README
IMDB MOVIE REVIEWS LOADER
pip install llama-index-readers-imdb-review
This loader fetches all the reviews of a movie or a TV-series from IMDB official site. This loader is working on Windows machine and it requires further debug on Linux. Fixes are on the way
Install the required dependencies
pip install -r requirements.txt
The IMDB downloader takes in two attributes
- movie_name_year: The name of the movie or series and year
- webdriver_engine: To use edge, google or gecko (mozilla) webdriver
- generate_csv: Whether to generate csv file
- multithreading: whether to use multithreading or not
Usage
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviews(
movie_name_year="The Social Network 2010", webdriver_engine="edge"
)
docs = loader.load_data()
The metadata has the following information
- date of the review (date)
- title of the review (title)
- rating of the review (rating)
- link of the review (link)
- whether the review is spoiler or not (spoiler)
- number of people found the review helpful (found_helpful)
- total number of votes (total)
It will download the files inside the folder movie_reviews with the filename as the movie name
EXAMPLES
This loader can be used with both Langchain and LlamaIndex.
LlamaIndex
from llama_index.core import VectorStoreIndex, download_loader
from llama_index.core import VectorStoreIndex
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviewsloader(
movie_name_year="The Social Network 2010",
webdriver_engine="edge",
generate_csv=False,
multithreading=False,
)
docs = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query(
"What did the movie say about Mark Zuckerberg?",
)
print(response)
Langchain
from langchain.llms import OpenAI
from langchain.agents.agent_toolkits.pandas import (
create_pandas_dataframe_agent,
)
from langchain.agents import Tool
from langchain.agents import initialize_agent
from langchain.chat_models import ChatOpenAI
from llama_index.readers.imdb_review import IMDBReviews
loader = IMDBReviewsloader(
movie_name_year="The Social Network 2010",
webdriver_engine="edge",
generate_csv=False,
multithreading=False,
)
docs = loader.load_data()
tools = [
Tool(
name="LlamaIndex",
func=lambda q: str(index.as_query_engine().query(q)),
description="useful for when you want to answer questions about the movies and their reviews. The input to this tool should be a complete english sentence.",
return_direct=True,
),
]
llm = ChatOpenAI(temperature=0)
agent = initialize_agent(tools, llm, agent="conversational-react-description")
agent.run("What did the movie say about Mark Zuckerberg?")
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.