# Instagram Comments Scraper — Posts & Reels (`leadsbrary/instagram-comments-scraper-pro`) Actor

Instagram comments scraper: export top-level comments of public posts and reels without login. Returns text, date, likes, author, mentions and hashtags as JSON, CSV or Excel. From $0.40 per 1,000.

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

## Pricing

from $0.40 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Comments Scraper — Export Post & Reel Comments

### What does it do?

This **Instagram comments scraper** exports the top-level comments of public Instagram posts and reels without any login. Paste post or reel URLs and get one row per comment: text, date, likes, author username, author ID, verified flag, profile link, mentions and hashtags. Download the data as JSON, CSV, Excel, XML or HTML, or pull it through the Apify API.

It reuses Instagram's own public web data over plain HTTP (no browser launched for the extraction), starts on Apify datacenter proxy and automatically switches to the residential pool if Instagram refuses it.

**Not included:** nested replies to comments are not collected (they are not exposed to logged-out visitors). Only top-level comments are returned.

### Who is it for / use cases

- **Social media & community managers** – export audience feedback on your own or competitors' posts.
- **Brand and market researchers** – analyse sentiment and topics in comments on campaigns or product launches.
- **Giveaway organisers** – list commenters and mentions for contest checks.
- **Lead generation / influencer vetting** – see who engages with a post and how many likes their comments get.
- **Data and NLP teams** – build comment datasets (multilingual text, emojis kept as-is).

### Features

- No login, cookies or Instagram account required – public posts and reels only.
- Accepts `/p/`, `/reel/`, `/tv/` URLs or bare shortcodes; duplicates removed.
- Limits per post (`maxCommentsPerPost`, up to 10,000) and per run (`maxResults`, up to 100,000) to control spend.
- Automatic datacenter → residential proxy fallback.
- Bad input never fails the run: invalid or private/login-only URLs produce an **unbilled error row** (`INVALID_URL`, `PRIVATE_OR_LOGIN_REQUIRED`).
- Clean, flat output with a ready dataset view.

### Input

#### Input fields

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `postUrls` | array of strings | yes | – | Public post/reel URLs (`/p/`, `/reel/`, `/tv/`) or shortcodes. |
| `maxCommentsPerPost` | integer | no | 50 | Max top-level comments per post (1–10,000). |
| `maxResults` | integer | no | 100 | Hard cap on total comment rows in the run (1–100,000). |
| `proxyConfiguration` | object | no | Apify proxy | Default datacenter with automatic residential fallback; pick a group explicitly to disable the switch. |

#### Example input

```json
{
  "postUrls": ["https://www.instagram.com/p/DdWyDLcGiqo/"],
  "maxCommentsPerPost": 20,
  "maxResults": 20
}
```

### Output

#### Example output

One dataset item per comment. Sample with anonymised values (profile picture URL shortened):

```json
{
  "postUrl": "https://www.instagram.com/p/DdWyDLcGiqo/",
  "postShortcode": "DdWyDLcGiqo",
  "commentId": "18000000000000000",
  "text": "Great post, thanks for sharing!",
  "createdAt": "2026-10-03T08:15:39.000Z",
  "likesCount": 0,
  "postCommentsTotal": 1783,
  "ownerUsername": "example_user",
  "ownerId": "1000000000",
  "ownerIsVerified": false,
  "ownerProfilePicUrl": "https://scontent-lga3-3.cdninstagram.com/…",
  "ownerProfileUrl": "https://www.instagram.com/example_user/",
  "mentions": [],
  "hashtags": [],
  "scrapedAt": "2026-10-03T17:36:31.657Z"
}
```

#### Error rows

Invalid input example (error row, not billed): `{"input": "https://www.instagram.com/nasa/", "error": "INVALID_URL", "message": "Not a public post/reel URL or shortcode.", "scrapedAt": "…"}`.

#### Output fields & fill rates

Measured on a 50-comment production run:

| Field | Fill rate | Note |
|---|---|---|
| `postUrl`, `postShortcode`, `postCommentsTotal` | 100% | Post identifiers and total comment count |
| `commentId`, `createdAt`, `likesCount` | 100% | |
| `ownerUsername`, `ownerId`, `ownerIsVerified`, `ownerProfileUrl`, `ownerProfilePicUrl` | 100% | |
| `text` | 98% | Empty for the rare comment without text |
| `mentions` | 6% | Filled only when a comment contains @mentions |
| `hashtags` | 0% in this run | Filled only when a comment contains #hashtags (empty array otherwise) |
| `scrapedAt` | 100% | |

### Configuration

- **Limits:** `maxCommentsPerPost` caps comments per post; `maxResults` caps the whole run (and your spend). Both are applied, whichever is reached first.
- **Proxy:** by default the Actor uses Apify datacenter proxy and switches automatically to the residential pool if Instagram refuses it. Select a proxy group explicitly in `proxyConfiguration` to disable the automatic switch.
- **Memory/timeout:** default run options are 4096 MB and a 3600 s timeout; small runs finish in well under that.

### How to use via API

#### curl

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~instagram-comments-scraper-pro/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrls":["https://www.instagram.com/p/DdWyDLcGiqo/"],"maxCommentsPerPost":50}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('YOUR_USERNAME/instagram-comments-scraper-pro').call({
  postUrls: ['https://www.instagram.com/p/DdWyDLcGiqo/'],
  maxCommentsPerPost: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("YOUR_USERNAME/instagram-comments-scraper-pro").call(run_input={
    "postUrls": ["https://www.instagram.com/p/DdWyDLcGiqo/"],
    "maxCommentsPerPost": 50,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(len(items))
```

### Pricing

Pay per result: you are charged per comment row returned (error rows are not billed). Price per 1,000 comments depends on your Apify plan:

| Plan | Per 1,000 results |
|---|---|
| FREE | $0.60 |
| BRONZE | $0.52 |
| SILVER | $0.46 |
| GOLD and above | $0.40 |

You also pay Apify platform usage (compute and proxy). The Actor starts on datacenter proxy; if Instagram refuses it, residential proxy traffic is billed by Apify at its own rate (our feasibility test measured roughly 1 GB per 1,000 entries on residential). Use `maxResults` to cap spend.

### Troubleshooting

- **`PRIVATE_OR_LOGIN_REQUIRED` row:** the post is private, deleted, age-restricted or requires login. Only public content is supported.
- **`INVALID_URL` row:** the input is a profile, story or other non-post URL. Use `/p/`, `/reel/` or `/tv/` links.
- **Fewer comments than `postCommentsTotal`:** that total includes replies and hidden/filtered comments; only top-level comments visible to logged-out visitors are returned.
- **Slow or retried requests:** Instagram may refuse datacenter IPs; the Actor then switches to residential proxy automatically.

### FAQ

**Does it need my Instagram login?** No. It never logs in and cannot access private accounts.

**Does it scrape replies?** No, only top-level comments.

**Is it legal?** It collects publicly visible data. Comments contain personal data (usernames, text): handle it according to GDPR and local law, and check Instagram's terms for your use.

**Which formats can I export?** JSON, CSV, Excel, XML, HTML and RSS from the Apify dataset.

### Keywords

instagram comments scraper, instagram comment exporter, scrape instagram comments, instagram reel comments, instagram post comments, export instagram comments to csv, instagram comments no login, instagram comment extractor, instagram engagement data

### Hashtags

\#instagram #instagramcomments #commentsscraper #socialmedia #webscraping #datascraping #socialmediaanalytics #apify

# Changelog

This Actor's version history is a separate document: https://apify.com/leadsbrary/instagram-comments-scraper-pro/changelog.md

# Actor input Schema

## `postUrls` (type: `array`):

Public Instagram post or reel URLs (/p/, /reel/, /tv/) or bare shortcodes. Duplicates are removed. Profile or story URLs produce an unbilled error row.

## `maxCommentsPerPost` (type: `integer`):

Maximum number of top-level comments collected per post.

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

Hard cap on the total number of comment rows in this run, across all posts (also protects your spending).

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

Default: Apify datacenter proxy, automatically switching to the residential pool if Instagram refuses it. Choose a proxy group explicitly to disable the automatic switch.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DdWyDLcGiqo/"
  ],
  "maxCommentsPerPost": 20,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "postUrls": [
        "https://www.instagram.com/p/DdWyDLcGiqo/"
    ],
    "maxCommentsPerPost": 20,
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("leadsbrary/instagram-comments-scraper-pro").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 = {
    "postUrls": ["https://www.instagram.com/p/DdWyDLcGiqo/"],
    "maxCommentsPerPost": 20,
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("leadsbrary/instagram-comments-scraper-pro").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 '{
  "postUrls": [
    "https://www.instagram.com/p/DdWyDLcGiqo/"
  ],
  "maxCommentsPerPost": 20,
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call leadsbrary/instagram-comments-scraper-pro --silent --output-dataset

```

## MCP server setup

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

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/d5dpyzVTRmonM1Gni/builds/AUTl4OdZrgadKqeYb/openapi.json
