Actor picture

Instagram Post Scraper

zuzka/instagram-post-scraper

Use this no-code Instagram tool for scraping data from Instagram posts. Just add one or more Instagram usernames and get your data in seconds including hashtags, mentions, comments, images, likes, locations, and metadata. Download Instagram data in JSON, Excel, HTML and other formats.

No credit card required

Author's avatarZuzka Pelechová
  • Modified
  • Users3,003
  • Runs134,261
Actor picture
Instagram Post 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.

import { ApifyClient } from 'apify-client';

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

// Prepare actor input
const input = {
    "username": [
        "zelenskiy_official"
    ],
    "resultsLimit": 30
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("zuzka/instagram-post-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);
    });
})();