Complete Guide: How to Scrape Rotten Tomatoes Using Python and Apify
Pull Rotten Tomatoes search results into Python rows with Rotten Tomatoes Scraper: inputs, output fields, a sample row and repeat searches.

Rotten Tomatoes is a site for movie and TV titles, and its search turns a phrase into a list of results: a title, a release year, a tomatometer score and a short cast line for each. Reading that list by eye is fine for one title. It stops being fine when you want the scores of many titles in a spreadsheet, or in a script that runs again next week. This guide shows how to pull the search results into structured Python rows with Rotten Tomatoes Scraper, an Apify Actor, so you can sort, filter and store them yourself. The sample rows in Step 4 are the first three rows of the Actor's example run of 27 November 2026.
The Actor is not affiliated with Rotten Tomatoes. It reads the public search results without a login. The guide covers what you can give the Actor, what it returns and the limits of one run, with a working script at each step.
TL;DR
In this tutorial you will learn to:
- Set the search: one phrase and a cap on the number of rows.
- Start the Actor from Python with the Apify client and read its dataset.
- Read each row: title, year, tomatometer score, cast, link, and the phrase and time that produced it.
- Sort the rows by score, save them to CSV and repeat the search for more phrases.
Key steps: install the client, set your token, run the script, read the rows. The Actor is Rotten Tomatoes Scraper, and the expected outcome is one structured row per title.
Prerequisites and setup
You need three things:
- Python 3, with the Apify client installed.
- A free Apify account. You can sign up on the Apify site.
- Your Apify API token, from your Apify account. The token authorises the client to start the Actor and read its results. Keep the token out of the script itself, so the file can be shared safely, and set the variable once per terminal session.
Install the client and export the token in the shell where you run the script:
pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
The Actor reads the public pages itself, so no browser is needed on your side.
Understanding the Actor
Rotten Tomatoes Scraper takes one search phrase and returns the titles that the public search lists for it. Each title becomes one row in a dataset that you can download from the run in JSON, CSV, Excel or JSONL. The Actor has two inputs, and both are plain values: a phrase and a number. It needs no list of URLs, no filter object and no site login, so the whole configuration fits on one line of Python.
Three limits are worth knowing before you plan a pull. Each run reads the first page of results for the phrase, so maxItems is a ceiling: asking for more rows than the page lists returns the smaller number. The Actor takes one phrase per run, so several phrases mean several runs. And a phrase that matches nothing is not an error: the run ends as succeeded, stores no rows and says so in its status message.
Step-by-step guide to using the Actor
Step 1: Open the Actor
Open the Rotten Tomatoes Scraper page on Apify Store. This guide starts the Actor from Python, so the name reventadata/rottentomatoes-scraper is all you need from that page. The page also lists the input fields if you prefer to read them there.
Step 2: Choose the search
The Actor takes these input fields:
query: the phrase to look up in the public title search. Required. Extra spaces inside the phrase are collapsed to single spaces. A phrase longer than 120 characters ends the run as failed, and so does an empty one.maxItems: the most rows to save. It defaults to 100 and must be at least 1; a smaller value ends the run as failed.
The example input of this guide is:
{"query": "matrix", "maxItems": 10}
The phrase matrix is short on purpose. A short phrase lists several related titles, which makes the rows easier to compare in the first run.
Step 3: Start the run from Python
This script starts the Actor, waits for it to finish, reads the dataset and prints three lines per title:
import os
from apify_client import ApifyClient
# 1. Initialise the client with your token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])
# 2. Describe the search: the phrase "matrix", at most 10 rows
run_input = {"query": "matrix", "maxItems": 10}
# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/rottentomatoes-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
status = run.status if run else "unknown"
raise SystemExit(f"Run did not succeed (status: {status}).")
# 4. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} titles.\n")
# 5. Print three lines per title
for item in items:
score = item.get("tomatometer")
print(f"{item['title']} ({item.get('year') or 'year unknown'}): tomatometer {score if score is not None else 'none'}")
print(f" cast: {item.get('cast') or 'not listed'}")
print(f" {item['url']}")
For the example run of 27 November 2026, the script printed this at the start (the first three of the 10 titles):
Retrieved 10 titles.
The Matrix (1999): tomatometer 83
cast: Keanu Reeves,Laurence Fishburne,Carrie-Anne Moss
https://www.rottentomatoes.com/m/matrix
The Matrix Resurrections (2021): tomatometer 63
cast: Keanu Reeves,Carrie-Anne Moss,Yahya Abdul-Mateen II
https://www.rottentomatoes.com/m/the_matrix_resurrections
The Matrix Reloaded (2003): tomatometer 73
cast: Keanu Reeves,Laurence Fishburne,Carrie-Anne Moss
https://www.rottentomatoes.com/m/matrix_reloaded
To search for something else, change the phrase in query. The script reads year, tomatometer and cast with .get(), because each of them can be null.
Step 4: Read a sample row
Each row is a JSON object. Here are the first three rows of the Actor's example run of 27 November 2026, which searched matrix with maxItems set to 10 and returned 10 rows. They are copied as the Actor returned them:
[
{
"id": "m/matrix",
"title": "The Matrix",
"url": "https://www.rottentomatoes.com/m/matrix",
"year": "1999",
"tomatometer": 83,
"cast": "Keanu Reeves,Laurence Fishburne,Carrie-Anne Moss",
"matchedQuery": "matrix",
"scrapedAt": "2026-11-27T13:59:15.719579+00:00"
},
{
"id": "m/the_matrix_resurrections",
"title": "The Matrix Resurrections",
"url": "https://www.rottentomatoes.com/m/the_matrix_resurrections",
"year": "2021",
"tomatometer": 63,
"cast": "Keanu Reeves,Carrie-Anne Moss,Yahya Abdul-Mateen II",
"matchedQuery": "matrix",
"scrapedAt": "2026-11-27T13:59:15.719579+00:00"
},
{
"id": "m/matrix_reloaded",
"title": "The Matrix Reloaded",
"url": "https://www.rottentomatoes.com/m/matrix_reloaded",
"year": "2003",
"tomatometer": 73,
"cast": "Keanu Reeves,Laurence Fishburne,Carrie-Anne Moss",
"matchedQuery": "matrix",
"scrapedAt": "2026-11-27T13:59:15.719579+00:00"
}
]
The year is a string, not a number, so convert it with int() before you do arithmetic on it. The tomatometer is an integer. The cast is one string, and in these rows the names are separated by commas, so item["cast"].split(",") gives a list of names. The id is the path of the title on the site, and the url is the full link to the same page.
Step 5: Sort the rows and save them
This snippet continues from the same items list. It drops titles that have no score, sorts the rest from the highest score to the lowest and writes a CSV file:
import csv
# Keep titles that have a tomatometer, highest first
scored = [item for item in items if item.get("tomatometer") is not None]
scored.sort(key=lambda item: item["tomatometer"], reverse=True)
# Write one CSV line per title
with open("rottentomatoes-matrix.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.DictWriter(f, fieldnames=["title", "year", "tomatometer", "cast", "url"])
writer.writeheader()
for item in scored:
writer.writerow({key: item.get(key) for key in writer.fieldnames})
Open the CSV in a spreadsheet and you have the titles of one search, ranked by score, each with a link back to its page. Titles without a score are left out of this file by the scored filter.
Working with the API
The Apify client does the work of starting the Actor and reading its results. The script only needs the token and the Actor name.
The call in Step 3 returns the finished run. Its status field is SUCCEEDED when the run completed, and default_dataset_id names the dataset that holds the rows. The list_items() call returns the rows, and .items is the list.
Error handling in the script is deliberately short. A run that did not succeed stops the script with its status. A run that succeeded with zero rows passes that check and gives an empty list, so Retrieved 0 titles. is how a phrase with no match shows up in the output.
Two details of the rows matter for the code. The score arrives as an integer, so you can sort on it directly, while the year arrives as a string. Rows with a missing value carry null, which Python reads as None, so a .get() with a fallback keeps the print loop from failing. The Actor's name is the only value the call needs besides the input. Keep the input in one dictionary, as Step 3 does, so the same call can start a run for each phrase in a loop. The call() method waits until the run finishes, so the script does not need a polling loop of its own. A search reads a single page of results, so the simple call is enough.
Advanced usage patterns
Batch several phrases. The Actor reads one phrase per run, so start one run per phrase from a loop and keep the same maxItems for each:
for phrase in ["matrix", "alien"]:
run = client.actor("reventadata/rottentomatoes-scraper").call(
run_input={"query": phrase, "maxItems": 10}
)
print(phrase, run.status)
Merge runs on id. Every row carries matchedQuery, so you can tell which phrase found it. The Actor removes repeated titles inside one run, but not across runs, so the same title can appear under two phrases. Keep one row per id when you merge the datasets.
Keep the timestamp. scrapedAt records when each row was read. If you save the results of the same phrase every month, store it with the score, so the rows of two months can be told apart.
Narrow the phrase, not the filter. The Actor has no filter fields. The phrase is the only way to steer the list, so a longer, more exact phrase gives a narrower result than a single common word.
Connect the output. The dataset can be exported to CSV or Excel for a spreadsheet, or loaded into a database from your own code, where the url or id field makes a natural key. A scheduled run that saves the rows every week gives you a history of the scores for the same phrase.
Understanding your data
The rows have a fixed set of fields:
id: the path of the title on Rotten Tomatoes, including its kind. The sample rows showm/for movies, and the dataset description also namestv/for TV titles.title: the title name.url: the link to the title page.year: the release year as a string, ornull.tomatometer: the tomatometer score from 0 to 100 as an integer, ornullwhen the title has none.cast: the cast names as the result lists them, ornull.matchedQuery: the search phrase that produced the row.scrapedAt: the time the row was read, as an ISO 8601 timestamp.
The fields id, title, url, matchedQuery and scrapedAt are always present. The other three can be null, which means the result did not carry that value. Read it as absent, not as an error. The rows keep the order of the result list that the page showed.
Troubleshooting guide
The run did not succeed. Open the run's log in the Apify Console. A missing or empty query ends the run as failed, with a message in the log that the query is required. A maxItems below 1 ends it the same way, and so does a phrase longer than 120 characters.
The run failed on a phrase that worked before. When the results page cannot be read, the run ends as failed and stores no rows. Start it again. If it keeps failing, ask in the comments with the input you used.
Zero rows, but the run succeeded. The page loaded normally and nothing matched the phrase. The status message of the run says so. Try a broader phrase.
Fewer rows than you expected. The Actor reads one page of results per phrase, so a larger maxItems does not return more titles than that page lists.
The script stops at the status check. The status check prints the run's status. A status other than SUCCEEDED means the run needs a look in its log before you read any rows.
Best practices
- Start with
maxItemsat 10 while you check the fields. Raise it once the rows look right. - Treat
year,tomatometerandcastas optional, and read them with.get(). - Keep one phrase per run, so each dataset has a single subject and a single
matchedQuery. - Store
idorurlwith every row, so later runs can be matched to earlier ones. - Check the README of the Actor on the Store page for the current input list before you change a script.
- Print the row count first. A count of 0 tells you to change the phrase before you debug the code.
Conclusion and next steps
You now have a script that starts Rotten Tomatoes Scraper, waits for the run, reads the dataset and prints one block per title. The fields are the same for every phrase, so you can reuse the same code for any search. The next step is to store the rows: write them to CSV as in Step 5, load them into a spreadsheet, or send them to a database from your own code.
Read the Rotten Tomatoes Scraper page on Apify Store for the full input list. For current pricing and details, see the Store page. Try a search with your own phrase and let us know in the comments what you build with the rows.
About the author: reventadata builds and publishes data extraction Actors on the Apify Store.
About the author
- Hi, I'm the engineer behind ReventaData. I build pay-per-event Apify Actors that turn public marketplace, classifieds, jobs and real-estate sites into clean, reliable datasets. Here on Hashnode, I share practical tutorials on collecting structured web data with Python and Apify, and on putting it to work: price tracking, lead lists and market analysis. Explore our turnkey scrapers: https://apify.com/reventadata
Comments
Join the discussionNo comments yet. Be the first to comment.




