# Instagram Comments Scraper (`harpoon/ig-comments-scraper`) Actor

Scrape public comments from Instagram posts and reels - text, author, likes, and timestamps.

- **URL**: https://apify.com/harpoon/ig-comments-scraper.md
- **Developed by:** [Harpoon](https://apify.com/harpoon) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.75 / 1,000 comments

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/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 — every comment on a post, as clean structured rows

Paste one or more public Instagram post or reel URLs and get their comments back as structured
rows: comment text, author username, likes, reply count, and timestamp. Set how many comments to
pull per post and download the result as JSON, CSV, Excel, or XML. No login, cookies, or API key
required.

#### What can Instagram Comments Scraper do?

- Pull comments from one post or thousands in a single run
- Accept post and reel URLs, or bare shortcodes (`Dc1MK-6z3Gh`)
- Return comment text, author details, likes, reply count, and timestamp
- Keep the feed order and deduplicate repeated posts automatically
- Export to JSON, CSV, Excel, or XML; run via the API, schedule runs, and connect through MCP

### What data can I extract?

<table>
<tr><th>What you get</th><th>Features</th></tr>
<tr><td>

- **Comment** — comment ID, full text, created time, covered/hidden flag
- **Author** — username, user ID, verified status, profile picture
- **Engagement** — like count and reply count per comment
- **Target** — media ID, post shortcode, canonical post URL for joining

</td><td>

- Top-level comments, paginated up to your chosen cap
- One row per comment, keyed by comment ID
- Export to JSON, CSV, Excel, XML
- API access, webhooks, scheduling, LLM-ready output for MCP

</td></tr>
</table>

### How to use Instagram Comments Scraper

1. [Create](https://console.apify.com/sign-up) a free Apify account.
2. Open **Instagram Comments Scraper** in Apify Console.
3. Paste one or more public post or reel URLs into **Posts / Reels**, one per line.
4. Set **Max comments per post** (default 100).
5. Click **Save & Start**.
6. Download the results in JSON, CSV, Excel, or XML from the **Storage** tab.

### Input

Give it a list of posts; each one contributes its own comments to the dataset. For each post the
Actor reads the comments and stops at your cap.

- `posts` — public post or reel URLs, or bare shortcodes.
- `max_comments` — how many top-level comments to return per post (default 100).

**Example input**

```json
{
  "posts": ["https://www.instagram.com/reel/Dc1MK-6z3Gh/", "https://www.instagram.com/p/DcU4X0MlePc/"],
  "max_comments": 100
}
```

See the **Input** tab above for every parameter.

### Output

Results land in a dataset under the **Storage** tab. Three built-in views are included:
**Overview**, **Authors**, and **Engagement**. Download in JSON, CSV, Excel, or XML, or pull them
via the API.

```json
{
  "media_id": "3978139377163268513",
  "shortcode": "Dc1MK-6z3Gh",
  "post_url": "https://www.instagram.com/p/Dc1MK-6z3Gh/",
  "id": "18413957944157434",
  "text": "Hey Judy. See you on Nov 13",
  "created_at": 1789645609,
  "author_username": "bayannyc",
  "author_id": "1455667077",
  "author_pk": "1455667077",
  "author_is_verified": false,
  "author_profile_pic_url": "https://scontent.cdninstagram.com/v/t51.2885-19/251671921_615884486522584_n.jpg",
  "like_count": 0,
  "child_comment_count": null,
  "is_covered": false,
  "scraped_at": "2026-09-17T14:11:12Z"
}
```

Field names are lowercase snake\_case, and the input keys match them. Long URLs are abbreviated for
readability — the dataset contains the full links.

### What can you do with the data?

#### 1. Understand how a post landed

1. Run the Actor on your own or a competitor's post.
2. Open the **Overview** view and sort by `like_count`.
3. Read the top comments to see what resonated.

#### 2. Build a comment corpus for text analysis

1. Run the Actor with a higher `max_comments`.
2. Export the dataset to CSV or JSON.
3. Feed the `text` column into sentiment, topic, or keyword analysis.

#### 3. Track commenters / moderate

1. Run the Actor over recent posts.
2. Use the **Authors** view to see who is commenting and whether they are verified.
3. Join rows back to the post with `post_url` or `media_id`.

### How much does Instagram Comments Scraper cost?

This Actor is billed **per comment returned** (pay-per-event) on top of standard Apify platform
usage. A run over 10 posts at 100 comments each is billed as up to 1,000 results; posts with fewer
comments than the cap are billed for what they return.

See the **Pricing** tab for current rates and your plan's discounts.

### FAQ

**Do I need an Instagram account, cookies, or an API key?**
No. The Actor reads publicly available comments, so no login or credentials are required.

**Does it include replies?**
No — it returns **top-level comments**. `child_comment_count` tells you how many replies a comment
has, when the source exposes it.

**Can it scrape comments on private posts?**
No. Only public posts and reels have readable comments; private or restricted posts are reported
in the run log and skipped.

**How many comments can I get per post?**
Up to `max_comments` (default 100). Raise it for more; large pulls take longer and are billed per
comment returned.

**Is it legal to scrape Instagram?**
Comment text and author names are personal data. Only collect it when you have a legitimate
reason, and follow Apify's legal guidance and the terms that apply to your use case.

**Can I use it with the API, SDKs, or MCP?**
Yes — see the **API** tab above, or connect through the Apify MCP server.

**A post is missing from the results.**
That post is logged with the reason (for example, it does not exist, has comments disabled, or was
temporarily throttled). The rest of the run continues; re-run just that post if needed.

### Notes and limitations

- **Top-level comments only.** Replies are not returned; `child_comment_count` gives the reply
  count where available (`null` when the source does not expose it).
- **No like/date filters.** Instagram does not paginate comments by date, so the newest comments
  are returned first up to `max_comments`.
- `created_at` is a Unix timestamp in UTC.
- `is_covered` marks comments the platform has hidden from general view.
- `author_profile_pic_url` is a time-limited image link; download it soon after the run if you need
  it.
- Comments and author names are personal data — handle the results accordingly.

### Run locally

```
go run ./cmd/actor
```

Input is read from the Apify key-value store; see `INPUT_SCHEMA.json`.

### Support

Found a bug or have feedback? Open an issue in the **Issues** tab.

# Actor input Schema

## `posts` (type: `array`):

<b>Public post or reel URLs</b>, or bare shortcodes, one per line. Accepts <code>https://www.instagram.com/reel/Dc1MK-6z3Gh/</code>, <code>https://www.instagram.com/p/Dc1MK-6z3Gh/</code>, or <code>Dc1MK-6z3Gh</code>. Duplicates are removed automatically, and every post returns its own set of comments.

## `max_comments` (type: `integer`):

How many top-level comments to return per post, newest first. Higher values take longer and increase cost.

## Actor input object example

```json
{
  "posts": [
    "https://www.instagram.com/reel/Dc1MK-6z3Gh/",
    "https://www.instagram.com/p/DcU4X0MlePc/"
  ],
  "max_comments": 100
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per scraped comment. Export as JSON, CSV, Excel, or XML.

# 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 = {
    "posts": [
        "https://www.instagram.com/reel/Dc1MK-6z3Gh/"
    ],
    "max_comments": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("harpoon/ig-comments-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 = {
    "posts": ["https://www.instagram.com/reel/Dc1MK-6z3Gh/"],
    "max_comments": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("harpoon/ig-comments-scraper").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 '{
  "posts": [
    "https://www.instagram.com/reel/Dc1MK-6z3Gh/"
  ],
  "max_comments": 100
}' |
apify call harpoon/ig-comments-scraper --silent --output-dataset

```

## MCP server setup

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

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/raSMBm2BneUpCQ0dR/builds/UzdYqMlbdpW1XgxD9/openapi.json
