# Instagram Profile Stats Scraper (`khadinakbar/instagram-profile-stats-scraper`) Actor

Bulk-scrape public Instagram follower, following, and post counts from usernames, @handles, or profile URLs. One dataset row per profile with verified and private flags. Cookieless and MCP-ready.

- **URL**: https://apify.com/khadinakbar/instagram-profile-stats-scraper.md
- **Developed by:** [Khadin Akbar](https://apify.com/khadinakbar) (community)
- **Categories:** Social media, Lead generation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 profile stats scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Instagram Profile Stats Scraper

Pass a bulk list of Instagram usernames, `@handles`, or profile URLs and receive **one dataset row per profile** with **follower count**, **following count**, **post count**, verification, privacy, display name, and a canonical `profileUrl`. Built for influencer-marketing teams, growth operators, and MCP agents that need a cheap, cookieless stats lookup before they enrich a full profile.

This Actor reads public Instagram profile metadata through the official web profile endpoint on [instagram.com](https://www.instagram.com), with Apify Residential proxies, scheduling, and dataset export (JSON, CSV, Excel, HTML).

### Best fit for this Actor

- You already have a roster of creator or brand handles and want **follower / following / post counts** in one export.
- You want a **bounded, per-profile bill** for a stats-only job, then you can enrich a shortlist later.
- You accept public Instagram profile data, including private accounts that still publish a public follower total.
- For bios, emails, phones, and recent posts, continue with [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper). For the posts themselves, then use [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper).

### Use case: weekly creator roster

An influencer-ops manager keeps a spreadsheet of 80 fashion creators. They paste the handles, including a few `@` prefixes and full `instagram.com` URLs. The run returns `followersCount`, `postsCount`, and `isVerified` for each row. They sort by followers, keep accounts above their campaign floor, and pass the surviving usernames into Instagram Profile Scraper when they need bio links and contact fields.

### Quick start input

```json
{
  "usernames": ["natgeo", "@nasa", "https://www.instagram.com/instagram/"],
  "deduplicate": true,
  "maxItems": 500
}
```

Each value in `usernames` is one lookup. Bare handles, `@handles`, and profile URLs all normalize to the same username. `deduplicate` keeps a repeated handle as a single request. `maxItems` is the run-wide safety cap after that list is read.

### Input reference

| Field | Type | What it controls |
|---|---|---|
| `usernames` | array of strings | Required. Instagram usernames, `@handles`, or profile URLs. Prefill uses `natgeo`, `@nasa`, and the official Instagram URL. |
| `deduplicate` | boolean | Default `true`. Collapses repeated handles to one request. |
| `maxItems` | integer | Default `500`, minimum `1`. Caps how many input rows are processed. |
| `maxRequestRetries` | integer | Default `2`, range `0–10`. Extra attempts on a transient Instagram response. |
| `requestTimeoutSecs` | integer | Default `30`, range `10–120`. Seconds allowed for one profile request. |

Open the **Input** tab in Console for the live form. Empty or malformed tokens still write a row so the export stays aligned with the list you submitted.

### What data you receive

One dataset item is one profile-stats attempt: a successful public stats record, an empty public payload, or an input-format row. Download the dataset as JSON, CSV, Excel, or HTML from the run Output tab.

| Field | Type | Meaning |
|---|---|---|
| `input` | string | The exact token you submitted. |
| `username` | string | Normalized Instagram handle. |
| `profileUrl` | string | Canonical `https://www.instagram.com/{username}/` URL. |
| `followersCount` | integer | Public follower total. |
| `followingCount` | integer | Public following total. |
| `postsCount` | integer | Public post total. |
| `isPrivate` | boolean | Private account flag when Instagram publishes it. |
| `isVerified` | boolean | Verified-badge flag. |
| `fullName` | string | Display name. |
| `source` | string | Provenance. Native public web profile metadata. |
| `status` | string | Row outcome: `OK`, `VALID_EMPTY`, `INVALID_INPUT`, or `UPSTREAM_FAILED`. |
| `statusMessage` | string | Short human-readable detail. |
| `scrapedAt` | string | ISO 8601 collection time. |

```json
{
  "input": "https://www.instagram.com/nasa/",
  "username": "nasa",
  "profileUrl": "https://www.instagram.com/nasa/",
  "followersCount": 104403992,
  "followingCount": 92,
  "postsCount": 4883,
  "isPrivate": false,
  "isVerified": true,
  "fullName": "NASA",
  "source": "native",
  "status": "OK",
  "statusMessage": "Profile stats scraped successfully.",
  "scrapedAt": "2026-08-18T09:16:23.629Z"
}
```

`status` values:

| Value | Meaning |
|---|---|
| `OK` | Public stats were written. This is the billed primary event. |
| `VALID_EMPTY` | The handle was processed and Instagram returned no public user payload. |
| `INVALID_INPUT` | The token is outside accepted username / `@handle` / profile-URL formats. |
| `UPSTREAM_FAILED` | Retries finished without a usable public payload. |

### Real-world use cases

#### 1. Bare usernames

```json
{
  "usernames": ["nasa", "natgeo"],
  "deduplicate": true
}
```

#### 2. Mixed handles and profile URLs

```json
{
  "usernames": ["@instagram", "https://www.instagram.com/nasa/"],
  "deduplicate": true,
  "maxItems": 50
}
```

#### 3. Deduped campaign list

```json
{
  "usernames": ["natgeo", "natgeo", "@natgeo"],
  "deduplicate": true
}
```

Three copies of the same creator become one request and one stats row.

#### 4. Bounded sample for an agent

```json
{
  "usernames": ["nasa", "natgeo", "instagram"],
  "maxItems": 3,
  "maxRequestRetries": 2,
  "requestTimeoutSecs": 30
}
```

### Why agents choose this Actor

- One input field (`usernames`) accepts handles, `@` prefixes, and profile URLs.
- One row per submitted token (or per unique handle when `deduplicate` is on), so batch exports stay complete.
- Flat keys (`followersCount`, `followingCount`, `postsCount`, `profileUrl`) are spreadsheet- and tool-call friendly.
- Provenance is explicit: `source` plus ISO `scrapedAt`.
- `status` is stable enough to branch on: keep `OK` rows, review `VALID_EMPTY`, fix `INVALID_INPUT`.
- Cost is scoped to successful stats rows. Set `maxItems` to the budget you can spend.
- When you need emails and recent posts, continue with [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper) after this stats lookup.

### Agent checklist

1. Pass usernames, `@handles`, or `https://www.instagram.com/{user}/` URLs in `usernames`.
2. Set `maxItems` to the number of lookups you want billed at the live `profile-stats-scraped` price.
3. Leave `deduplicate` on when the same creator appears more than once.
4. After the run, read the default dataset. Keep rows where `status` is `OK`.
5. Preserve `profileUrl` as the public source link in any summary.
6. When you need bio, email, or recent posts, continue with Instagram Profile Scraper using the same `username` values.

### Use through the API

```bash
curl "https://api.apify.com/v2/acts/khadinakbar~instagram-profile-stats-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "usernames": ["nasa", "@natgeo"],
    "deduplicate": true,
    "maxItems": 50
  }'
```

When the Actor completes, read dataset items from the default dataset. You can download JSON, CSV, Excel, or HTML from the run Output tab or the Dataset API.

### Use with AI agents through Apify MCP

> Get Instagram follower, following, and post counts for nasa, natgeo, and https://www.instagram.com/instagram/. Return username, followersCount, followingCount, postsCount, isVerified, isPrivate, profileUrl, and status. Deduplicate handles. Then read the dataset and keep profileUrl as the source link.

Connect through <https://mcp.apify.com>. After the tool call, read the dataset, check each row `status`, and keep `maxItems` inside your cost scope.

### Pricing

This Actor uses Pay per event (PPE) plus platform usage. Open the live Pricing tab for current event details, and use Apify's run cost controls to keep the workflow aligned with your budget.

Worked examples at the launch prices (`apify-actor-start` plus primary event `profile-stats-scraped`):

| Input | Rows billed | What happens |
|---|---|---|
| One valid public profile | 1 primary event | Stats row with `status: OK` |
| Three unique public profiles | 3 primary events | Three billed stats rows |
| Repeated handles with dedupe on | 1 primary event | One request, one billed row |
| Malformed token only | 0 primary events | `INVALID_INPUT` row, start event plus platform usage |
| Public handle with empty payload | 0 primary events | `VALID_EMPTY` row, start event plus platform usage |

Formula: `OK row count × profile-stats-scraped + start event + platform usage`. Platform usage (compute, residential proxy transfer, storage) is billed to the user on top of events.

### Connect the workflow

- Start with this Actor to rank a handle list by `followersCount` and `postsCount`.
- Continue with [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper) when the shortlist needs bio, email, phone, and recent posts.
- Then use [Instagram Posts Scraper](https://apify.com/khadinakbar/instagram-posts-scraper) to pull content from the same public usernames.

### Best results

- Prefer canonical profile URLs or exact handles. Stories, reels, and `/p/` post paths are outside the username contract and write `INVALID_INPUT` rows.
- Keep `deduplicate` on for CRM exports that repeat the same creator.
- Set `maxItems` to the campaign size you actually need; the cap is the cheapest way to bound a bulk run.
- Treat `scrapedAt` as collection time. Schedule a weekly run on the same `usernames` list when you are watching growth.
- Private accounts can still return public follower totals with `isPrivate: true`. Pair that flag with your outreach rules.

### Builder's note

I built this as a stats-only sibling of the full Instagram profile Actor after watching teams pay for bios and recent posts when they only needed follower totals to rank a roster. I found Instagram's public `web_profile_info` JSON already carries `edge_followed_by`, `edge_follow`, and `edge_owner_to_timeline_media` counts, so an HTTP lookup through residential proxies is enough. In my testing, accepting `@handles` and full profile URLs in the same `usernames` array cut the most common agent mistakes. My goal was a complete batch export: every submitted token still appears as a row, and only `OK` stats rows are billed.

### FAQ

**Does this return emails or recent posts?**
This Actor is a stats lookup. When you need emails and recent posts, continue with [Instagram Profile Scraper](https://apify.com/khadinakbar/instagram-profile-scraper).

**Do I need an Instagram login or cookies?**
No. It reads public profile metadata. You never paste a session cookie.

**What happens to a typo or a missing account?**
The run still finishes. A typo writes `INVALID_INPUT`. A processed handle with no public user object writes `VALID_EMPTY`. Those rows are present in the dataset and are outside the primary event.

**Can an AI agent use this?**
Yes. It is MCP-ready: pass handles or profile URLs, read one row per profile, and inspect `status` before summarizing.

**How fresh are the counts?**
Each row's `scrapedAt` is the collection timestamp for that run. Schedule repeats on the same list for a growth series.

### Responsible use

Use this Actor on public Instagram profile metadata you are authorized to collect. Keep request volume courteous, treat follower totals as public research data, and follow Instagram's terms of service plus applicable laws (including GDPR/CCPA where they apply). Instagram and Meta are trademarks of their respective owners.

# Actor input Schema

## `usernames` (type: `array`):

Look up public Instagram stats for these profiles. Accepts bare usernames (natgeo), @handles (@nasa), or full profile URLs (https://www.instagram.com/instagram/). Each value becomes one dataset row.

## `deduplicate` (type: `boolean`):

Collapse repeated handles to a single request after normalization. Keep this on for CRM lists that repeat the same creator.

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

Process at most this many input tokens, in list order, before stopping. Use it as the run-wide cost ceiling for a bulk roster.

## `maxRequestRetries` (type: `integer`):

Extra attempts per profile when Instagram returns a transient empty or challenge response. Default 2 keeps bulk runs moving.

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

Seconds allowed for one profile stats request before the next retry. Default 30 is enough for the public web profile endpoint.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "@nasa",
    "https://www.instagram.com/instagram/"
  ],
  "deduplicate": true,
  "maxItems": 500,
  "maxRequestRetries": 2,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items with username, profileUrl, followersCount, followingCount, postsCount, isVerified, isPrivate, status, and scrapedAt.

# 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 = {
    "usernames": [
        "natgeo",
        "@nasa",
        "https://www.instagram.com/instagram/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("khadinakbar/instagram-profile-stats-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 = { "usernames": [
        "natgeo",
        "@nasa",
        "https://www.instagram.com/instagram/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("khadinakbar/instagram-profile-stats-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 '{
  "usernames": [
    "natgeo",
    "@nasa",
    "https://www.instagram.com/instagram/"
  ]
}' |
apify call khadinakbar/instagram-profile-stats-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,khadinakbar/instagram-profile-stats-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/N3rc0uhS4SJcNE9fb/builds/X4wJC4ij20F0d3gkw/openapi.json
