# Instagram Following Scraper (`scrapebase/instagram-following-scraper`) Actor

📸 Instagram Following Scraper extracts public following lists—usernames, names, bios, profile URLs & IDs—with filters, pagination & CSV/JSON export. 🔎 Ideal for influencer research, competitor analysis, lead gen & growth campaigns. ⚖️ Public data only.

- **URL**: https://apify.com/scrapebase/instagram-following-scraper.md
- **Developed by:** [ScrapeBase](https://apify.com/scrapebase) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 14 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$19.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## 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 Following Scraper

The Instagram Following Scraper is a production-grade Apify actor that extracts public “following” lists from Instagram profiles — fast, reliably, and at scale. It solves the tedious task of collecting usernames, names, IDs, and profile metadata by automating pagination and exporting structured results in real time. Built for marketers, developers, data analysts, and researchers, this Instagram following extractor lets you scrape Instagram following lists for multiple profiles in bulk and stream results to a dataset ready for CSV/JSON export. Use it to power influencer research, competitor analysis, lead generation, and growth campaigns.

### What data / output can you get?

Each item saved to the dataset represents an account that the input user follows. The scraper preserves a consistent field order and includes key identifiers and profile metadata.

| Data field | Description | Example value |
| --- | --- | --- |
| pk | Primary user identifier | 1234567890 |
| pk\_id | Secondary ID; falls back to pk if missing | 1234567890 |
| id | User ID; falls back to pk if missing | 1234567890 |
| username | Instagram handle | "natgeo" |
| full\_name | Display name | "National Geographic" |
| is\_private | Whether the account is private | false |
| is\_verified | Verification flag | true |
| profile\_pic\_url | URL to the profile picture | "https://…/profile\_pic.jpg" |
| profile\_pic\_id | Profile picture ID | "987654321" |
| has\_anonymous\_profile\_picture | Anonymous/default pic flag | false |
| latest\_reel\_media | Latest reel media timestamp/ID (if present) | 1712941200 |
| account\_badges | Badge information list (empty if none) | \[] |
| third\_party\_downloads\_enabled | Download permission flag (if present) | false |
| strong\_id\_\_ | Strong ID alias (if present) | "1234567890" |
| fbid\_v2 | Facebook/IG cross-identifier (if present) | "17841400000000000" |
| is\_favorite | Favorited flag (if present) | false |
| followed\_by | The input username that follows this user | "mrbeast" |

Notes:

- Results are saved live to the Apify dataset as they are collected.
- You can export the dataset to CSV or JSON for analysis and sharing.
- Some fields may be missing depending on Instagram’s public response; the scraper safely falls back for id/pk\_id and ensures account\_badges is always a list.

### Key features

- 🔁 Smart proxy fallback (direct → datacenter → residential, sticky)
  Ensures high success rates with a progressive strategy and residential retries when blocks occur. Once residential is enabled, it stays sticky for the rest of the run.

- 🧩 Matching output schema with consistent field order
  Output keys are kept in a precise, predictable order for seamless downstream processing.

- 📦 Bulk input for multiple profiles
  Feed in a list of profile URLs or usernames to scrape Instagram following lists at scale in one run.

- 💾 Real-time dataset streaming
  Items are pushed to the dataset as soon as they’re parsed — monitor progress and start using data immediately.

- 🎯 Fine-grained limits and pagination control
  Use maxItems to cap how many “followings” you collect per profile, and pageSize (default 12) for request batch size.

- 🍪 Session cookie support (optional, recommended)
  Provide sessionId from a logged-in browser session for improved stability; without it you may encounter more blocks.

- 🧭 Clear, informative logs
  See proxy fallback events, per-profile progress counters, and run summaries that keep you in control end to end.

### How to use Instagram Following Scraper - step by step

1. Sign in to Apify\
   Create or log in to your Apify account to run the actor.

2. Open the actor on Apify Store\
   Search for “Instagram Following Scraper” by scrapebase and open the actor page.

3. Add input profiles\
   In “urls”, paste one or more Instagram profile URLs or plain usernames.

- Accepted formats:
  - https://www.instagram.com/username/
  - username
- Add multiple entries to scrape in bulk.

4. Configure limits and stability

- maxItems: Set the maximum number of followings to collect per profile (0 = unlimited).
- sessionId (optional but recommended): Paste your Instagram sessionid cookie for higher reliability.
- proxyConfiguration: Default is no proxy. The actor automatically falls back to datacenter → residential if blocked.

5. (Advanced) Control pagination size\
   If running via API or custom JSON input, you can include pageSize to adjust the per-request batch size (default 12).

6. Start the run\
   Click “Start”. The run will fetch profile identifiers, paginate through the following list, and push items live to the dataset. You’ll see clear logs indicating progress and any proxy fallback events.

7. Download results\
   Open the run’s Dataset to preview and export your data. You can download as CSV or JSON. This makes it simple to download the Instagram following list and use it in analytics tools or for campaign planning.

Pro tip: Use the maxItems setting to sample large accounts, then re-run with a higher limit once you validate the workflow. For developers, include pageSize in your input JSON for fine-tuned performance.

### Use cases

| Use case | Description |
| --- | --- |
| Influencer research + discovery | Map who key creators follow to identify niche leaders and potential collaboration targets using an IG following scraper tool. |
| Competitor analysis | Analyze competitor follow graphs to spot partnerships, paid relationships, and category trends with an Instagram following data scraper. |
| Lead generation & outreach | Build targeted prospect lists from public followings and export to CSV/JSON to feed your CRM. |
| Social graph mapping | Study network structures and clusters by scraping multiple profiles’ following lists for graph analysis. |
| Content strategy | Track verified, public accounts that top creators follow to inform curation and sourcing. |
| Academic and market research | Collect structured public follow data for reproducible studies and datasets. |
| API-first pipelines | Orchestrate scheduled runs and pipe the dataset into your data lake or enrichment workflows. |

### Why choose Instagram Following Scraper?

This tool is engineered for precision, resilience, and clean, ready-to-use outputs.

- ✅ Accurate, structured fields with stable ordering for easy parsing
- 🔁 Resilient proxy strategy (direct → datacenter → residential with retries) to reduce blocks
- 📦 Built for scale: bulk input of URLs/usernames with per-profile limits
- 🍪 Optional sessionId support for improved stability when scraping Instagram following lists
- 💾 Real-time dataset saving for immediate access and monitoring
- 🧪 Following-only focus for targeted, high-signal datasets
- 🧰 Developer-friendly inputs and predictable JSON output for automation

Unlike brittle extensions or ad hoc scripts, this production-ready Instagram user following scraper provides consistent results, robust fallback, and clear observability in each run.

### Is it legal / ethical to use Instagram Following Scraper?

Yes — when used responsibly. This actor extracts only publicly available data and does not access private information. Users are responsible for compliance with platform rules and applicable laws.

Guidelines for responsible use:

- Scrape only publicly available profiles and data
- Respect platform limitations and usage policies
- Comply with data protection laws (e.g., GDPR, CCPA)
- Use results ethically for analysis and research, not spam or abuse

The actor is designed for public data collection; verify your specific use case with your legal team if needed.

### Input parameters & output format

Example JSON input

```json
{
  "urls": [
    "https://www.instagram.com/mrbeast/",
    "virat.kohli"
  ],
  "maxItems": 100,
  "sessionId": "YOUR_INSTAGRAM_SESSIONID_COOKIE",
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "pageSize": 12
}
```

Parameters

- urls (array, required): One or more Instagram profiles to scrape. Accepts full URLs (https://www.instagram.com/username/) or plain usernames.
- maxItems (integer, optional, default: 100): Maximum number of following users to collect per input profile. 0 = unlimited (collect until pagination ends).
- sessionId (string, optional): Instagram sessionid cookie value from a logged-in browser session. Optional but strongly recommended for stability.
- proxyConfiguration (object, optional, default: {"useApifyProxy": false}): Proxy settings. The actor starts without a proxy and automatically falls back to datacenter → residential (sticky) if blocked.
- pageSize (integer, optional, default: 12): Number of users requested per API call (passed as “count”); available when providing input as JSON.

Example JSON output (one item)

```json
{
  "pk": 1234567890,
  "pk_id": 1234567890,
  "id": 1234567890,
  "full_name": "National Geographic",
  "is_private": false,
  "fbid_v2": "17841400000000000",
  "third_party_downloads_enabled": false,
  "strong_id__": "1234567890",
  "profile_pic_id": "987654321",
  "profile_pic_url": "https://instagram.fabc1-2.fna.fbcdn.net/v/t51.2885-19/....jpg",
  "is_verified": true,
  "username": "natgeo",
  "has_anonymous_profile_picture": false,
  "account_badges": [],
  "latest_reel_media": 1712941200,
  "is_favorite": false,
  "followed_by": "mrbeast"
}
```

Notes:

- If Instagram omits pk\_id or id, the scraper falls back to pk.
- account\_badges is always an array (defaults to \[]).
- followed\_by is set to the input username for traceability.
- Some fields can be null or missing depending on Instagram’s public response.

### FAQ

#### Do I need to log in or provide cookies?

✅ No login is strictly required, but providing sessionId (your Instagram sessionid cookie) is strongly recommended for stability. Without it, you may encounter more frequent blocks.

#### Can this scrape followers as well as followings?

❌ No. This actor is intentionally following-only. It targets the public following list endpoints to remain precise and reliable.

#### How many profiles can I run at once?

✅ You can supply multiple “urls” (usernames or profile URLs) in a single run. The scraper processes each profile, paginates through their followings, and pushes results live to the dataset.

#### How do I limit how much data is collected?

🎯 Use maxItems to cap the number of followings per input profile. Set maxItems to 0 to collect the full public list until pagination ends.

#### What formats can I export to?

💾 Results are saved to an Apify dataset in real time. From there, you can export in CSV or JSON to download Instagram following lists for analysis or reporting.

#### How does the scraper handle blocks?

🛡️ It starts with no proxy (direct). If blocked, it automatically falls back to datacenter, then to residential (sticky) with retries. Once residential is enabled, it remains in use for the rest of the run.

#### What does the output include?

📦 Each record includes identifiers and profile metadata such as pk, id, username, full\_name, is\_private, is\_verified, profile\_pic\_url, account\_badges, latest\_reel\_media, and followed\_by (the source username).

#### Can I control pagination size?

⚙️ Yes. When providing input as JSON or via API, you can include pageSize (default 12) to adjust the per-request batch size.

#### Is the data public?

✅ Yes. The actor scrapes only publicly available information. Visibility depends on the target profile’s settings and your session context.

#### Is there a trial or free tier?

🧪 The listing includes 120 trial minutes under a flat monthly pricing model. Check the Apify Store page for current details before running large jobs.

### Closing CTA / Final thoughts

The Instagram Following Scraper is built to reliably scrape Instagram following lists at scale with clean, structured outputs. With bulk inputs, smart proxy fallback, and real-time dataset streaming, it’s ideal for marketers, analysts, researchers, and developers who need a dependable Instagram following list exporter.

Start by adding a few target profiles, set maxItems, optionally include sessionId for stability, and run. Download your results as CSV/JSON and plug them into your analysis stack. Developers can fine-tune pageSize and automate runs via input JSON for repeatable pipelines.

Begin extracting smarter Instagram follow graph insights today — and turn public followings into actionable data for research, outreach, and growth.

# Actor input Schema

## `urls` (type: `array`):

✅ Full profile links work great
✅ Plain `@handle` or `handle` works too
✅ Add as many as you need for a **bulk** run

💜 *Example:* `https://www.instagram.com/mrbeast/`

## `maxItems` (type: `integer`):

🔢 **Limit** how many accounts to collect **for each** profile in your list.

✨ `0` = **no cap** (keep going until the list ends)
🧪 Not sure? Start with **100–500** and adjust next time

⏱️ Bigger numbers = longer runs — plan accordingly!

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

📌 **Strongly recommended**

🧭 Copy the `sessionid` value from your Instagram cookies in the browser where you’re already logged in, and paste it here.

🙈 It stays private to your run — never share it publicly.

💤 You *can* leave this empty, but runs may be less reliable.

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

🎛️ **Default:** run without a special proxy (simple & direct).

🔧 Need Apify Proxy? Toggle it here and pick the options that match your plan.

✨ The actor adapts automatically when the platform is picky — you’ll see friendly notes in the log.

## Actor input object example

```json
{
  "urls": [
    "https://www.instagram.com/mrbeast/"
  ],
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "urls": [
        "https://www.instagram.com/mrbeast/"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapebase/instagram-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 = {
    "urls": ["https://www.instagram.com/mrbeast/"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapebase/instagram-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 '{
  "urls": [
    "https://www.instagram.com/mrbeast/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scrapebase/instagram-following-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/3dHCF8qLxffpWxXbM/builds/Rhmat2qen6S6hzrpl/openapi.json
