how-to-scrape-imdb-data
Scrape IMDb title data into parsed JSON. A thin Python wrapper over the ScrapingBee web scraping API that fetches an IMDb page through residential proxies and returns fields using the extraction rules from ScrapingBee's IMDb guide.
pip install how-to-scrape-imdb-data
If you searched for how to scrape IMDb data, or you need a reliable IMDb scraper that does not get blocked, this is the wrapper. Requires Python 3.8+ and requests.
30-second example
from how_to_scrape_imdb_data import ImdbScraper
scraper = ImdbScraper(api_key="YOUR_API_KEY")
movie = scraper.title("tt1375666") # Inception
print(movie)
Grab a key first. ScrapingBee gives 1,000 credits with no card at scrapingbee.com.
The client
ImdbScraper(api_key: str, timeout: int = 60)
Requests use a premium (residential) proxy by default, which is what keeps IMDb from blocking a repeated job. The client serializes extraction rules and builds title URLs for you.
Methods
title(title_id, extract_rules=None, **kwargs)
Scrape an IMDb title page by its id, for example tt1375666. Returns JSON with title, rating, genres, summary, and director by default.
| Argument | Purpose |
|---|---|
title_id |
IMDb id such as tt1375666 (required) |
extract_rules |
Override the default fields with your own selectors |
premium_proxy |
Residential proxies (default True) |
render_js |
Force or disable JavaScript rendering (default: platform default) |
extra |
Dict of any other documented HTML API parameter |
scrape(url, extract_rules=None, **kwargs)
Fetch any IMDb URL, such as a person page or a chart. Returns rendered HTML by default, or JSON when you pass extract_rules.
Default fields
The default extraction uses the selectors from ScrapingBee's IMDb guide:
{
"title": {"selector": "h1", "type": "text"},
"rating": {"selector": "span[role='img']", "type": "text"},
"genres": {"selector": "div[data-testid='genres'] a", "type": "list"},
"summary": {"selector": "span[data-testid='plot-xl']", "type": "text"},
"director": {"selector": "li[data-testid='title-pc-principal-credit']:first-child a", "type": "text"},
}
Pass your own extract_rules when you need different fields, or add ai_extract_rules through extra for natural-language extraction.
Scrape a list of movies
scraper = ImdbScraper(api_key="YOUR_API_KEY")
ids = ["tt0111161", "tt0068646", "tt1375666"]
catalog = [scraper.title(tid) for tid in ids]
Credits
ScrapingBee bills successful requests. An IMDb title request with a premium proxy and the default rendering costs 25 credits. CSS extraction adds nothing; ai_extract_rules adds 5. See scrapingbee.com/pricing.
Notes
- Scrape public IMDb pages only. ScrapingBee's terms prohibit scraping behind a login.
- Selectors reflect IMDb's current title-page markup and may need updating over time.
Links
License
MIT
Disclaimer
Unofficial Python client built on the ScrapingBee web scraping API. Not affiliated with ScrapingBee or IMDb. Comply with IMDb's terms of service and applicable law.
Metadata
Release files for how-to-scrape-imdb-data 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| how_to_scrape_imdb_data-0.0.2.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| how_to_scrape_imdb_data-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / how_to_scrape_imdb_data-0.0.2.tar.gz
| Download URL | how_to_scrape_imdb_data-0.0.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30a41646aa03586cbeb9c9719c18b2ba251bd5e0d57630acabdd8b9f7b848180
|
|
BLAKE2b-256 checksum How to use checksums |
5304154612abd81298093aaccdc7117207fba82c16ab0609f0d6576c6e14662a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / how_to_scrape_imdb_data-0.0.2-py3-none-any.whl
| Download URL | how_to_scrape_imdb_data-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93f1f311ca344d67d564c6cd8f5fe82235a87513e3bb4b41c304d154323da418
|
|
BLAKE2b-256 checksum How to use checksums |
a10b9072a09508b9429aecb2f9f80f7e48a122dcdc883686cecb242579da5ae9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|