# Instagram Comments Scraper (`trend_wizard/instagram-comment-scraper`) Actor

Collects comments exposed on public Instagram posts and Reels to an . No login, cookies or proxies.

- **URL**: https://apify.com/trend_wizard/instagram-comment-scraper.md
- **Developed by:** [scraping track](https://apify.com/trend_wizard) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.75 / 1,000 results

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

Extract comments from publicly accessible Instagram posts and Reels with an anonymous browser-based scraper.

Collect comment text, usernames, timestamps, likes information, profile metadata, emojis, hashtags, mentions, and other useful details in structured JSON format.

No Instagram login credentials or authenticated account required.

### ✨ Key Features

- **Instagram Posts & Reels:** Collect comments from supported public Instagram post and Reel URLs.
- **Anonymous Collection:** Uses public-page access without an authenticated Instagram account.
- **Result-Based Scrolling:** Continues scrolling until your requested number of unique comments is collected or no additional comments are exposed.
- **Duplicate Removal:** Uses comment IDs to avoid duplicate records.
- **Comment Filtering:** Filter comments by date or text.
- **Unique Commenters:** Optionally retain one comment per commenter.
- **Structured Output:** Stores individual comments in an Apify dataset.
- **Unicode & Emoji Support:** Preserves Hindi, English, emojis, and mixed-language text.
- **Multiple URLs:** Process up to 50 Instagram URLs in one run.

### 🚀 How to Use

1. Open the Actor.
2. Enter one or more public Instagram post or Reel URLs.
3. Configure the result limit and optional filters.
4. Click **Start**.
5. Access the collected comments in the Dataset tab.

### ⚙️ Input Parameters

| Parameter | Description | Default |
|---|---|---|
| `postUrls` | Instagram post/Reel URLs (up to 50) | Required |
| `resultsLimit` | Maximum unique comments per post | 100 |
| `commentsSince` | Collect comments since a specified date | Optional |
| `containsText` | Filter comments using text terms | Optional |
| `uniqueCommenters` | Keep one comment per commenter | false |

#### Example Input

```json
{
  "postUrls": [
    "https://www.instagram.com/reel/DfEI6cfoq1t/",
    "https://www.instagram.com/p/POST_SHORTCODE/"
  ],
  "resultsLimit": 500,
  "commentsSince": "2026-10-29",
  "containsText": "amazing, giveaway",
  "uniqueCommenters": false
}
```

#### Understanding the result limit

- `100` collects up to 100 unique comments per post.
- `500` collects up to 500 unique comments per post.
- `1000` collects up to 1,000 unique comments per post.
- `0` attempts to collect all comments exposed by the anonymous page, stopping after four consecutive scrolling snapshots reveal no new unique comment IDs.

The requested limit is a target, not a guarantee. Actual results depend on what Instagram exposes during the run.

### 📊 Output Data

The Actor stores one dataset item per collected comment.

#### Comment information

| Field | Description |
|---|---|
| `id` | Unique comment ID |
| `text` | Comment text |
| `ownerUsername` | Commenter's username |
| `ownerId` | Commenter's account ID, when available |
| `ownerProfilePicUrl` | Commenter's profile picture URL, when available |
| `ownerIsVerified` | Verification status, when available |
| `isPostOwner` | Whether the commenter is the post owner, when determinable |
| `timestamp` | Comment timestamp |
| `likesCount` | Comment likes, when available |
| `position` | Position in the normalized results |
| `commentUrl` | Comment permalink, when available |

#### Text analysis and extracted entities

The output can also include:

- `textLength`
- `script`
- `mentions`
- `mentionsCount`
- `hashtags`
- `emails`
- `urls`
- `emojis`
- `emojiCount`
- `gifUrl`

#### Source post information

Each comment can include associated post information:

- `postUrl`
- `postId`
- `postShortcode`
- `postType`
- `postOwnerUsername`
- `postOwnerId`
- `postCaption`
- `postTimestamp`
- `postLikesCount`
- `postCommentsCount`

Unavailable metadata is returned as null rather than guessed.

### 📁 Run Summary

In addition to comment records, the Actor stores a per-post run summary in the default Key-Value Store under the `SUMMARY` key.

The summary includes:

- Input and canonical post URLs
- Number of comments collected
- Number of comments read
- Collection status
- Error or partial-result message
- Browser and access diagnostics
- Pagination and scrolling information
- Collection stop reason

### ❓ Frequently Asked Questions

**1. Do I need an Instagram account?**

No. The Actor uses anonymous access to publicly accessible Instagram pages. It does not require your Instagram username or password.

**2. Can it scrape private Instagram accounts?**

No. It is intended for publicly accessible posts and Reels. It does not bypass private-account restrictions.

**3. Can I collect all comments?**

You can set `resultsLimit` to `0` to attempt collection of all comments exposed to the anonymous page. Instagram may expose only a subset, so complete collection is not guaranteed.

**4. Why did I receive fewer comments than my requested limit?**

Instagram may expose fewer comments than requested, restrict public access, or stop providing additional comments. The Actor reports its collection status and stopping reason.

**5. Does it collect replies to comments?**

The current version targets top-level comments. Nested replies are not collected as separate comment records.

**6. Are commenter IDs and profile pictures always available?**

No. Some metadata is not exposed consistently in anonymous page data. Unavailable fields remain null.

**7. What happens when the same comment appears multiple times?**

Comments are deduplicated using their comment IDs before counting the unique results.

**8. Can I filter comments?**

Yes. Use `commentsSince` to filter by date and `containsText` to filter by text. Multiple comma-separated search terms are supported.

**9. Can I scrape multiple posts in one run?**

Yes. Provide multiple URLs in `postUrls`. The Actor supports up to 50 URLs per run.

**10. What does partial status mean?**

It means comments were collected, but the accessible anonymous data may be incomplete. It does not mean every comment was retrieved.

### 🔒 Privacy & Responsible Access

- No Instagram username or password is required.
- No authenticated Instagram account is used.
- No third-party scraping API is required.
- No proxy-based access circumvention is implemented.
- Login walls, security challenges, and access restrictions are not bypassed.
- Collection stops when access is restricted.

Use this Actor responsibly and ensure your use complies with applicable laws and Instagram's terms.

### 🎯 Who Can Use This Actor?

Useful for:

- Social media researchers
- Influencer marketing professionals
- Brand monitoring teams
- Market researchers
- Sentiment and engagement analysts
- Public-content research projects
- Data analysts and developers

### Start Collecting

Provide a public Instagram post or Reel URL, choose your result limit, and start collecting structured comment data.

**Built by TrendWizard.**

# Actor input Schema

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

Public https://www.instagram.com/p/..., /reel/... or /tv/... URLs (up to 50).

## `resultsLimit` (type: `integer`):

Stop once this many unique comments are collected. 0 = everything the anonymous page exposes.

## `commentsSince` (type: `string`):

Optional, e.g. 2026-10-29 or 2026-10-29T00:00:00Z.

## `containsText` (type: `string`):

Optional case-insensitive filter.

## `uniqueCommenters` (type: `boolean`):

Keep only the first comment from each commenter.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/reel/DfEI6cfoq1t/"
  ],
  "resultsLimit": 100,
  "uniqueCommenters": false
}
```

# Actor output Schema

## `comments` (type: `string`):

One dataset item per collected Instagram comment, including text, author metadata, timestamps, and extracted entities.

## `summary` (type: `string`):

Per-post collection status and access diagnostics saved under the SUMMARY key in the default key-value store.

# 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/reel/DfEI6cfoq1t/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("trend_wizard/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 = { "postUrls": ["https://www.instagram.com/reel/DfEI6cfoq1t/"] }

# Run the Actor and wait for it to finish
run = client.actor("trend_wizard/instagram-comment-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 '{
  "postUrls": [
    "https://www.instagram.com/reel/DfEI6cfoq1t/"
  ]
}' |
apify call trend_wizard/instagram-comment-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,trend_wizard/instagram-comment-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/59w1dR86qxVziepym/builds/wukZlQJdNp4OhpEZP/openapi.json
