# Instagram Scraper (`scrapeai/instagram-scraper`) Actor

Find public Instagram profiles, posts and reels through Google Search results, without logging in. Accepts profile, post, reel and hashtag URLs or search words and returns usernames, follower counts, post links and the caption text Google shows. Never opens instagram.com; no places or comments.

- **URL**: https://apify.com/scrapeai/instagram-scraper.md
- **Developed by:** [ScrapeAI](https://apify.com/scrapeai) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 13 total users, 0 monthly users, 5.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Instagram Scraper do?

Instagram Scraper looks up **public Instagram profiles, posts, reels and hashtags in Google Search results** and returns what those results show: profile counts and bio text, a post's author, date, like and comment counts, and the start of captions. Give it Instagram URLs, `@usernames`, `#hashtags` or keywords and get one record per profile, post or reel.

#### Where the data comes from

- **The Actor never requests instagram.com.** Instagram's `robots.txt` disallows automated access for generic bots and every logged-out Instagram page is a login wall. The Actor does not log in, does not use session IDs or cookies, and does not try to get around the login wall.
- Instead it reads Google Search result pages through Apify's **GOOGLE_SERP proxy group**:
  - **Profiles** and **single posts / reels**: the Google web result for `site:instagram.com/<username>` or `site:instagram.com/p/<shortcode>`. Google shows counts and dates in the result text, for example `17M followers · 638 following · 447 posts` or `917K likes, 16K comments - zuck on May 5, 2026: "Date Night"`.
  - **Hashtags** and **keywords**: the Google Images result page for `site:instagram.com "#travel"`. It links straight to public post, reel and profile pages and shows the title Google has for each (the first words of the caption).
- Every record says where it came from: `dataOrigin` is always `google-serp`, `serpUrl` is the Google page that was read, and `sourceUrl` is the Instagram page the result describes. A field that the Google result does not show is **left out**, never guessed or filled in from another source.

#### What you get

| Record | Fields |
| --- | --- |
| Profile (`recordType: "profile"`) | `username`, `profileUrl`, `fullName`, `followersText` / `followersCount`, `followingText` / `followingCount`, `postsText` / `postsCount`, `biography`, `isPrivate`, `countsRounded` |
| Post or reel (`recordType: "post"`) | `postType` (`post`, `reel`, `igtv`), `postUrl`, `shortcode`, `username`, `likesText` / `likesCount`, `commentsText` / `commentsCount` (counts only, not the comments), `postedOn`, `postedRelative`, `caption`, `captionSnippet`, `captionHashtags`, `captionMentions` |
| Hashtag results | post records plus `hashtag` and `captionMentionsHashtag` |
| Keyword results | post and profile records plus `searchQuery` |
| All records | `resultTitle`, `resultSnippet`, `sourceUrl`, `urlOrigin`, `dataOrigin`, `serpUrl`, `query`, `position`, `scrapedAt` |

Not every field is present on every record: a post found through a hashtag or keyword search only has what the Google Images result shows (URL and caption start), while a post looked up by its URL may also show author, counts and date when Google's result text contains them. Counts that Google abbreviates (`17M`, `1.8K+`) are marked with `countsRounded: true`.

Example profile record:

```json
{
  "recordType": "profile",
  "username": "natgeo",
  "profileUrl": "https://www.instagram.com/natgeo/",
  "fullName": "National Geographic",
  "followersText": "268M",
  "followersCount": 268000000,
  "countsRounded": true,
  "followingText": "196",
  "followingCount": 196,
  "postsText": "32164",
  "postsCount": 32164,
  "resultTitle": "National Geographic (@natgeo) - Instagram",
  "sourceUrl": "https://www.instagram.com/natgeo/",
  "urlOrigin": "google-result-link",
  "dataOrigin": "google-serp",
  "serpUrl": "https://www.google.com/search?q=site%3Ainstagram.com%20intitle%3A%22%28%40natgeo%29%22&hl=en&gl=us&start=0&nfpr=1",
  "query": "site:instagram.com intitle:\"(@natgeo)\"",
  "position": 1,
  "scrapedAt": "2026-11-13T14:00:22.625Z"
}
```

#### What you do not get

**Comments**, place (location) pages, audio pages, stories, tagged and reposted feeds, carousels, media files (images, videos, thumbnails), view and play counts, locations, join dates and follower lists are not available from Google results, so they are not returned. Place, audio and story URLs are skipped and listed in the `RUN_SUMMARY` record of the key-value store.

#### Limits to know about

- Google has to show a result for the profile or post. Small, new or recently renamed accounts and posts may not appear; such entries are reported in `RUN_SUMMARY`. The run fails if nothing at all is found, and the Actor stops instead of retrying if Google refuses a request.
- Google shows only the first words of a caption, so hashtag lookups return only the posts whose visible caption contains the hashtag by default (`onlyCaptionsWithHashtag`). These are the posts **Google** lists for a hashtag or keyword; it is not Instagram's own feed, it is not complete and not sorted by date.
- Values come from Google's copy of the page, so they can be days or weeks old.
- Google Search pages are fetched through the `GOOGLE_SERP` proxy group, which must be available on your Apify plan. A profile takes one to four Google requests, a post one, a hashtag or keyword one (billed as proxy usage). A profile whose Google result shows no follower, following or post count is reported as not found.

#### How to use it

1. Open the **Input** tab and add Instagram URLs (profile, post, reel or hashtag), `@usernames`, `#hashtags` and/or keywords.
2. Keep the **Proxy configuration** on `GOOGLE_SERP`.
3. Click **Start** and download the dataset as JSON, CSV or Excel, or read it through the API.

#### Input

| Field | Description |
| --- | --- |
| `startUrls` | Profile, post, reel and hashtag URLs (also `@usernames` and `#hashtags`) |
| `searchQueries` | Keywords to search among public posts, reels and profiles |
| `maxItems` | Maximum number of records in total (default 20, maximum 50), taken from each entry in turn |
| `onlyCaptionsWithHashtag` | For hashtags: keep only posts whose visible caption contains the hashtag (default on) |
| `requestTimeoutSecs` | Timeout of one Google Search request |
| `proxyConfiguration` | Apify Proxy settings; the `GOOGLE_SERP` group is required |

#### Responsible use

The data is public information shown by Google. You are responsible for using it in line with Instagram's and Google's terms and with the privacy rules that apply to personal data in your country.

# Changelog

This Actor's version history is a separate document: https://apify.com/scrapeai/instagram-scraper/changelog.md

# Actor input Schema

## `startUrls` (type: `array`):

Profile URLs (https://www.instagram.com/nasa/), post or reel URLs (https://www.instagram.com/p/<shortcode>/, /reel/<shortcode>/) and hashtag URLs (https://www.instagram.com/explore/tags/travel/). @usernames and #hashtags also work. Place, audio and story URLs are not supported. If this list and the keywords are both empty, a sample profile is used.

## `searchQueries` (type: `array`):

Keywords to search for among public Instagram posts, reels and profiles, for example "street photography". Each keyword is one Google Images search restricted to instagram.com.

## `maxItems` (type: `integer`):

Maximum number of records in total. The records are taken from each URL, hashtag and keyword in turn.

## `onlyCaptionsWithHashtag` (type: `boolean`):

Google shows only the first words of a caption, so many posts it associates with a hashtag do not show the hashtag in the visible text. When on (default), hashtag lookups return only the posts whose visible caption text contains the hashtag.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for one Google Search page.

## `proxyConfiguration` (type: `object`):

Google Search pages are read through the Apify GOOGLE_SERP proxy group (requires access to that group on your Apify plan). Instagram itself is never requested.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.instagram.com/natgeo/"
    },
    {
      "url": "https://www.instagram.com/explore/tags/travel/"
    }
  ],
  "maxItems": 20,
  "onlyCaptionsWithHashtag": true,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

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

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.instagram.com/natgeo/"
        },
        {
            "url": "https://www.instagram.com/explore/tags/travel/"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "GOOGLE_SERP"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapeai/instagram-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [
        { "url": "https://www.instagram.com/natgeo/" },
        { "url": "https://www.instagram.com/explore/tags/travel/" },
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["GOOGLE_SERP"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapeai/instagram-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www.instagram.com/natgeo/"
    },
    {
      "url": "https://www.instagram.com/explore/tags/travel/"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "GOOGLE_SERP"
    ]
  }
}' |
apify call scrapeai/instagram-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapeai/instagram-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AdfRNTVhS0fNkEbqO/builds/9PGE4ZHkBXhJsSFag/openapi.json
