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

Scrape every public comment on any Instagram post or reel, not just the first page. One row per comment with the text, author, like count, reply count and date. Sort by popular, recent or verified. No Instagram login needed.

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

## Pricing

from $1.02 / 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.
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 — Every Comment, Not Just the First Page

Paste one or more Instagram post or reel URLs. Get every public comment back as rows — the text, who wrote it, how many likes and replies it got, and when.

No login, no cookie, no session.

### Quick start

```json
{
  "codes": ["https://www.instagram.com/p/DbL6n0ggXDZ/"],
  "commentsSortType": "popular",
  "limit": 500
}
```

`codes` accepts a full post or reel URL, a shortcode, or a numeric media ID — whichever you have.

### What you get

One row per comment.

| Column | What it holds |
|---|---|
| `text` | The comment itself |
| `author_username` | Who wrote it |
| `author_full_name` | Their display name |
| `author_is_verified` | Whether they're verified |
| `like_count` | Likes on the comment |
| `reply_count` | Replies to it |
| `created_at` | Unix timestamp it was posted |
| `comment_id` | Instagram's ID for the comment |
| `source_code` | Which post it came from |

```json
{
  "text": "This is incredible",
  "author_username": "someone",
  "author_full_name": "Some One",
  "author_is_verified": true,
  "like_count": 4,
  "reply_count": 1,
  "created_at": 1700000000,
  "comment_id": "17912345678901234",
  "source_code": "DbL6n0ggXDZ"
}
```

`source_code` is what keeps a multi-post run readable — every row says which post it belongs to, so you can throw several URLs in at once and split the sheet afterwards.

### Sort order

`commentsSortType` decides which comments you get first, which matters whenever `limit` is smaller than the real comment count.

- **`popular`** (default) — the comments Instagram surfaces at the top. What you want for reading the room.
- **`recent`** — newest first. What you want for monitoring an active post.
- **`verified`** — comments from verified accounts only.

### Limits and cost

`limit` is the total number of comments across the whole run, not per post. `0` means everything.

Set it deliberately on a viral post: a post with 40,000 comments will happily return 40,000 rows, and each one is billed.

### Interrupted runs

Long comment walks are exactly the runs the platform migrates mid-way. This Actor checkpoints which post it's on, which page, and how far into that page — so a migrated run picks up at the comment it stopped on rather than re-pushing the pages it already wrote.

### FAQ

**Does this get replies too?**
Replies are counted per comment in `reply_count`, but the reply threads themselves are not expanded into their own rows.

**Why did I get fewer comments than the post shows?**
The count on a post includes replies, and it includes comments from accounts that have since been deleted or made private. The number of top-level comments actually retrievable is normally lower.

**Can I use a private post?**
No. The post has to be public.

**Do I need an Instagram login?**
No. Everything here is public data, fetched without a session.

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**
More Instagram Actors: **https://apify.com/toolzerhub**

# Actor input Schema

## `codes` (type: `array`):

Instagram media shortcodes, numeric media IDs, or full post/reel URLs.

## `commentsSortType` (type: `string`):

Sort order for attached comments. Only used when Include Comments is on.

## `limit` (type: `integer`):

Stop after this many rows per account (0 = pull the whole list)

## Actor input object example

```json
{
  "codes": [
    "DDPp2UWzWEm"
  ],
  "commentsSortType": "popular",
  "limit": 100
}
```

# Actor output Schema

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

Every record collected during this run

# 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 = {
    "codes": [
        "DDPp2UWzWEm"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/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 = { "codes": ["DDPp2UWzWEm"] }

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/instagram-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 '{
  "codes": [
    "DDPp2UWzWEm"
  ]
}' |
apify call toolzerhub/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

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