# Instagram Followers / Following Scraper (`arisma_tech/instagram-followers`) Actor

Scrape Instagram followers or following lists. Without a session token, returns profile details (counts, bio). With a session token, fetches the full follower/following list. Pay per delivered profile only.

- **URL**: https://apify.com/arisma_tech/instagram-followers.md
- **Developed by:** [Arishma](https://apify.com/arisma_tech) (community)
- **Categories:** Social media
- **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 profiles

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 Followers / Following Scraper

**A separate Actor from the Instagram Profile & Posts Scraper — this one returns follower and following lists, not posts.**

### What it does

Input a seed Instagram username or URL, set a limit (default 200, range 1–1,000 per seed). Output is one row per profile:

- username, full name, profile URL
- is_private, is_verified, profile picture URL
- followerCount / followingCount / biography — **filled by default** (one small detail request per profile). They are null only if that detail request fails for a profile, or if you set `includeProfileDetails: false` for the fast lightweight run.

**No posts by default.** Post scraping is an explicit opt-in flag (`includePosts`, default false) and is not part of the core job.

### Two modes

- **With your Instagram session token** (optional `sessionToken` input): fetches the actual followers **and** following lists for each seed — including private accounts your session follows. This is the full list job.
- **Without a session token**: returns profile details for each seed (follower/following counts, bio, verification) — no list. Logged-out, no login needed for this mode.

Your session token is sent only to instagram.com as a cookie for that run, never logged, and never stored in the dataset. You can also set it as the `IG_SESSION` environment variable in Apify Console instead of passing it in the input.

### How it stays cheap

- API-style HTTP list pages (50 profiles per page), no browser.
- Pagination with cursor, dedupe across pages (by user id, else username), hard stop at the limit.
- Charge event `profile` is fired only for a row actually pushed to the dataset. Failed, duplicate and gated rows are never charged.
- Charge event `proxy-traffic` is fired ONLY when the client uses Apify Proxy, at $0.0008 per full 100 KB of response body. No Apify Proxy = no proxy charge. A run under 100 KB charges 0 proxy units.
- On a hard stop (429 rate limit, login gate, seed not resolvable), the run keeps the partial rows it already delivered and logs the reason, instead of failing the whole run and losing them.

### Honest limitation

Instagram's followers endpoints are undocumented and can change, rate-limit or gate accounts without warning. This Actor is built to fail cleanly and partially, not to guarantee a complete list for every seed, especially large or private accounts.

### Input example

```json
{
  "seeds": ["natgeo"],
  "limit": 10,
  "includeProfileDetails": true
}
```

### Output example (one row per profile)

```json
{
  "username": "natgeo",
  "fullName": "National Geographic",
  "profileUrl": "https://www.instagram.com/natgeo/",
  "userId": "787132",
  "isPrivate": false,
  "isVerified": true,
  "profilePicUrl": "https://scontent.cdninstagram.com/...",
  "followerCount": 268161790,
  "followingCount": 195,
  "biography": "Step into wonder and find your inner explorer with National Geographic",
  "seedUsername": "natgeo",
  "listType": "profile_only"
}
```

`listType` is `followers` or `following` for list rows, and `profile_only` for a seed's profile-details row when no session token is supplied.

### Pricing

One flat price, no tiers, no discounts:

| Event | Price | When |
|---|---|---|
| Profile (`profile`) | $1.00 / 1,000 | Each profile row delivered to the dataset |
| Proxy traffic (`proxy-traffic`) | $0.0008 / 100 KB | Only when Apify Proxy is used |
| Actor start | $0.00005 / run | When the Actor starts |

Example: 200 profiles ≈ $0.20, plus proxy traffic only if you use Apify Proxy. Failed, duplicate and gated rows are never charged. Platform usage is billed at standard Apify rates.

### FAQ

**Do I need an Instagram session?** Only for the followers/following lists. Without one, the Actor returns profile details for your seeds (counts, bio, verification) — no login needed.

**Can it scrape private accounts?** The lists of a private account can only be fetched with a session token from an account that follows it. Public profile details work without a session.

**Why did a run stop early?** Instagram rate-limits list endpoints. The run keeps the rows it already delivered and logs the reason. Try again later, with a lower limit, or with Apify Proxy (residential recommended).

# Actor input Schema

## `includePosts` (type: `boolean`):

OFF by default. If true, posts are scraped in addition to the list. This is a different, much heavier and more expensive job — do not enable it for a followers-list job.

## `includeProfileDetails` (type: `boolean`):

ON by default. Fetches each profile's public page (logged-out) to fill followerCount / followingCount / biography, paced ~1s apart. Without it those fields are null. Set false for fast lightweight rows with null counts.

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

Maximum profiles returned per seed account. Default 200 matches the typical small DM-list use case. Hard range 1–1,000 per seed — this cap is what keeps a run lightweight and cheap.

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

Apify Proxy. Residential proxies are recommended for Instagram; datacenter IPs are rate-limited far more often.

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

Optional Instagram session token (sessionid cookie value). Without it, the actor returns profile details only (follower/following counts, bio, etc.). With it, the actor fetches the actual followers/following list. You can get this from your browser's cookies for instagram.com.

## `seeds` (type: `array`):

One or more seed accounts. For each seed, the Actor returns that seed's followers OR following list (see listType). Each entry may be a username (e.g. natgeo) or a full profile URL. Limit applies PER seed.

## Actor input object example

```json
{
  "includePosts": false,
  "includeProfileDetails": true,
  "limit": 200,
  "proxyConfiguration": {
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "useApifyProxy": true
  },
  "seeds": [
    "natgeo"
  ]
}
```

# Actor output Schema

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

Profile records from the 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 = {
    "includePosts": false,
    "includeProfileDetails": true,
    "limit": 200,
    "proxyConfiguration": {
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "useApifyProxy": true
    },
    "seeds": [
        "natgeo"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("arisma_tech/instagram-followers").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 = {
    "includePosts": False,
    "includeProfileDetails": True,
    "limit": 200,
    "proxyConfiguration": {
        "apifyProxyGroups": ["RESIDENTIAL"],
        "useApifyProxy": True,
    },
    "seeds": ["natgeo"],
}

# Run the Actor and wait for it to finish
run = client.actor("arisma_tech/instagram-followers").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 '{
  "includePosts": false,
  "includeProfileDetails": true,
  "limit": 200,
  "proxyConfiguration": {
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "useApifyProxy": true
  },
  "seeds": [
    "natgeo"
  ]
}' |
apify call arisma_tech/instagram-followers --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arisma_tech/instagram-followers"
        }
    }
}
```

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/iu4Jn3JPwuAQ4Uch1/builds/m4yn0gxmu8e5naNM6/openapi.json
