# Instagram Comments Scraper — Top-Level Comments, No Login (`foxlabs/instagram-comments-scraper`) Actor

The top-level comments Instagram lists under public posts and reels, newest first, down to the first one: text, exact time, likes, GIF mark. Authors as codes, or with user names on request. Only-new mode for monitoring. No login, no cookies. Replies need a login and are not included.

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

## Pricing

$0.50 / 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.

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 — Top-Level Comments, No Login 🚀

**foXLabs Instagram series:** [Bulk Profile](https://apify.com/foxlabs/instagram-profile-scraper) · [Profile Posts](https://apify.com/foxlabs/instagram-profile-posts-scraper) · [Post Details](https://apify.com/foxlabs/instagram-post-details-scraper) · [Reels](https://apify.com/foxlabs/instagram-reels-scraper)

🎉 Give the addresses of public Instagram posts or reels and get the comments under them — the top-level comments Instagram lists for a signed-out visitor, newest first, down to the post's first comment or your limit: **text, time, like count, GIF flag**, and the post it stands under. Authors come as a stable code by default, or as user names on request. No login, no cookies, no account of anyone.

**Not affiliated with Instagram or Meta.**

### 🔍 What is the Instagram Comments Scraper — and when should you use it?

Give this Actor post/reel URLs and it returns their top-level comments as clean rows — for reading comment sections in bulk: community/brand teams, campaign reports, launch-reaction research.

**Use it when you need:** the comments under a set of posts (sentiment, topics, volume); privacy-safe comment exports (author codes); or an only-new comment feed.

**Use something else when:** you want the post's own metrics → [Post Details](https://apify.com/foxlabs/instagram-post-details-scraper); a whole profile's posts → [Profile Posts](https://apify.com/foxlabs/instagram-profile-posts-scraper).

### 🤖 Use with AI agents

**Already on the Apify MCP server?** Ask for this Actor by name: `foxlabs/instagram-comments-scraper`. An agent can discover it, run it and read the dataset over MCP; the Actor is built to run in Standby for on-demand lookups.

Otherwise paste this into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```
I want Instagram post comments using the Apify Actor
`foxlabs/instagram-comments-scraper`.

Input: `postUrls` is a list of post/reel URLs; `maxCommentsPerPost` caps per post; `includeAuthorNames`
adds usernames (off = codes). Each row has text, createdAt, likeCount, isGif, postOwnerUsername and
authorCode.

Start with:
{ "postUrls": ["https://www.instagram.com/p/DeJ28eTxo4s/"], "maxCommentsPerPost": 60 }

Ask me which posts to read, run the Actor, then summarise sentiment and top comments.
```

The machine-readable API, MCP config and OpenAPI definition live at `apify.com/foxlabs/instagram-comments-scraper.md`.

### 📋 Overview

Everything you need to turn a post's comment section into clean, structured data — text, time, likes and a privacy-safe author code — in one Actor, with no login, cookies or account.

**Why teams pick this Actor:**

- ✅ **Top-level comments to the end** — newest first, down to the post's first comment or your cap.
- 🕵️ **Privacy by default** — authors are a stable per-account code; names only with `includeAuthorNames`.
- 🎯 **Honest** — rows are fewer than Instagram's comment number (it counts replies + unlisted); the README says exactly why.
- 🔁 **Only-new monitoring** — schedule a post and get only new comments (oldest first).
- 💰 **Pay only for results** — one `comment` event per delivered row; status rows and remembered comments free.
- 🤖 **Agent-ready** — MCP + Standby.

### ✨ Features

- 🔍 **Comments by post/reel** — any address form, short code or id; up to 10,000 lines a run.
- 💬 **Per comment** — text, exact time, like count, `isGif`, position, verified-author flag.
- 🔐 **Author code** — HMAC code stable within your account; `includeAuthorNames` adds username + id.
- 📊 **Post context** — `postOwnerUsername`, `postCommentCount` (Instagram's number, larger than the rows).
- 🔁 **Only-new lists** for monitoring.

### 🎬 Quick Start

```bash
curl -X POST "https://api.apify.com/v2/acts/foxlabs~instagram-comments-scraper/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"postUrls": ["https://www.instagram.com/p/DeJ28eTxo4s/"], "maxCommentsPerPost": 60}'
```

### 🚀 Getting Started (3 steps)

1. **Paste your posts** — one per line: a post/reel URL, short code or id.
2. **Set the cap & authors** — `maxCommentsPerPost`; `includeAuthorNames` if you need names (else codes).
3. **Run and export** — get a clean dataset as JSON, CSV or Excel.

### 📥 Input

| Field | Default | What it does |
|---|---|---|
| `postUrls` | required | Post/reel addresses, one per line (up to 10,000); a line that is no post gets a free status row. |
| `maxCommentsPerPost` | 1000 | Comments per post, newest first (1–1,000,000). |
| `maxComments` | 100000 | Comments in total. |
| `includeAuthorNames` | false | Off = `authorCode` only; on = also `authorUsername` + `authorUserId`. |
| `onlyNewComments`, `listName` | false, `default` | Deliver only new comments (oldest first). |
| `proxyConfiguration` | auto | Nothing to change for normal use. |

```json
{ "postUrls": ["https://www.instagram.com/p/DeMw7vrDPS3/", "https://www.instagram.com/reel/DeCNJEyOkpq/"], "maxCommentsPerPost": 30, "includeAuthorNames": true }
```

### 📤 Output

One row per comment (`type: "comment"`); a free `type: "status"` row for a line that can't be delivered.

| Field | What it is |
|---|---|
| `postId`, `postShortCode`, `postUrl`, `postOwnerUsername`, `postCommentCount` | the post (Instagram's count is larger than the rows) |
| `commentId`, `positionInPost` | unique id; place in the list (1 = newest) |
| `text`, `createdAt`, `likeCount`, `isGif`, `isHidden` | the comment |
| `authorCode` | a stable per-account code for the author |
| `authorUsername`, `authorUserId` | with `includeAuthorNames` |
| `authorIsVerified`, `scrapedAt`, `input`, `error` | verified flag; when read; your line; reason on status rows |

```json
{ "type": "comment", "postShortCode": "DeJ28eTxo4s", "postOwnerUsername": "nasawebb", "postCommentCount": 500, "commentId": "179…", "positionInPost": 12, "text": "…", "createdAt": "2026-10-09T01:21:07.000Z", "likeCount": 3, "isGif": false, "authorCode": "0123456789abcdef", "authorIsVerified": false }
```

**Honest:** no replies (neither texts nor counts — Instagram doesn't give them to a signed-out visitor); rows are fewer than `postCommentCount` (which counts replies + unlisted — the posts we read listed 25–86% of it); newest-first only (sort by `likeCount` yourself).

### 💼 Use cases

**1. Campaign / launch reaction** — read the comment sections of a set of posts.
*Input:* the campaign URLs. *Output:* comments + likes + time. *Use:* sentiment and themes in aggregate.

**2. Privacy-safe research** — study reactions without storing names.
*Input:* posts, authors as codes (default). *Output:* comments with `authorCode`. *Use:* analysis within policy.

**3. Comment monitoring** — collect only-new comments as they arrive.
*Input:* a post, `onlyNewComments`, scheduled. *Output:* new comments each run. *Use:* a live comment feed.

### 🔗 Integration

**JavaScript / Node.js**

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });
const run = await client.actor('foxlabs/instagram-comments-scraper').call({ postUrls: ['https://www.instagram.com/p/DeJ28eTxo4s/'], maxCommentsPerPost: 60 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

**Python**

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')
run = client.actor('foxlabs/instagram-comments-scraper').call(run_input={'postUrls': ['https://www.instagram.com/p/DeJ28eTxo4s/'], 'maxCommentsPerPost': 60})
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)
```

Written for `apify-client` 3 for Python, where `call()` returns a run object; with version 1 or 2 it returns a dict — write `run['defaultDatasetId']` there.

**Automation (n8n / Zapier / Make):** schedule → HTTP request to the Actor API with your `postUrls` → handle the JSON dataset → push to a sheet, CRM or dashboard.

### 📊 Pricing

Pay per event: one **`comment`** per delivered comment row (also a row whose post query Instagram didn't answer). Status rows are free, and so are comments an only-new list still remembers. A run's spending limit is honoured. [View current pricing.](https://apify.com/foxlabs/instagram-comments-scraper)

### ❓ FAQ

**Do I need an Instagram login or cookies?** No — only the top-level comments a signed-out visitor sees.

**Why are there fewer rows than the comment count?** `postCommentCount` counts replies (not shown to a visitor) and unlisted comments; the rows are the top-level comments Instagram lists.

**Do I get replies?** No — neither their texts nor their number reach a signed-out visitor.

**Can I keep authors anonymous?** By default authors are a stable per-account code (a pseudonym, not anonymisation); turn on `includeAuthorNames` only when you need names and have a lawful reason.

**Can I export to CSV / Excel / JSON?** Yes — directly from the Apify dataset.

### 🐛 Troubleshooting / What it does NOT do

- **No replies, no reply counts** — not available to a signed-out visitor.
- **Fewer rows than the comment number** — expected (replies + unlisted counted in it).
- **Newest-first only** — there's no "most liked" order; sort by `likeCount` yourself.
- **A list can differ between readings** — a comment can be missing from one reading and back in the next; to be sure, read a post whole once more without the list and merge by `commentId`.
- **A line returns a status row** — not a post, no such post, comments off/limited, no comments yet, or unanswered (free, not charged).
- **A changed Instagram query** fails the run at its start-up check, before anything is read/charged.

### ⚠️ Trademark

Independent, third-party tool. Not affiliated with, endorsed by or connected to Instagram or Meta Platforms, Inc. "Instagram" and related marks belong to their owners and are used here for identification only.

### ⚖️ Is it legal to scrape this data?

The Actor reads only what a signed-out visitor sees. Comment texts are other people's words — they can contain sensitive information, and authors can be minors. By default the author is a per-account code (HMAC, kept in your account; a pseudonym, not anonymisation); `includeAuthorNames` adds the name/id. You are the controller: collect personal data only with a lawful reason, and prefer aggregate analysis (sentiment, topics, volume) over profiling individuals. The Actor writes only to your own run's storage. See Apify's blog post on the legality of web scraping.

### 🤝 Support & contact

- 🌐 **Website:** [data.foxlabs.com.tr](https://data.foxlabs.com.tr)
- 📧 **Email:** info@foxlabs.com.tr
- 🐛 **Issues:** open a ticket in the Actor's **Issues** tab — the run's `SOURCE_REPORT` record lists per-post counts and why the run stopped.
- 🧰 **More clean data actors:** [Fox Labs on Apify](https://apify.com/foxlabs)

### Changelog

#### 0.1.3 — 2026-10-10

- After an independent README review: `authorCode` is a keyed per-account code (same author → same code within your account; another account gets other codes; not reversible without the key); the start-up check asks the comments query itself; an only-new list handed back in circles counts as stopped; `listName` checked only when `onlyNewComments` is on; `postUrls` required; a proxy set in the input is the road of every request.

#### 0.1 — 2026-10-09

- First version: top-level comments of posts and reels, newest first, to the end; authors as codes unless names are asked for; only-new lists; free status rows; the `replyCount` column dropped (Instagram sent none); requests leave from the run's own address with Apify Proxy as the second road. Standby mode prepared.

# Changelog

This Actor's version history is a separate document: https://apify.com/foxlabs/instagram-comments-scraper/changelog.md

# Actor input Schema

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

Addresses of public Instagram posts or reels, one per line. Every form of the address works: instagram.com/p/…, /reel/…, /reels/…, /tv/…, with or without a user name in front or a ?query behind — or the short code alone (DeJ28eTxo4s), or the numeric post id. A line that is not a post, and a post Instagram does not show to a visitor who is not signed in, come back as a free status row that says why. Up to 10,000 lines a run. A line that is no post gets a free status row; an input with no usable line ends the run as failed, with the reason.

## `maxCommentsPerPost` (type: `integer`):

How many top-level comments to deliver for each post, newest first. Instagram gives up to 15 comments a request (about 14 on average), one request after the other for a post: 1,000 comments of one post are about 70 requests. Replies are not delivered: Instagram shows them only to signed-in visitors.

## `maxComments` (type: `integer`):

The run stops when this many comments have been delivered, over all posts. You are charged only for delivered comments.

## `includeAuthorNames` (type: `boolean`):

Off (the default): no row names its author. Every author appears as a short code (authorCode) that is the same for the same author in every row and every run, so you can count comments per author without holding names. On: the rows also carry the author's Instagram user name and user id, as Instagram's answer carries them (the id is not printed on the page). Turning this on means your dataset holds other people's names: you need a lawful reason to collect them, and you are responsible for how they are used.

## `onlyNewComments` (type: `boolean`):

Remember delivered comments under the list name below and skip them in later runs. Schedule the same posts and every run brings what was written since: the first run reads each post's newest comments up to "Maximum comments per post", every later run its new comments, and both deliver them oldest first. When more is due than a run delivers — more new comments than that number, or a run that stopped early — the rest is not lost: the next run delivers it, and the status message says how many comments are waiting.

## `listName` (type: `string`):

Name of the memory used by "Only comments not delivered before" (looked at only when that is on). Use a different name for each project. Letters, digits and hyphens (a hyphen not first or last), up to 40 characters; capitals are read as lower case.

## `proxyConfiguration` (type: `object`):

Nothing to change for normal use: requests leave from the run's own address, and the Actor moves to Apify Proxy by itself if Instagram turns that address away. Turn a proxy on here to send every request through it: the run then stays on that proxy, and a setting the platform refuses ends the run with a message before anything is read.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DeJ28eTxo4s/"
  ],
  "maxCommentsPerPost": 60,
  "maxComments": 100000,
  "includeAuthorNames": false,
  "onlyNewComments": false,
  "listName": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (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 = {
    "postUrls": [
        "https://www.instagram.com/p/DeJ28eTxo4s/"
    ],
    "maxCommentsPerPost": 60,
    "includeAuthorNames": false,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("foxlabs/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 = {
    "postUrls": ["https://www.instagram.com/p/DeJ28eTxo4s/"],
    "maxCommentsPerPost": 60,
    "includeAuthorNames": False,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("foxlabs/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 '{
  "postUrls": [
    "https://www.instagram.com/p/DeJ28eTxo4s/"
  ],
  "maxCommentsPerPost": 60,
  "includeAuthorNames": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call foxlabs/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

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