# Instagram Profile Scraper (`opspilot.cc/instagram-profile-scraper`) Actor

📸 Instagram Profile Scraper | Followers, posts and bio for any list of handles Paste usernames, @handles or profile URLs and get one clean row per profile: followers, following, post count, verified flag, private flag, bio, contact link, profile picture and engagement-per-post (posts ÷ followers).

- **URL**: https://apify.com/opspilot.cc/instagram-profile-scraper.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 📸 Instagram Profile Scraper

> Followers, posts, bio and contact link for any list of handles — one clean row per profile. No login, no cookies.

### ✨ What you get

One dataset row per profile:

| Field | What it is |
|---|---|
| `username` / `fullName` / `userId` | identity, plus the numeric id you need for other Instagram APIs |
| `followers` / `following` | taken from Instagram's own `edge_followed_by` / `edge_follow` counters |
| `posts` + `postsCountReliable` | post count **and a flag saying whether Instagram actually reported it** (see limits) |
| `postsPer10kFollowers` | content cadence per 10k followers — the number you actually compare accounts by |
| `isVerified` / `isPrivate` / `hasClips` | vetting flags |
| `bio` / `bioLink` / `externalUrl` | biography plus the real contact link (Instagram's `l.instagram.com` wrapper is unwrapped) |
| `profilePicUrl` / `category` | avatar and category label |
| `requestedUsername` | what you typed, so URL inputs stay traceable |

The run summary reports how many were collected, how many were not found, median followers, how many are verified, request counts and warnings.

### 💼 Use cases

- **Building a shortlist without opening 200 tabs** — up to 200 handles or profile URLs per run, one row each, ready for CSV or Sheets. Handles, `@handles` and full profile URLs all work, so a list copied from anywhere in the docs can go in unchanged.
- **Comparing accounts on cadence, not vanity size** — `postsPer10kFollowers` is the number that actually normalises a 268M-follower account against a 40k one. Two accounts can be the same size on paper and completely different as publishers.
- **Finding the contact link a bio hides** — `bioLink` and `externalUrl` come back with Instagram's `l.instagram.com` redirect wrapper already removed, so the pitch email or storefront link is a usable value rather than another shortened tracking URL.
- **Collecting the `userId`s you need for the next step** — the numeric id on each row is what the posts and comments legs accept, so a profile list scraped here feeds the posts Actor directly instead of requiring a second lookup by hand.

### ✅ Who this is for

- **Lead generation and outreach teams**— turning a list of 200 handles into a vetted spreadsheet with follower counts, verification flags and real bio links.
- **Agency account managers**— who need `followers`, `following` and cadence for a whole roster in one pass before a pitch.
- **Cross-border sellers**— qualifying supplier, distributor or creator accounts where the bio link is the actual business contact.
- **Analysts who will schedule it** — Instagram exposes no historical follower counts, so this Actor becomes a trend tool the moment you diff it run over run.

### ❌ Who this is NOT for

- **Private accounts** — they return no public data and are reported in `warnings` as not found. There is no partial profile and no estimate for them.
- **Trusting `posts: 0`** — Instagram is inconsistent here: the identical request returned 32,039 posts for one account in one call and 0 in the next, and the alternate endpoint returns `null`. `posts: 0` with `postsCountReliable: false` means "not reported", not "no posts". Trust the flag, and use the Instagram Posts by User Actor when you need a real count.
- **Growth curves or any historical read** — the data is live at request time and Instagram does not expose past follower counts. One run is one snapshot; schedule it and diff the dataset yourself.
- **Audience demographics, follower lists or engagement** — this returns profile-level facts about accounts. It contains no post rows and no follower rows; the posts and followers Actors in this family cover those.
- **Post URLs pasted in by mistake** — reserved paths such as `/p/ABC123/` are rejected rather than scraped as handles, because a post link is not an account. And it is Instagram only: TikTok, YouTube or Google Play accounts are different products with different data.

### 🚀 Quick start

1. Open the Actor and press **Start** (the default input scrapes three well-known accounts).
2. Paste your handles — `natgeo`, `@natgeo` and `https://www.instagram.com/natgeo/` all work.
3. Read the **Dataset** tab: one row per profile, ready for CSV/Sheets.

### 📥 Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `usernames` | list | `instagram` | Usernames, @handles or profile URLs, one per line. Up to 200 per run. |
| `maxProfiles` | number | `100` | Cap per run. A run-wide request budget (12 free / 40 paid) also caps total upstream calls; see Billing. |

### 📤 Output

- **Dataset** — one row per collected profile (or a single notice when nothing was collected)
- **SUMMARY** (key-value store) — counts, follower totals and warnings

#### Example item

```json
{
  "username": "natgeo",
  "fullName": "National Geographic",
  "userId": "787132",
  "followers": 268449045,
  "following": 194,
  "posts": 0,
  "postsCountReliable": false,
  "postsPer10kFollowers": null,
  "isVerified": true,
  "isPrivate": false,
  "bio": "Step into wonder and find your inner explorer with National Geographic.",
  "bioLink": "http://visitstore.bio/natgeo",
  "profilePicUrl": "https://…",
  "requestedUsername": "natgeo",
  "collectedAt": "2026-10-03T14:52:00.000Z"
}
```

### ⚙️ How it works

1. Each username / @handle / profile URL is normalized to a bare username (reserved paths like `/p/ABC123/` are rejected instead of being scraped as handles).
2. One Data provider call per profile returns Instagram's GraphQL user object; counts are read from the `edge_*` objects and flattened.
3. The contact link is unwrapped from `bio_links` (Instagram's redirect wrapper is removed).
4. Failures never disappear silently: private, renamed or missing accounts land in `warnings` in the summary.

### 💰 Billing

**Billed per result.** Every row written to the default dataset is one `apify-default-dataset-item` charge, on top of the one-off `actor-start` charge when the run begins. A run that returns 200 profiles costs 200 item charges; a run that returns 3 costs 3. Per-item price is on this Actor's pricing card. Rows of `type: "notice"` (a capped or empty run) are dataset rows too and are billed the same way. There is no daily run cap.

**Free plan limit.** One run resolves **20 profiles**. That is a hard ceiling on the upstream cost, so it cannot be raised from the input form. A capped run still succeeds: it writes a `notice` row to the dataset, sets `appliedLimits.capped: true` in `SUMMARY`, and logs why. Any paid Apify plan lifts the cap to the full 200 profiles.

**Run-wide request budget.** On top of the per-item caps, every run has a fixed ceiling on upstream requests in total — **12 on the free plan, 40 on paid Apify plans** — shared by all accounts, keywords, hashtags or posts in that run, and counting retries. A single item can still walk all of its pages; only wide multi-item runs are compressed. Hitting the ceiling is reported, not hidden: the run still succeeds, delivers everything fetched so far, writes a `type: "notice"` row, and sets `SUMMARY.budgetExhausted: true` alongside `SUMMARY.maxRequestsPerRun` and `SUMMARY.upstreamRequests`.

The per-item figures above are upper bounds, not a promise for every run: when a run supplies the maximum number of items, the shared budget is reached first and fewer items are completed. `SUMMARY.upstreamRequests` reports exactly how many upstream requests were used.

### ❓ FAQ

**Why is `posts` sometimes 0?**
Instagram is inconsistent on this endpoint: the identical request returned 32,039 posts for the same account in one call and 0 in the next, and the alternate profile endpoint returns a null post count. When that happens `postsCountReliable` is `false` — trust the flag, and use **Instagram Posts by User** when you need the real number (it counts real rows).

**Does it work on private accounts?**
No. Private profiles return no public data; they are reported in `warnings` as not found.

**Can I use the `userId` elsewhere?**
Yes — that numeric id is what the posts and comments legs expect, so you can chain this Actor with the posts/comments Actors in one workflow.

**How fresh is the data?**
It is live at request time. Instagram does not expose historical follower counts, so this Actor cannot show growth over time — schedule it and diff the dataset yourself if you need trends.

### 📚 Resources

- Instagram public profile endpoints (no login required)
- Apify free plan: monthly credit covers usage, no separate daily cap

# Changelog

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

# Actor input Schema

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

Accepts natgeo, @natgeo or https://www.instagram.com/natgeo/ — one per line, up to 200 per run.

## `maxProfiles` (type: `integer`):

Cap on profiles to collect in this run. Each profile is one upstream call ($0.001).

## Actor input object example

```json
{
  "usernames": [
    "instagram"
  ],
  "maxProfiles": 100
}
```

# Actor output Schema

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

One row per collected profile, or a single notice when nothing was collected.

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

Counts, follower totals, not-found list length, upstream calls, estimated cost and warnings.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("opspilot.cc/instagram-profile-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("opspilot.cc/instagram-profile-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 '{}' |
apify call opspilot.cc/instagram-profile-scraper --silent --output-dataset

```

## MCP server setup

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