# Instagram Followers & Following — Real Lists, Not Counts (`themineworks/instagram-followers-scraper`) Actor

Export any Instagram account's followers or following list to structured JSON/CSV: username, name, ID, verified & private flags, profile link. Instagram gates these lists behind login, so this actor uses YOUR OWN session cookie (never ours) to paginate safely. MCP-ready.

- **URL**: https://apify.com/themineworks/instagram-followers-scraper.md
- **Developed by:** [The Mine Works](https://apify.com/themineworks) (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 $0.72 / 1,000 follow relation scrapeds

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/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 Followers & Following Scraper — Login Required

### Overview

This actor exports the **followers list** or **following list** of any Instagram account into clean, structured JSON/CSV rows: username, display name, internal user ID, verified flag, private flag, and profile picture URL. Give it one username or a batch, pick Followers / Following / Both, and it paginates through the list automatically.

**Read this before you run it.** Instagram does not expose these lists publicly. This is a different, harder wall than the one our [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper) clears — that actor reads follower/following **counts** from a public JSON endpoint with zero authentication, verified live with a plain unauthenticated request returning a clean `200`. The **lists themselves** live behind `friendships/{id}/followers` and `friendships/{id}/following` endpoints that returned, on the exact same kind of unauthenticated request in our own testing, a consistent `HTTP 401` with the body `{"require_login":true}`. That is Instagram's own application-level login wall, not an IP block or a rate limit — no proxy, no header trick, and no amount of retrying gets past it. Any tool claiming to export real follower/following lists **with zero login, at scale, on demand** is either using a hidden authenticated session it isn't telling you about, or it isn't really delivering what it claims.

So this actor asks for the one thing that actually works: **your own Instagram session cookie**, supplied as input to a run you control. This is the same pattern already used elsewhere in our catalog (our X/Twitter scraper's optional `authToken` field) — it is a normal, disclosed way to reach data that requires being logged in, without us ever holding, sharing, or reusing your credentials across runs or customers.

✅ Real followers/following lists, not just counts | ✅ Pagination handled for you | ✅ Pay only for rows delivered | ✅ MCP-ready for AI agents

### What you need before you run this

1. **An Instagram account** you're comfortable using for this — ideally a secondary/throwaway account, not your primary one. Pulling large follower/following lists is exactly the kind of bulk activity Instagram's own risk systems watch for, and doing it can lead to a rate limit, a security checkpoint, or a temporary block **on the account whose session you use** — this is a real risk under Instagram's Terms of Use, not a hypothetical.
2. **That account's `sessionid` cookie.** Log into instagram.com in a normal desktop browser, open DevTools → Application (Chrome) or Storage (Firefox) → Cookies → `https://www.instagram.com`, and copy the value of the `sessionid` cookie. Paste it into the `sessionid` input field (marked secret — it is never logged or displayed).
3. Optionally, the same session's `csrftoken` cookie value — not required for the read-only calls this actor makes, but it's the closest match to genuine browser traffic if you want to supply it.

If you run this actor **without** a `sessionid`, it will not invent data. It pushes one clear, non-billed row explaining the requirement and exits — you can verify this yourself before spending anything.

### How it works

For each target username, the actor first resolves the username to Instagram's internal numeric user ID using the same public, no-login endpoint the profile scraper uses. It then uses **your** session cookie to call the authenticated followers/following endpoint directly, paginating with Instagram's own cursor (`next_max_id`) until it hits your requested cap, the run's safety cap, or the end of the list.

Unlike a no-login scraper that benefits from spreading requests across many exit IPs, this actor pins **one single proxy session for the whole run**. Bouncing one authenticated session across many countries' worth of IPs inside a few minutes is a strong account-takeover signal to Instagram — using one stable IP for the whole run looks like what it actually is: one person, logged in, browsing.

If Instagram rejects the session (expired cookie, checkpoint, or challenge required), the actor detects the exact rejection signature, stops the **entire run** immediately, and tells you plainly that a fresh IP will not fix it — only a fresh valid `sessionid` will. Rows already delivered before that point are unaffected and already yours.

### 🧾 Input configuration

```json
{
  "usernames": ["nasa"],
  "mode": "followers",
  "sessionid": "71234567%3AAbCdEfGhIjKlMnOpQrStUvWx%3A25%3AAYc...",
  "maxPerUsername": 200,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

| Field | Description |
| --- | --- |
| `usernames` | Target account(s) to pull followers/following for |
| `username` | Convenience single-target field |
| `mode` | `followers`, `following`, or `both` |
| `sessionid` | **Required for real data.** Your logged-in Instagram session cookie |
| `csrftoken` | Optional — your session's csrftoken cookie |
| `maxPerUsername` | Stop after this many rows per target/relation (hard-capped at 5000) |
| `startCursor` | Advanced: resume a capped single-target run from its saved cursor |
| `proxyConfiguration` | Residential proxy, one fixed session per run |

### 📤 Output format

```json
{
  "relation": "followers",
  "target_username": "nasa",
  "target_user_id": "528817151",
  "user_id": "44196397",
  "username": "spacex_fan_2026",
  "full_name": "Space Enthusiast",
  "is_private": false,
  "is_verified": false,
  "profile_pic_url": "https://scontent.cdninstagram.com/...",
  "profile_url": "https://www.instagram.com/spacex_fan_2026/",
  "source": "authenticated-api",
  "scraped_at": "2026-08-02T10:15:00.000Z"
}
```

Every run also ends with one `_type: "summary"` row (never billed) recording how many targets were requested, how many rows were delivered and charged, and whether the run stopped early because Instagram rejected the session.

### 💼 Common use cases

**Audience & competitor analysis** — pull a competitor's or your own follower list to see who's actually engaged, cross-reference verified/business accounts, and track growth over time on a schedule.

**Influencer & creator discovery** — export the following list of a known tastemaker account to find adjacent creators worth reaching out to.

**Lead enrichment** — turn a brand's follower list into a contactable roster for outreach, combined with our [Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper) for bio/website enrichment on each handle.

**List-building for paid social** — export followers of relevant accounts as a seed list for lookalike/custom audience building.

### 🚀 Getting started

1. Log into the Instagram account you're going to use, and copy its `sessionid` cookie (see "What you need" above).
2. Open the actor on Apify, paste the target username(s) and your `sessionid`.
3. Pick `followers`, `following`, or `both`, and set a sensible `maxPerUsername` for a first test run (start small — 50 to 100 — before pulling thousands).
4. Click Save & Start, then export the dataset as JSON, CSV, or Excel, or pull it via the Apify API or MCP.

### FAQ

**Do I really need to log in? Can't this just work like the profile scraper?**
No — and we're not going to pretend otherwise. We tested Instagram's followers/following endpoints directly: the exact same unauthenticated request that returns full profile data from the public endpoint returns `401 {"require_login":true}` from the followers/following endpoints. That is Instagram's own login gate.

**Is it safe to use my main Instagram account's session?**
It carries real risk — rate limits, a security checkpoint, or a temporary block are all things Instagram can do to an account pulling large lists quickly. We strongly recommend a secondary account and a conservative `maxPerUsername` on your first runs.

**Do you store or see my sessionid?**
No. It is passed straight through to Instagram's own API for the calls this run makes and is never logged, persisted, or reused for another run or another customer. Apify's platform still stores your run's input (marked as a secret field) under your own account's normal data retention.

**Why did my run stop with `auth_required` partway through?**
Either the session cookie expired mid-run, or Instagram put up a security checkpoint on that account. This is a credential problem, not a proxy problem — get a fresh `sessionid` and start a new run; rows already delivered are unaffected.

**How am I charged?**
Pay per row. You are billed only for followers/following rows actually written to the dataset. A missing session, a not-found username, a private target you can't see, or a network failure is never charged.

**Can I use it inside an AI agent?**
Yes — it's exposed as an MCP tool. See below.

### Use in Claude, ChatGPT & any MCP agent

```
https://mcp.apify.com/?tools=themineworks/instagram-followers-scraper
```

Or call it programmatically with the Apify client:

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

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('themineworks/instagram-followers-scraper').call({
  usernames: ['nasa'],
  mode: 'followers',
  sessionid: 'YOUR_OWN_IG_SESSIONID',
  maxPerUsername: 200,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### 🛠️ Complete your Instagram intelligence pipeline

- **[Instagram Profile Scraper](https://apify.com/themineworks/instagram-profile-scraper)**: bio, counts, verified/business flags — no login required.
- **[Threads Scraper](https://apify.com/themineworks/threads-scraper)**: posts, profiles, hashtags, and search on Meta Threads.
- **[Twitter / X Scraper](https://apify.com/themineworks/twitter-x-scraper)**: tweets by keyword or handle.

Typical flow: this actor builds the raw follower/following roster, then the profile scraper enriches each handle with bio and website data.

Questions or need a custom field set? Reach out through the Apify profile.

# Actor input Schema

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

Instagram usernames (without the @) whose followers/following you want to export. Full profile URLs also work. Each is scraped independently.

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

Convenience field for one target. If set, it is added to Target usernames above.

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

Followers = accounts that follow the target. Following = accounts the target follows. Both = one run for each, tagged by the relation field.

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

REQUIRED to get any followers/following data. Instagram only serves these lists to a logged-in session — there is no public, no-login route to them (unlike our Instagram Profile Scraper, which needs no login). Log into instagram.com in a normal browser, open DevTools → Application/Storage → Cookies → instagram.com, and copy the value of the 'sessionid' cookie. It is used ONLY for the API calls this run makes and is never logged, stored, or sent anywhere else. Use a secondary/throwaway Instagram account if possible — bulk pagination on a real session carries real account risk (rate-limit, checkpoint, or temporary block) per Instagram's Terms of Use. Leave blank to see exactly how the actor behaves without one (it will explain the requirement and exit cleanly with zero charge, not fabricate data).

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

Optional. The 'csrftoken' cookie value from the same browser session as your sessionid. Not required for the read-only calls this actor makes, but supplying the real value from your session is the safest match to genuine browser traffic. If left blank, a syntactically valid placeholder is generated for you.

## `maxPerUsername` (type: `integer`):

Stop paginating a given username/relation after this many rows. Hard-capped at 5000 regardless of what you enter here, as a cost/safety ceiling.

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

Advanced / single-target runs only. If a previous run stopped early (cap reached) it prints a 'next\_cursor' value in its final summary row — paste it here to continue from that point instead of the beginning. Ignored when more than one target username is supplied.

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

Residential proxy is required — Instagram blocks most datacenter ranges outright, authenticated session or not. The whole run reuses ONE fixed proxy session (not a fresh IP per request) so your login looks like a single consistent client to Instagram, not an account being accessed from many countries at once. Leave as default.

## Actor input object example

```json
{
  "usernames": [
    "nasa"
  ],
  "mode": "followers",
  "maxPerUsername": 200,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (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 = {
    "usernames": [
        "nasa"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("themineworks/instagram-followers-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": ["nasa"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    "nasa"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call themineworks/instagram-followers-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=themineworks/instagram-followers-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ZiEobaPZMWlJCnW57/builds/lsqYg5NdJTGIXteZd/openapi.json
