# Instagram Comment Scraper (`herus13/instagram-comment-scraper`) Actor

Scrape Instagram comments anonymously by post/reel URL (or by username for recent posts). Returns comment text, author, likes, replies, and timestamp. No login required.

- **URL**: https://apify.com/herus13/instagram-comment-scraper.md
- **Developed by:** [bootforge](https://apify.com/herus13) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 comment scrapeds

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/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 Comment Scraper

The Instagram Comment Scraper is an Apify actor that extracts comments from [Instagram](https://www.instagram.com) posts and reels — **anonymously, with no login**. Point it at a post/reel URL or a username, and it returns each comment's text, author, like count, reply count, timestamp, and the parent comment ID that links replies to their thread. It runs HTTP-only through Instagram's public API, no browser required.

Use it for sentiment analysis, engagement audits, community-management triage, or competitor monitoring — exported to JSON, CSV, or Excel.

### Table of contents

- [What the Instagram comment scraper does](#what-the-instagram-comment-scraper-does)
- [Use cases](#use-cases)
- [How to scrape Instagram comments](#how-to-scrape-instagram-comments)
- [Instagram comment scraper input](#instagram-comment-scraper-input)
- [Instagram comment data output](#instagram-comment-data-output)
- [How much it costs](#how-much-it-costs)
- [Recommended proxies for Instagram](#recommended-proxies-for-instagram)
- [Why this Instagram comment scraper](#why-this-instagram-comment-scraper)
- [FAQ](#faq)
- [Rate this actor](#rate-this-actor-)
- [Related actors](#related-actors)

### What the Instagram comment scraper does

- 💬 **Comments by post or reel URL** — paste a post/reel link and collect its comments up to your cap.
- 👤 **Comments by username** — give a handle and the scraper pulls comments across that profile's recent posts.
- 🔓 **No login required** — anonymous scraping through Instagram's public API, the same one the browser uses before you sign in.
- 🧵 **Thread-aware** — every reply carries a `parent_id` pointing to its parent comment's `pk`, so you can rebuild conversation threads.
- 📄 **Flat, CSV-ready output** — one comment per row, no deep nesting; open it straight in a spreadsheet.
- 🌐 **HTTP-only, no browser** — fast and cheap; residential proxy handles the geo/IP requirements.

### Use cases

**Sentiment analysis on real audience reaction** — Comments carry the unfiltered response to a post in a way like counts never do. Text, author, like count, and timestamp come back structured and ready to classify.

**Thread reconstruction** — Each comment carries the parent comment ID that links replies to their thread, so a conversation can be rebuilt rather than flattened into an undifferentiated list — necessary if you care who was replying to whom.

**Community-management triage** — Point it at your own recent posts and surface the comments with the most likes or replies, which are the ones worth a response. Runs HTTP-only with no login, so it can sit on a schedule without an account to keep alive.

**Competitor audience research** — Reading a competitor's comment section shows what their customers ask for and complain about, and which of their posts actually provoked a conversation instead of passive likes.

### How to scrape Instagram comments

1. Click **Try for free** and open the actor.
2. Add one or more `targets` — post/reel URLs, usernames, or a mix of both.
3. Set `max_comments` (per post) and, for usernames, `max_posts` (how many recent posts to walk).
4. Leave **Proxy provider** on **Default** — a residential proxy is included.
5. Click **Start** and watch comments stream into the dataset.
6. Export as **JSON, CSV, or Excel**, or pull from the [Apify API](https://docs.apify.com/api/v2).

Example input:

```json
{
  "targets": ["https://www.instagram.com/p/Dbdo4gTupuE/", "nike"],
  "max_comments": 100,
  "max_posts": 5,
  "proxyProvider": "default"
}
```

### Instagram comment scraper input

| Field | Description |
|---|---|
| `targets` | Post/reel URLs (comments on that post) or usernames (comments on the profile's recent posts). Mix both in one run. |
| `max_comments` | Cap on comments per post. Default 50, max 1000. Instagram serves ~12–15 per API page, so larger caps mean more requests. |
| `max_posts` | When a username is given, how many recent posts to pull comments from. Default 12, max 100. Ignored for direct post URLs. |
| `proxyProvider` | `default` (residential proxy **included**), `dataimpulse`, `apify`, `custom` (uses `proxyUrls`), or `disabled`. |
| `proxyUrls` | Your own gateway URLs, one per entry. Only read when `proxyProvider` is `custom`. |
| `proxy` | Apify Proxy group + country, read when `proxyProvider` is `apify`. Its country also sets the exit country for the built-in providers. |

### Instagram comment data output

Each dataset row is one comment. Sample row:

```json
{
  "comment": {
    "pk": "17919229620205994",
    "text": "Those are my initials too 👽",
    "created_at": "2026-08-03T02:31:51Z",
    "like_count": 0,
    "reply_count": null,
    "parent_id": null,
    "owner_username": "an_instagram_user",
    "owner_id": "16872033002",
    "owner_is_verified": false,
    "owner_profile_pic_url": "https://scontent-scl3-1.cdninstagram.com/v/..."
  },
  "post_shortcode": "Dbdo4gTupuE",
  "post_url": "https://www.instagram.com/p/Dbdo4gTupuE/",
  "owner_username": "nike",
  "scraped_at": "2026-08-03T02:35:00Z"
}
```

> The shape above is a real captured row; the commenter's handle is replaced with
> a placeholder, since a private individual's username does not belong in public
> documentation. Post owners shown elsewhere (`nike`, `zara`) are public brand
> accounts.

| Field | Description |
|---|---|
| `comment.pk` | Instagram's stable comment ID. |
| `comment.text` | The comment body. |
| `comment.created_at` | Timestamp the comment was posted. |
| `comment.like_count` | Likes on the comment. |
| `comment.reply_count` | Number of replies to the comment. |
| `comment.parent_id` | Parent comment `pk` for replies; `null` for top-level comments. |
| `comment.owner_username`, `comment.owner_id` | Comment author handle and user ID. |
| `comment.owner_is_verified` | Whether the author has a verified badge. |
| `comment.owner_profile_pic_url` | Author avatar URL. |
| `post_shortcode`, `post_url` | The post the comment belongs to. |
| `owner_username` | Handle of the post's owner. |
| `scraped_at` | ISO timestamp of the scrape. |

### How much it costs

This actor uses **pay-per-event** pricing — you pay for what you scrape, not for time.

| Event | USD |
|---|---|
| Actor start (per GB memory) | $0.005 |
| Comment scraped | $0.001 |

| Typical run (default 1 GB) | Cost |
|---|---|
| 1,000 comments | ~$1.005 |
| 5,000 comments | ~$5.01 |

Only successfully scraped comments are billed — blocked or failed requests cost nothing.

### Recommended proxies for Instagram

A residential proxy is **included** — leave **Proxy provider** on **Default**. Pick **Custom** and paste your own gateway URLs.

👉 **[Get DataImpulse residential proxies](https://dataimpulse.com/?aff=404588\&utm_source=apify)** (referral link)

### Why this Instagram comment scraper

- **No login, no credentials** — anonymous public-API access; nothing to store, nothing to get flagged.
- **HTTP-only** — no headless browser, so runs are fast and cheap versus browser-based scrapers.
- **Thread reconstruction** — `parent_id` on every reply lets you rebuild full comment threads.
- **CSV-ready flat rows** — no post-processing needed for spreadsheets or BI tools.
- **Open source** — the underlying `instagram-scraper` Python package ships a Typer CLI and a FastAPI server; the Apify wrapper is a thin layer.

### FAQ

**Do I need an Instagram account?** No. This scraper uses Instagram's anonymous public API — the same endpoints the browser hits before you log in. No credentials are required or stored, and deep comment pagination works without login.

**Why is a residential proxy required?** Instagram blocks datacenter IP ranges outright. Residential IPs are included by default, so there is nothing to set up.

**Which proxies work best for Instagram?** Residential — included by default. For your own scrapers we use [DataImpulse](https://dataimpulse.com/?aff=404588\&utm_source=apify) (referral link).

**How many comments can I scrape per post?** Instagram serves ~12–15 comments per API page and the scraper paginates up to your `max_comments` cap. Posts with tens of thousands of comments can hit rate limits — start with 50–200 and scale up if stable.

**Are replies included?** Yes. Replies come back as separate rows with a non-null `parent_id` pointing to their parent comment's `pk`, so you can reassemble threads.

**Is scraping Instagram comments legal?** This actor collects only publicly available data. You are responsible for complying with Instagram's terms and applicable laws (including GDPR/CCPA). Do not collect personal data without a lawful basis.

### Rate this actor ⭐

If the Instagram Comment Scraper saved you time, please **leave a review on its Apify Store page** — ratings help other people find it and tell us what to build next. Hit a bug or missing field? Open an issue through the actor's **Issues** tab and we'll fix it fast — recency and reliability are what keep this actor ranking.

### Related actors

Building a full Instagram data pipeline? Pair this actor with our other scrapers — same proxy config format, same Pydantic-validated output, all open source.

- **[Instagram Profile Scraper](https://apify.com/herus13/instagram-profile-scraper)** — scrape public Instagram profiles: bio, follower/following counts, post counts, and profile metadata. No login required.
- **[TikTok Profile Scraper](https://apify.com/herus13/tiktok-profile-scraper)** — scrape public TikTok profiles for cross-platform social monitoring.

# Actor input Schema

## `targets` (type: `array`):

<p>Direct post/reel URLs (comments on that post) or usernames (comments on the profile's recent posts). Example: <code>https://instagram.com/p/ABC123/</code>.</p>
## `max_comments` (type: `integer`):

<p>Cap on comments returned per post. IG serves ~12-15 per request, so larger caps mean more requests.</p>
## `max_posts` (type: `integer`):

<p>When a username is given, how many recent posts to pull comments from. Ignored for direct post URLs.</p>
## `proxyProvider` (type: `string`):

<b>Default</b> routes the run through DataImpulse residential IPs (falling back to Apify Proxy) and is <b>included in the price of the run</b> — leave it alone unless you have a reason. <b>Custom</b> uses the proxy URLs you enter below; <b>Apify Proxy</b> uses the proxy configuration below; <b>No proxy</b> is refused on this actor, because the site blocks direct connections. Leave this empty to keep the behaviour this actor already had.

## `proxyUrls` (type: `array`):

Only read when <b>Proxy provider</b> is <b>Custom</b>. One gateway URL per entry, e.g. <code>http://user:pass@host:port</code> — works with any provider that issues URLs (BrightData, Oxylabs, SmartProxy, your own). Leave empty for any other Proxy provider.

## `proxy` (type: `object`):

<p>Read when <b>Proxy provider</b> is <b>Apify Proxy</b> (group + country). Its country also sets the exit country for the built-in providers.</p>

## Actor input object example

```json
{
  "targets": [
    "https://www.instagram.com/p/Dbdo4gTupuE/"
  ],
  "max_comments": 50,
  "max_posts": 12,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Instagram comments with text, author, likes, replies, timestamp, and post context

# 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 = {
    "targets": [
        "https://www.instagram.com/p/Dbdo4gTupuE/"
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("herus13/instagram-comment-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 = {
    "targets": ["https://www.instagram.com/p/Dbdo4gTupuE/"],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("herus13/instagram-comment-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 '{
  "targets": [
    "https://www.instagram.com/p/Dbdo4gTupuE/"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call herus13/instagram-comment-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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