# Instagram Followers & Followings Scraper (`thenetaji/instagram-followers-followings-scraper`) Actor

Scrape both followers and followings of Instagram users in a single run

- **URL**: https://apify.com/thenetaji/instagram-followers-followings-scraper.md
- **Developed by:** [The Netaji](https://apify.com/thenetaji) (community)
- **Categories:** Social media, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 1,790 total users, 175 monthly users, 100.0% runs succeeded, 25 bookmarks
- **User rating**: 4.13 out of 5 stars

## Pricing

from $0.75 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Followers & Followings Scraper

The Actor collects the accounts that follow a public Instagram account, or the accounts it follows, and returns them as structured records. One field selects the direction, pagination is handled internally, and each account can optionally be enriched with its full profile.

### Accepted input

| Field | Type | Default | Description |
|---|---|---|---|
| `username` | array of strings | — | Required. Usernames or profile URLs. |
| `type` | enum | `followers` | Required. `followers` or `followings`. |
| `maxItem` | integer | `100` | Maximum accounts saved per seed. `0` removes the limit. |
| `enrichProfile` | boolean | `false` | Fetches the full profile for every account returned. |
| `fullProfileDetails` | boolean | `false` | Extends enrichment to the complete profile payload. |
| `resumeCursor` | string | — | Continues a previous run from where it stopped. |

```json
{
  "username": ["nasa"],
  "type": "followers",
  "maxItem": 500,
  "enrichProfile": false
}
```

`maxItem` applies to each account in `username` independently rather than as a shared total. Three usernames with `maxItem` at 500 can therefore return up to 1,500 records.

### Response fields

One record per account.

| Field | Contents |
|---|---|
| `username` | Account's username |
| `full_name` | Display name |
| `id` | Instagram user ID |
| `is_private` | Whether the account is private |
| `is_verified` | Whether the account is verified |
| `profile_pic_url` | Profile image URL |
| `source_username` | The account whose list this one came from |
| `enriched` | Whether the full profile was fetched |

```json
{
  "username": "esa",
  "full_name": "European Space Agency",
  "is_verified": true,
  "is_private": false,
  "source_username": "nasa",
  "enriched": false
}
```

`source_username` matters when several seeds are supplied in one run, since the lists are written to a single dataset and would otherwise be indistinguishable.

### Resuming an interrupted run

The two directions paginate differently upstream — followers advance through an end cursor, followings through a max ID — and both are normalised to the same flat output here.

`resumeCursor` accepts a cursor from a previous run and applies it to the **first** username's first page only. It exists to continue a single interrupted stream, not to offset a multi-account run; supplying it alongside several usernames affects only the first, and the rest start from the beginning.

### Behaviour on partial results

Collection ends when the upstream reports no further pages, returns an empty page, or `maxItem` is reached.

Enrichment is applied in batches as pages arrive, so records are written progressively rather than after the whole list is gathered. A profile that fails to enrich is skipped rather than aborting the run.

### Frequently asked questions

**Can the followers of a private account be collected?**
No. Only public accounts expose these lists. A private account returns nothing regardless of the direction requested — this reads Instagram's public surface with no logged-in session, and a private account has no such surface.

**Why did a large account return fewer followers than it has?**
Instagram serves these lists in bounded pages and stops well short of a complete roster for accounts with large followings. An account with several million followers will not return several million records. What comes back is a substantial sample in Instagram's own ordering, not a census.

**What is the difference between `followers` and `followings`?**
`followers` returns accounts following the seed; `followings` returns accounts the seed follows. The second is usually far smaller and often more informative, since who an account chooses to follow is deliberate in a way its followers are not.

**Does `maxItem` limit the run or each account?**
Each account. It is a per-seed cap rather than a shared total, so the maximum records a run can produce is `maxItem` multiplied by the number of usernames.

**What does `enrichProfile` cost?**
One additional request and one additional billed event per account returned. On a 1,000-follower run that is 1,000 extra requests, which usually dominates the cost. Collecting the list first and enriching a chosen subset afterwards through [Instagram User Info Scraper](https://apify.com/thenetaji/instagram-user-info-scraper) is generally cheaper.

**How is `resumeCursor` obtained?**
Every run publishes it twice: as `resumeCursor` in the `OUTPUT` record of the run's key-value store, and in the log next to `📍 RESUME CURSOR`. Paste it into the next run. A run that reached the end of the list publishes `null`, which is how you know to stop.

**Does paging with `maxItem` skip accounts?**
No. The cursor names the position the run actually stopped at, including a position part-way through an Instagram page, so `maxItem: 10` repeated with the cursor each time walks the list in tens with no gaps and no repeats. Resuming into the middle of a page re-fetches that page once; the accounts already returned are dropped before enrichment, so nothing is charged for them twice.

### Related Actors

| Actor | Purpose |
|---|---|
| [Instagram User Info Scraper](https://apify.com/thenetaji/instagram-user-info-scraper) | Full profile details for accounts already collected |
| [Instagram Related Users Scraper](https://apify.com/thenetaji/instagram-related-user-scraper) | Accounts Instagram suggests alongside a seed |
| [Instagram Profile Content Scraper](https://apify.com/thenetaji/instagram-profile-content-scraper) | Posts, reels, and story status for an account |
| [Instagram Post Scraper](https://apify.com/thenetaji/instagram-post-scraper) | Individual posts, comments, or oEmbed metadata |

# Actor input Schema

## `username` (type: `array`):

Instagram usernames to scrape

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

Choose whether to scrape followers or followings

## `enrichProfile` (type: `boolean`):

Fetch full profile details for each user (slower, costs more)

## `fullProfileDetails` (type: `boolean`):

Off by default, which returns follower/following counts, biography, bio links and core identity — the fields most runs need, at a fraction of the cost. Turn on to also collect post previews, media count, business category and contact fields. Note that Instagram's full-profile source is currently broken for a sizeable minority of accounts; for those, turning this on costs more and still returns the reduced set.

## `maxItem` (type: `integer`):

Maximum number of items to scrape (0 = unlimited)

## `resumeCursor` (type: `string`):

Optional. If an earlier run of this Actor stopped partway through, paste the code it finished with here to carry on from the next account instead of starting over. Every run publishes it as `resumeCursor` in the OUTPUT record of its key-value store, and logs it next to '📍 RESUME CURSOR'. A run that reached the end of the list publishes nothing, because there is nothing left to collect.

## Actor input object example

```json
{
  "username": [
    "natgeo"
  ],
  "type": "followers",
  "enrichProfile": false,
  "fullProfileDetails": false,
  "maxItem": 100
}
```

# Actor output Schema

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

All records scraped by this run

# 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 = {
    "username": [
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thenetaji/instagram-followers-followings-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 = { "username": ["natgeo"] }

# Run the Actor and wait for it to finish
run = client.actor("thenetaji/instagram-followers-followings-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 '{
  "username": [
    "natgeo"
  ]
}' |
apify call thenetaji/instagram-followers-followings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thenetaji/instagram-followers-followings-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/asIjo32NQuUHP4Fnc/builds/9kWDZbZB7mQcmwPWk/openapi.json
