# Instgram Scraper All-In-One (`mido_99/instgram-scraper-all-in-one`) Actor

📷 Collect Instagram profile data efficiently with all-in-one scraper! Extract usernames, bios, followers, following, posts, engagement stats, and more in a structured format. Perfect for marketing, lead generation, and analytics. Fast, reliable, and easy to use.

- **URL**: https://apify.com/mido\_99/instgram-scraper-all-in-one.md
- **Developed by:** [Mohamed Hany](https://apify.com/mido_99) (community)
- **Categories:** Automation, Social media, Lead generation
- **Stats:** 205 total users, 5 monthly users, 40.9% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Scraper All-in-One

🚀 The **Instagram Scraper All-in-One** is the ultimate tool for content creators, marketers, and data enthusiasts looking to unlock valuable insights from Instagram. Stop guessing what content works, Start analyzing the data behind the world's most engaging posts and profiles!

Whether you need to analyze a competitor's profile, track a trending hashtag, or download comment data for sentiment analysis, this Actor has you covered!

### 🌟 Features:

- ✅ **Profile Posts** - Extract posts, captions, likes, and more from public and private profiles.
- ✅ **Comments Analysis** - Extract comments from specific posts, perfect for sentiment analysis and understanding audience reactions.
- ✅ **Followers & Following** - Get lists of followers or the accounts a user is following for deep audience and competitive research.
- ✅ **Hashtag Tracking** - Monitor the latest and top posts associated with any trending hashtag to spot content opportunities.
- ✅ **Flexible Input** - Use direct URLs, usernames, or hashtag keywords.
- ✅ **Logged-in Session Support**: Use your Instagram session cookies to access private profiles or personalized data.
- ✅ **Multiple Export Formats** - Download structured data in **JSON, CSV, Excel**, and more.

### 🔎 What Data Can You Extract?

The Actor returns clean, well-structured data depending on your chosen *scrape mode*:

| Scrape Mode             | Key Data Points Extracted                                    | Best For                                            |
| ----------------------- | ------------------------------------------------------------ | --------------------------------------------------- |
| **Profile Posts**       | Post URL, Caption text, Like Count, Comment Count, Media URLs (image/video), Timestamp, Location | Competitor content strategy, trend analysis.        |
| **Comments**            | Commenter Username, Comment Text, Timestamp, Like Count on comment | Audience sentiment, keyword analysis.               |
| **Followers/Following** | User ID, Username, Full Name, Profile URL, Is Private status | Target audience identification, influencer mapping. |
| **Hashtag**             | Post data (similar to Profile Posts) associated with the tag | Spotting emerging trends, content ideation.         |

### 💡 How do I use the Scraper?

1. 🔑 **Sign in** to your Apify account. If you don't have one, [**Sign up here**](https://console.apify.com/sign-up?fpr=3ab7ar\&fp_sid=signup) for free.
2. ⚙️ **Select`scrapeMode`** (Posts, Comments, Follow, or Hashtag) in the input fields. This is required.
3. 🔗 **Input your target(s):** Use the `startUrls` field for direct Instagram links (profiles, posts) or the `usernames_keywords` field for simple profile handles (`leomessi`) or hashtags (`#contentideas`).
4. 🚧 **Set Limits:** Use `maxResults` to control how many items (posts, comments, or followers) you want per target URL/keyword.
5. ⏳ **Run** the Actor and wait for your data to be collected.
6. 💾 **Export** your data in **CSV**, **JSON** or integrate with your other workflows!

### 📋 Input Fields Explained

| Field Name                    | Description                                                  | Required?                                              | Notes                                                        |
| ----------------------------- | ------------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------------ |
| `scrapeMode`  (string)        | Select the type of data you want to collect (Posts, Comments, Follow, or Hashtag). | **YES**                                                | The core functionality selector.                             |
| `startUrls`  (array)          | Direct links to Instagram pages (Profile URL, Post URL, Hashtag page URL). | NO                                                     | Use this for specific URLs.                                  |
| `usernames_keywords`  (array) | Instagram usernames (without the `@`) or hashtag keywords (without the `#`). | NO, but you have to provide either this or `startUrls` | Ideal for bulk scraping simple targets.                      |
| `follow_mode` (string)        | Relevant only when `scrapeMode` is set to 'Follow'. Choose between scraping a user's **Followers** or **Following** list. | Only for `follow` mode.                                | Can be `followers` or `following`.                           |
| `maxResults` (integer)        | The maximum number of posts, comments, or followers to scrape for **each** target URL/keyword. | NO                                                     | Default is `50`.                                             |
| `sessionCookies`  (array)     | Active Instagram session cookies from your logged-in account. | NO                                                     | **Crucial for accessing private profiles you follow!** See the 'Session Cookies' section for more  instructions. |

#### 🍪 Session Cookies: Accessing Private Data

If you need to scrape data from a **private profile** that you are following, you need to provide your *active Instagram session cookies*. This allows the Actor to behave as if you are logged in.

🔹 **How to obtain your session cookies?**

1. Install a browser extension that exports your cookies; example on Chrome is [Cookie-Editor](https://chromewebstore.google.com/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm).
2. Log in to your Instagram account in your web browser.
3. Click on the extension → “Export” → “JSON”.
4. Cookies are now copied, past them into `sessionCookies` field.

That's it! Now if you run the scraper it should access private accounts you're following.

> 🔒 **Privacy Note:** We do not store or save your session cookies. They are only used temporarily during the execution of your current run to authenticate the scraping process and are immediately discarded afterward.

### 📊 Output

##### **Example: Single Post Data Output (JSON)**

```json
{
"source_url": "https://www.instagram.com/leomessi",
"id": "3714320077559846847",
"shortCode": "DOL6m5lDle_",
"created_at": "2025-09-04 16:00:37",
"caption": "A symbol that inspires. A generation that dreams. 💗💫",
"caption_is_edited": false,
"has_translation": null,
"url": "https://www.instagram.com/p/DOL6m5lDle_",
"likes_count": 630953,
"type": "Reel",
"comments_count": 10507,
"display_image": "...",
"acc_caption": null,
"is_sponsorship": false,
"sponsor_tags": null,
"user": {
  "username": "intermiamicf_academy",
  "full_name": "Inter Miami CF Academy",
  "profile_pic": "...",
  "is_verified": true,
  "id": "44452457608"
},
"co_authors": [
  {
    "username": "leomessi",
    "full_name": "Leo Messi",
    "profile_pic": "...",
    "is_verified": true
  },
  // ...
],
"mentions": null,
"tagged_users": [
  {
    "id": "427553890",
    "username": "leomessi",
    "full_name": "Leo Messi",
    "profile_pic": "...",
    "is_verified": true
  },
  // ...
],
"images_count": null,
"images": "...",
"height_dimensions": 1920,
"width_dimensions": 1080,
"has_audio": true,
"music_info": {
  "title": "Original audio",
  "artist_name": null,
  "duration": null,
  "audio_url": null,
  "is_trending": false,
  "artist_id": "44452457608",
  "audio_id": "1760324584585542"
},
"video_url": "...",
"video_duration_sec": null,
"views_count": null,
"video_height": 1280,
"video_width": 720,
"location": null,
"comments": [
  {
    "source_url": "https://www.instagram.com/p/DOL6m5lDle_",
    "id": "18181206028340946",
    "created_at": "2025-10-08 13:25:32",
    "text": "",
    "has_translation": null,
    "replies_count": 0,
    "likes_count": null,
    "is_covered": false,
    "image": null,
    "gif": "...",
    "username": "laila_alshishtawy",
    "profile_pic": "...",
    "profile_url": "https://www.instagram.com/laila_alshishtawy",
    "is_verified": false,
    "user_id": "64723074732",
    "fbid_v2": "17841464641980384"
  },
  // ...
]
}
```

##### **Example: Single Comment (JSON)**

```json
{
"source_url": "https://www.instagram.com/p/DM01GDhsJyt/",
"id": "17929080336096107",
"created_at": "2025-08-21 23:17:02",
"text": "BOOM 💥 Ready for the next Shot 🎬🎬",
"has_translation": null,
"replies_count": 0,
"likes_count": 8,
"is_covered": false,
"image": null,
"gif": null,
"username": "drexlee",
"profile_pic": "...",
"profile_url": "https://www.instagram.com/drexlee",
"is_verified": true,
"user_id": "1329561446",
"fbid_v2": "17841400763400774"
}
```

##### **Example: Single User Follower (JSON)**

```json
{
"id": "54314703532",
"fbid_v2": "17841454465969337",
"username": "shahdmuhammad66",
"full_name": "Shahd Muhammad",
"profile_url": "https://www.instagram.com/shahdmuhammad66",
"profile_pic": "...",
"profile_pic_id": "3106469405864461148_54314703532",
"is_verified": false,
"is_private": true,
"third_party_downloads_enabled": 0,
"has_anonymous_profile_picture": false,
"latest_reel_media": 0
}
```

> ⚠Limited number of followers available for some accounts due to recent Instagram policies. We're working to bypass this as soon as possible.

### 💰 Pricing

This Actor operates on **PPE (pay-per-event)** model: *(Pricing Per 1000 results)*

| Scraped item                | Free      | 🟤 Bronze  | ⚪ Silver  | 🟡 Discount |
| --------------------------- | --------- | --------- | --------- | ---------- |
| **Profile Post**            | **$2.50** | **$2.10** | **$1.70** | **$1.30**  |
| **Hashtag Post**            | **$2.70** | **$2.28** | **$1.87** | **$1.45**  |
| **Comment**                 | **$2.20** | **$1.87** | **$1.53** | **$1.20**  |
| **User (Profile Metadata)** | **$1.80** | **$1.25** | **$1.00** | **$0.70**  |

🎁 Apify offers a **Free Tier** which gives you **$5/month** usage credits, allowing you to test this and many other Actors completely free. If you need larger datasets or more frequent runs, consider [**subscribing**](https://apify.com/pricing?fpr=3ab7ar) to one of Apify's paid plans.

### 🛠️ Support

- If you encounter any issues while using this Actor, please report them in the [issues](https://apify.com/mido_99/instgram-scraper-all-in-one/issues/open) tab.
- For any questions, feature requests, or custom scraping needs, feel free to [**reach out**](mailto:miohany910@gmail.com) to the author of this Actor.

*If this tool helps you find your next viral content idea or save hours on data collection, please bookmarks it📌 & give it a 5⭐️ review! Your support helps me keep this Actor maintained and updated! 🙏*

> Need a scraper for a different website, or have an existing project that requires fixes or custom improvements? Feel free to contact me for consulting or development work:
>
> - 📧 [**Email**](mailto:miohany910@gmail.com)
> - 💼 [**Upwork**](https://www.upwork.com/freelancers/~01cc419fb93065ffd6?mp_source=share)

### FAQ 🤔

#### Why can't I scrape private accounts?

Instagram's policy is to hide the data of private accounts from public users who don't follow them. Since this scraper acts like an external visitor by default, it respects this privacy setting.

To access data from a private profile, **you must follow that profile**, and then provide the scraper with the active login session via the `sessionCookies`  input. Please refer to the [Session Cookies section](https://apify.com/mido_99/instgram-scraper-all-in-one#session-cookies-accessing-private-data) for detailed instructions.

#### Sometimes I get *"Only \[username] can see all followers!"* Is that a bug?

No, This message is part of **Instagram's recent privacy policy** where they are starting to restrict who can view the full follower/following list of certain accounts.

While this feature is being implemented gradually and many accounts still have publicly visible lists, the message indicates that the restriction is active for that specific user. *This Actor is currently unable to bypass this restriction*.

#### My scrape stopped before reaching `maxResults`, Why?

This usually happens when The target (profile, hashtag, etc.) simply had fewer items than the `maxResults` you requested.

#### Can I scrape Stories or Reels data?

Currently, this Actor is optimized for the core modes: Posts, Comments, Followers/Following, and Hashtags. Newer modes are to be added though like **Scraping Reels, Profile Details, & more**.

Please reach out to me for a custom development solution.

# Actor input Schema

## `startUrls` (type: `array`):

Instagram URLs to scrape; e.g. profile, post, hashtag, etc...

## `usernames_keywords` (type: `array`):

Instagram usernames or hashtags you want to scrape

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

Select what you want to scrape.

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

Relevant only when scrape mode = 'follow' -  Select whether you want to scrape the followers of users or whom they are following.

## `maxResults` (type: `integer`):

How many results per each URL you want.

## `sessionCookies` (type: `array`):

Active Instagram session cookies of your logged-in account. These cookies allow the actor to access data available only to your account (e.g., private profiles you follow) or behave as if you're logged-in (posts comments ordered as you'd see them, etc..). Input if you encounter the warning: '\[username] account is private!'. For full instructions on how to obtain and input them, see the actor README 'Session Cookies' section.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.instagram.com/instagram/"
    },
    {
      "url": "https://www.instagram.com/world_record_egg/?hl=en"
    }
  ],
  "usernames_keywords": [
    "cristiano",
    "leomessi"
  ],
  "scrapeMode": "follow",
  "follow_mode": "followers",
  "maxResults": 10
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.instagram.com/instagram/"
        },
        {
            "url": "https://www.instagram.com/world_record_egg/?hl=en"
        }
    ],
    "usernames_keywords": [
        "cristiano",
        "leomessi"
    ],
    "scrapeMode": "follow",
    "follow_mode": "followers",
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("mido_99/instgram-scraper-all-in-one").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 = {
    "startUrls": [
        { "url": "https://www.instagram.com/instagram/" },
        { "url": "https://www.instagram.com/world_record_egg/?hl=en" },
    ],
    "usernames_keywords": [
        "cristiano",
        "leomessi",
    ],
    "scrapeMode": "follow",
    "follow_mode": "followers",
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("mido_99/instgram-scraper-all-in-one").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 '{
  "startUrls": [
    {
      "url": "https://www.instagram.com/instagram/"
    },
    {
      "url": "https://www.instagram.com/world_record_egg/?hl=en"
    }
  ],
  "usernames_keywords": [
    "cristiano",
    "leomessi"
  ],
  "scrapeMode": "follow",
  "follow_mode": "followers",
  "maxResults": 10
}' |
apify call mido_99/instgram-scraper-all-in-one --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=mido_99/instgram-scraper-all-in-one",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

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