# Instagram Followers & Following Scraper (`apt_marble/instagram-followers-following-scraper`) Actor

Scrape the followers or following list of any public Instagram profile. Returns usernames, full names, profile pictures, and account status for each result.

- **URL**: https://apify.com/apt\_marble/instagram-followers-following-scraper.md
- **Developed by:** [Hamza](https://apify.com/apt_marble) (community)
- **Categories:** Social media, Lead generation, SEO tools
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

Scrape the **followers** or **following** list of any public Instagram profile. Returns usernames, full names, profile pictures, and account status for each result.

Built with residential proxy rotation and Chrome TLS fingerprint impersonation — designed to work reliably at scale.

---

### ⚠️ Authentication Required

Instagram requires a logged-in session to access followers and following lists. This scraper uses your **Instagram Session ID** — a cookie from your browser — to authenticate requests on your behalf.

> Your Session ID is stored securely by Apify and is never shared or logged.

---

### 🔑 How to Get Your Session ID

This takes about 30 seconds:

1. Open **Google Chrome** and go to [https://www.instagram.com](https://www.instagram.com)
2. Log in to your Instagram account
3. Press **F12** to open DevTools (or right-click anywhere → Inspect)
4. Click the **Application** tab at the top of DevTools
5. In the left sidebar, expand **Cookies** → click **https://www.instagram.com**
6. Find the row named **`sessionid`**
7. Copy the full value in the **Value** column
8. Paste it into the **Instagram Session ID** field in the Actor input

> **Note:** Session IDs expire periodically (usually every few weeks). If the scraper stops returning results, repeat the steps above to get a fresh one.

---

### 📥 Input

| Field | Type | Required | Description |
|---|---|---|---|
| `accounts` | List of strings | ✅ Yes | Instagram usernames to scrape (without @) |
| `type` | Select | No | `Followers` or `Following` (default: Followers) |
| `limit` | Number | No | Max results per account, up to 5,000 (default: 20) |
| `sessionId` | String | ✅ Yes | Your Instagram `sessionid` cookie value |

#### Example Input

```json
{
  "accounts": ["mrbeast", "cristiano"],
  "type": "Followers",
  "limit": 100,
  "sessionId": "your_session_id_here"
}
````

***

### 📤 Output

Each result is one follower or following record:

| Field | Type | Description |
|---|---|---|
| `instagram_id` | String | Numeric Instagram user ID |
| `username` | String | Instagram username |
| `full_name` | String | Display name |
| `is_private` | Boolean | Whether the account is private |
| `is_verified` | Boolean | Whether the account has a verified badge |
| `profile_pic_url` | String | URL of the profile picture |

#### Example Output

```json
{
  "instagram_id": "16573539386",
  "username": "example_user",
  "full_name": "Example User",
  "is_private": false,
  "is_verified": false,
  "profile_pic_url": "https://scontent.cdninstagram.com/..."
}
```

***

### ⚙️ How It Works

1. **Username resolution** — resolves each username to an internal Instagram user ID using an authenticated API call with Chrome TLS fingerprinting (`curl_cffi`) to avoid rate limiting
2. **Proxy rotation** — uses Apify's residential proxy pool, rotating IP sessions on every request
3. **Pagination** — automatically pages through results up to your specified limit
4. **Data output** — pushes each record to Apify's dataset in real time

***

### 🚫 Limitations

**Following list** ✅ — unlimited for all accounts. You can scrape as many following accounts as you want from any public profile.

**Followers list** ⚠️ — some Instagram accounts limit their followers list visibility to around 50 users. This restriction comes directly from Instagram and cannot be bypassed by the scraper.

| Access Type                  | Followers access                |
| ---------------------------- | ------------------------------- |
| Limited accounts             | ~50 results maximum             |
| Accounts without restriction | Full list, unlimited pagination |

Other limitations:

- **Public profiles only** — private accounts require the scraping account to already be a follower
- **Session expiry** — Instagram session IDs expire periodically; get a fresh one from your browser if runs start failing

***

### ❓ Troubleshooting

**"sessionId is invalid or expired"**
Your session has expired. Go back to Chrome → DevTools → Application → Cookies and copy a fresh `sessionid` value.

**"Could not resolve username"**
The username may be misspelled, the account may have been deleted, or Instagram temporarily blocked the lookup. Try again in a few minutes.

**"Profile not found"**
The account does not exist or has been deactivated.

***

### ⚖️ Legal Disclaimer

This actor is provided for legitimate research, analytics, and business intelligence purposes. Users are solely responsible for ensuring their use complies with Instagram's Terms of Service and applicable laws. The author assumes no liability for misuse.

# Actor input Schema

## `accounts` (type: `array`):

List of Instagram usernames to scrape (without the @ symbol).

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

Whether to scrape Followers or Following.

## `limit` (type: `integer`):

Maximum number of followers/following to return per account.

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

Your Instagram sessionid cookie value. Required to access followers/following lists.

How to get it:

1. Open Instagram in Chrome while logged in
2. Open DevTools → Application → Cookies → https://www.instagram.com
3. Copy the value of the cookie named sessionid
4. Paste it here.

## Actor input object example

```json
{
  "accounts": [
    "mrbeast",
    "cristiano"
  ],
  "type": "Followers",
  "limit": 20,
  "sessionId": "1234567890%3AabcdefGHIJKL%3A12%3A..."
}
```

# 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("apt_marble/instagram-followers-following-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("apt_marble/instagram-followers-following-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 '{}' |
apify call apt_marble/instagram-followers-following-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Followers & Following Scraper",
        "description": "Scrape the followers or following list of any public Instagram profile. Returns usernames, full names, profile pictures, and account status for each result.",
        "version": "0.0",
        "x-build-id": "fROnm7B73ewzFYTv7"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/apt_marble~instagram-followers-following-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-apt_marble-instagram-followers-following-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/apt_marble~instagram-followers-following-scraper/runs": {
            "post": {
                "operationId": "runs-sync-apt_marble-instagram-followers-following-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/apt_marble~instagram-followers-following-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-apt_marble-instagram-followers-following-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "accounts",
                    "sessionId"
                ],
                "properties": {
                    "accounts": {
                        "title": "Instagram usernames",
                        "type": "array",
                        "description": "List of Instagram usernames to scrape (without the @ symbol).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "type": {
                        "title": "Scrape type",
                        "enum": [
                            "Followers",
                            "Following"
                        ],
                        "type": "string",
                        "description": "Whether to scrape Followers or Following.",
                        "default": "Followers"
                    },
                    "limit": {
                        "title": "Max results per account",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of followers/following to return per account.",
                        "default": 20
                    },
                    "sessionId": {
                        "title": "Instagram Session ID (required)",
                        "type": "string",
                        "description": "Your Instagram sessionid cookie value. Required to access followers/following lists.\n\nHow to get it:\n1. Open Instagram in Chrome while logged in\n2. Open DevTools → Application → Cookies → https://www.instagram.com\n3. Copy the value of the cookie named sessionid\n4. Paste it here."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
