# Instagram Comments Scraper (`fetch_cat/instagram-comments-scraper`) Actor

Extract public Instagram comments from post and Reel URLs with author usernames, text, timestamps, likes, reply counts, and source URLs.

- **URL**: https://apify.com/fetch\_cat/instagram-comments-scraper.md
- **Developed by:** [Hanna Nosova](https://apify.com/fetch_cat) (community)
- **Categories:** Social media, Marketing, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.60 / 1,000 comment saveds

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 Comments Scraper

Extract public comments from Instagram posts and Reels. Give the Actor one or more public Instagram post URLs and it exports comment authors, text, relative timestamps, visible like counts, visible reply counts, source post URLs, and scrape timestamps to an Apify dataset.

This Actor is useful when you need comment data in a structured format for research, social listening, creator reporting, campaign QA, moderation workflows, or downstream analysis in spreadsheets, BI tools, and AI agents.

### What can you do with this Actor?

- Export public comments from Instagram post, Reel, and TV URLs.
- Collect usernames, comment text, visible timestamps, likes, and reply counts.
- Process multiple post URLs in one run with a shared maximum result limit.
- Send results to Apify datasets, webhooks, integrations, API clients, or MCP tools.
- Schedule repeat checks for a known set of public posts.

### Who is it for?

- Social media teams monitoring campaign posts.
- Agencies reporting engagement and audience responses.
- Researchers studying public discussions on specific posts.
- Support and moderation teams reviewing public feedback.
- Developers building Instagram comment data pipelines on Apify.

### Input example

```json
{
  "startUrls": [
    { "url": "https://www.instagram.com/p/DN8-GjPkgjS/" }
  ],
  "maxItems": 20,
  "maxLoadMoreAttempts": 3
}
```

### Input settings

| Field | Type | Description |
| --- | --- | --- |
| `startUrls` | array | Public Instagram post, Reel, or TV URLs to extract comments from. |
| `maxItems` | integer | Maximum comment rows to save across all input URLs. |
| `maxLoadMoreAttempts` | integer | How many times to scroll or use public comment-loading controls per post. |

### Output example

```json
{
  "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/",
  "postShortcode": "DN8-GjPkgjS",
  "commentId": "RE44LUdqUGtnalN8dXNlcnwxZCBhZ28",
  "commentUrl": null,
  "ownerUsername": "example_user",
  "text": "Great post!",
  "postedAtText": "1d ago",
  "likesCount": 2,
  "repliesCount": null,
  "isReply": false,
  "scrapedAt": "2026-08-02T20:53:22.000Z"
}
```

### Output fields

| Field | Description |
| --- | --- |
| `postUrl` | Source Instagram post URL from the input. |
| `postShortcode` | Instagram shortcode parsed from the URL. |
| `commentId` | Stable local ID for the scraped post/comment tuple. |
| `commentUrl` | Public comment permalink when available; otherwise `null`. |
| `ownerUsername` | Comment author username. |
| `text` | Comment text. |
| `postedAtText` | Relative timestamp displayed by Instagram. |
| `likesCount` | Like count shown on the comment when public. |
| `repliesCount` | Reply count shown when public. |
| `isReply` | Whether the row is parsed as a reply. |
| `scrapedAt` | ISO timestamp when the row was saved. |

### Ready-to-run examples

Open a public example to inspect its input, run it, or reuse it as a task:

- [Compare Instagram Post Comments](https://apify.com/fetch_cat/instagram-comments-scraper/examples/compare-instagram-post-comments)
- [Export Instagram Post Comments](https://apify.com/fetch_cat/instagram-comments-scraper/examples/export-instagram-post-comments)

#### Scrape one public post

```json
{
  "startUrls": [{ "url": "https://www.instagram.com/p/DN8-GjPkgjS/" }],
  "maxItems": 20,
  "maxLoadMoreAttempts": 3
}
```

#### Scrape several posts with a shared cap

```json
{
  "startUrls": [
    { "url": "https://www.instagram.com/p/DN8-GjPkgjS/" },
    { "url": "https://www.instagram.com/instagram/p/DbbY9pdm6Q2/" }
  ],
  "maxItems": 50,
  "maxLoadMoreAttempts": 6
}
```

### API usage

#### Apify CLI

```bash
apify call fetch_cat/instagram-comments-scraper --input-file input.json
```

#### JavaScript / Node.js

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('fetch_cat/instagram-comments-scraper').call({
  startUrls: [{ url: 'https://www.instagram.com/p/DN8-GjPkgjS/' }],
  maxItems: 20,
  maxLoadMoreAttempts: 3,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient('MY_APIFY_TOKEN')
run = client.actor('fetch_cat/instagram-comments-scraper').call(run_input={
    'startUrls': [{'url': 'https://www.instagram.com/p/DN8-GjPkgjS/'}],
    'maxItems': 20,
    'maxLoadMoreAttempts': 3,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/fetch_cat~instagram-comments-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":[{"url":"https://www.instagram.com/p/DN8-GjPkgjS/"}],"maxItems":20,"maxLoadMoreAttempts":3}'
```

### MCP and agent usage

Use Apify MCP to let AI agents run this Actor as a tool:

```text
https://mcp.apify.com/?tools=fetch_cat/instagram-comments-scraper
```

Add it to Claude Desktop or Claude Code with:

```bash
claude mcp add apify-instagram-comments "https://mcp.apify.com/?tools=fetch_cat/instagram-comments-scraper"
```

Example MCP server configuration:

```json
{
  "mcpServers": {
    "apify-instagram-comments": {
      "url": "https://mcp.apify.com/?tools=fetch_cat/instagram-comments-scraper"
    }
  }
}
```

Example prompts:

- "Run the Instagram Comments Scraper for these post URLs and return the top recurring themes."
- "Export public comments from this Reel and group them by positive, negative, and question comments."
- "Save the comment dataset and tell me which usernames appear more than once."

### Pricing

This Actor uses pay-per-event pricing: a small start event plus one result event for each comment saved. See the live [Pricing tab](https://apify.com/fetch_cat/instagram-comments-scraper/pricing) for current rates in your plan tier.

### Tips for better results

- Use direct post or Reel URLs, not profile URLs.
- Keep the first run small, then raise `maxItems` after confirming the target post is public.
- Increase `maxLoadMoreAttempts` only when you expect many comments on a single post.
- Use several smaller runs instead of one very large run when monitoring unrelated posts.

### Limitations

- Only public comments visible on public Instagram post pages can be exported.
- Private posts, deleted posts, login-only comments, and account-specific views are not supported.
- Instagram may hide some likes, replies, timestamps, or comment permalinks from public views; missing values are saved as `null` instead of guessed.
- Very large comment threads may expose fewer rows publicly than the visible in-app count.

### Data exports and integrations

Results are saved to the default Apify dataset. You can export the dataset as JSON, CSV, XLSX, XML, HTML, or RSS, or connect it to webhooks, Make, Zapier, Google Sheets, S3, data warehouses, and custom API consumers.

### FAQ

#### Do I need Instagram login cookies?

No. This build is designed for public post URLs and does not require personal Instagram accounts, cookies, or private credentials.

#### Can it scrape private posts?

No. Private, deleted, restricted, or login-only posts are outside the supported public-data scope.

#### Why are some counts null?

Instagram does not display every like, reply, or permalink value for every public comment. Missing public values are saved as `null`.

#### Can I scrape replies?

The output schema includes reply-related fields. Publicly visible reply counts are captured when shown; individual nested replies depend on what Instagram exposes in the public post view.

#### Can I run it on a schedule?

Yes. Create an Apify task with your saved input and schedule it from the Apify Console, or trigger runs through the API.

#### How do I avoid duplicate analysis downstream?

Use `commentId` together with `postUrl` as a stable key for deduplicating repeated exports of the same public post.

### Related Actors

- [Instagram Post Details Scraper](https://apify.com/fetch_cat/instagram-post-details-scraper)
- [Instagram Profile Posts Scraper](https://apify.com/fetch_cat/instagram-profile-posts-scraper)
- [Instagram Reel Scraper](https://apify.com/fetch_cat/instagram-reel-scraper)
- [Instagram Hashtag Scraper](https://apify.com/fetch_cat/instagram-hashtag-scraper)
- [Instagram Search Scraper](https://apify.com/fetch_cat/instagram-search-scraper)

### Support

Questions or bug reports? Open an Apify issue from the Actor page and include the run ID, input URL, expected result, and a short description of what looked wrong.

# Actor input Schema

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

Public Instagram post, reel, or TV URLs to extract comments from. Logged-in-only/private posts are not supported.

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

Maximum number of comment rows to save across all input URLs.

## `maxLoadMoreAttempts` (type: `integer`):

How many times to scroll/click comment-loading controls on each post before parsing the rendered comments.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.instagram.com/p/DN8-GjPkgjS/"
    }
  ],
  "maxItems": 20,
  "maxLoadMoreAttempts": 6
}
```

# Actor output Schema

## `comments` (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 = {
    "startUrls": [
        {
            "url": "https://www.instagram.com/p/DN8-GjPkgjS/"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fetch_cat/instagram-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 = { "startUrls": [{ "url": "https://www.instagram.com/p/DN8-GjPkgjS/" }] }

# Run the Actor and wait for it to finish
run = client.actor("fetch_cat/instagram-comments-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 '{
  "startUrls": [
    {
      "url": "https://www.instagram.com/p/DN8-GjPkgjS/"
    }
  ]
}' |
apify call fetch_cat/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/6MNqndeFxhkTd2hMA/builds/NaLHKKaCyruRS7m5o/openapi.json
