npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

how-to-scrape-imdb-data

v0.0.2

Published

Node.js client for scraping IMDb title data using the ScrapingBee web scraping API.

Downloads

289

Readme

how-to-scrape-imdb-data

Node.js client for scraping IMDb title data through the ScrapingBee web scraping API. Pull a movie's title, rating, genres, summary, and director as JSON, with residential proxies and extraction handled server-side. If you want to know how to scrape IMDb without getting blocked, this is the wrapper.

npm install how-to-scrape-imdb-data

Free tier: 1,000 credits, no card, at scrapingbee.com.

Scrape a movie in a few lines

Every IMDb movie has a tt id, the code in its URL. Pass that id and this IMDb scraper returns the structured fields.

const { ImdbScraper } = require('how-to-scrape-imdb-data');

const scraper = new ImdbScraper({ apiKey: 'YOUR-API-KEY' });

async function run() {
    const movie = await scraper.title('tt1375666'); // Inception
    console.log(movie.title, movie.rating, movie.genres);
}

run();

Every method returns a Promise. The premium proxy is on by default, which is what keeps a repeated job from getting blocked.

Build a small catalog

const ids = ['tt0111161', 'tt0068646', 'tt1375666'];
const catalog = [];
for (const id of ids) {
    catalog.push(await scraper.title(id));
}

Custom fields or any IMDb page

// change which fields you extract
const data = await scraper.title('tt1375666', {
    extractRules: {
        title: { selector: 'h1', type: 'text' },
        year: { selector: "a[href*='releaseinfo']", type: 'text' },
    },
});

// or scrape any IMDb URL and get raw HTML back
const html = await scraper.scrape('https://www.imdb.com/chart/top/');

API reference

new ImdbScraper({ apiKey, timeout })

| Option | Type | Default | Description | | --- | --- | --- | --- | | apiKey | string | required | Your ScrapingBee API key | | timeout | number | 60000 | Request timeout in milliseconds |

.title(titleId, options)

Scrape an IMDb title page by id. Returns JSON with the default fields (title, rating, genres, summary, director) unless you override extractRules.

| Option | API parameter | Default | Description | | --- | --- | --- | --- | | extractRules | extract_rules | default fields | Your own CSS selectors | | premiumProxy | premium_proxy | true | Residential proxies | | renderJs | render_js | platform default | Force or disable JavaScript rendering | | extra | (any) | {} | Any other documented HTML API parameter |

.scrape(url, options)

Fetch any IMDb URL. Returns rendered HTML, or JSON when extractRules is passed.

What a title call returns

Using the default selectors from ScrapingBee's IMDb guide:

{
  "title": "Inception",
  "rating": "8.8/10",
  "genres": ["Action", "Adventure", "Sci-Fi"],
  "summary": "A thief who steals corporate secrets...",
  "director": "Christopher Nolan"
}

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. Current pricing: scrapingbee.com/pricing.

FAQ

How do I scrape IMDb data at scale?

Route requests through rotating residential proxies. This wrapper does that by default, so you can loop over many tt ids without IMDb blocking you.

Where do the default fields come from?

The default selectors match ScrapingBee's IMDb guide. Override them with extractRules when you need different fields.

Can I scrape charts like the Top 250?

Yes. Call scrape('https://www.imdb.com/chart/top/') for the HTML, or pass extractRules to get structured JSON.

Is scraping IMDb allowed?

Public data is generally collectible for research and analysis, but IMDb's terms and local rules apply. Scrape public pages only.

Links

License

MIT. See LICENSE.

Disclaimer

Unofficial Node.js wrapper around the ScrapingBee web scraping API. Not affiliated with ScrapingBee or IMDb. Compliance with IMDb's terms of service and applicable law is the responsibility of the operator.