Actor picture

IMDB Advanced Scraper

epcsht/imdb-advanced-scraper

Advanced scraping on IMDB for data on millions of movies, artists and many more. Crawl TV Episodes and extract descriptions, images, casting, rating, artists and all other properties. You can specify search terms, filters, mappings, modes and much more.

No credit card required

Author's avatarepcsht
  • Modified
  • Users30
  • Runs428
Actor picture
IMDB Advanced Scraper

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running actors via the API in Apify Docs.

const { ApifyClient } = require('apify-client');

// Initialize the ApifyClient with API token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare actor input
const input = {
    "search": "warner",
    "mode": "all",
    "startUrls": [
        "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
        "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
        "https://www.imdb.com/list/ls016522954/?ref_=nv_tvv_dvd",
        "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm"
    ],
    "maxItems": 20,
    "endPage": 1,
    "extendOutputFunction": ($) => { return {} },
    "customMapFunction": (object) => { return {...object} },
    "proxy": {
        "useApifyProxy": true
    }
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("epcsht/imdb-advanced-scraper").call(input);

    // Fetch and print actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
        console.dir(item);
    });
})();