# Instagram Comments Scraper - Post & Reel Comments, No Login (`scrape_api/instagram-comments-scraper`) Actor

Instagram comments scraper for public posts and reels: export Instagram comments as rows with author handle, text, likes, UTC timestamp and GIF URL. No login or cookies needed; bulk export to CSV or JSON, newest first. Replies are unavailable.

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

## Pricing

$2.60 / 1,000 comment returneds

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

Instagram comments scraper for public posts and reels: export Instagram comments as individual top-level rows with the author's handle and profile ID, original text, likes, UTC timestamp and post shortcode. GIF comments include their image URL, even when their text is empty. No login or cookies are required, so a public post or reel link is the only thing you need.

Use the output for brand monitoring, audience research, influencer campaign reviews or sentiment datasets. Each comment belongs to a specific post, so you can combine exports from multiple campaigns while keeping their engagement separate. The scraper collects the comments that Instagram makes publicly available, newest first within each post. Replies are unavailable, and the post's displayed comment count can exceed the number of accessible rows.

### Instagram comments scraper input

Provide `urls` with one or more public post URLs, reel URLs or bare post shortcodes. You can also provide an `@handle` or profile URL to collect comments from that account's recent public posts. Up to 100 inputs are accepted. Duplicate posts are collected once, including when the same shortcode appears through different URL forms.

This input uses a real @natgeofamily post recorded during validation:

```json
{
  "urls": ["https://www.instagram.com/p/DfSzIWPJdRb/"],
  "maxCommentsPerPost": 100,
  "sortBy": "newest",
  "includeReplies": false
}
```

`maxCommentsPerPost` defaults to 100. It limits unique delivered comments per post across the whole run, including continuation pages. Values are clamped to the range 1–5000. A post with fewer accessible comments returns fewer rows. When you supply several posts, each post has its own limit; the limit is not a combined total for the entire input list.

`maxPostsPerProfile` defaults to 6 and is clamped to 1–12. It applies only to handles and profile URLs. The public profile view can expose fewer recent posts or no usable timeline. Use direct post links when you need a particular campaign or an older post. Profile discovery does not promise the account's complete posting history.

`sortBy` accepts only `newest`. Most-liked or top sorting is unavailable. Passing `top` is an input error. Rows for different posts can be interleaved, while the rows within each post remain newest first.

`includeReplies` defaults to false. Replies are unavailable with either value. Setting it to true returns a warning and the available top-level comments; it does not create reply rows or estimated reply counts.

### Output and exports

The default dataset contains one item per delivered top-level comment. Export it from Apify as JSON, CSV, Excel or another supported dataset format. The run's key-value store also contains a summary and any per-input errors. Empty-text comments remain valid rows: many contain a GIF, and some have neither text nor an available image.

In the summary, `comments` counts unique comments collected across continuation pages, and `commentsThisPage` sums the comments collected by those requests. These counts can exceed the delivered total when the free-user limit is reached. `itemCount` is the number of rows actually delivered to the dataset and used for comment billing.

The following excerpt is from an actual collected comment:

```json
{
  "comment_id": "17983593360129638",
  "post_id": "DfSzIWPJdRb",
  "author_handle": "mahnaz.safarchi",
  "text": "🙌🔥👏"
}
```

The full row contains `source`, `fetched_at`, `platform`, `comment_id`, `post_id`, `parent_comment_id`, `post_url`, `author_handle`, `author_id`, `text`, `posted_at`, `likes`, `media_id`, `author_is_verified`, `author_profile_pic_url`, `gif_url` and `position`. IDs are strings, including the numeric-looking IDs, so spreadsheet or database imports should preserve them as text.

`post_id` is the shortcode from the post URL. `media_id` is Instagram's numeric media identifier. `posted_at` records when the comment was created; `fetched_at` records when it was collected. `likes` is the count at collection time. `parent_comment_id` is always null because this product delivers top-level comments only. Profile picture and GIF links can expire or become unavailable after collection.

### Larger runs and continuation

Apify follows continuation pages automatically. Each request uses a bounded collection window, and the run continues until the per-post limit, the source's final page or the run budget is reached. A continued collection deduplicates comment IDs, so an overlapping source page does not produce additional billable duplicates.

Direct API responses include `items`, `summary`, `errors`, `warnings`, `partial` and `next_cursor`. A non-null continuation cursor means more work remains. Send it back promptly as `cursor` with the other inputs unchanged. Cursors are opaque; editing them or changing the input makes them invalid. If Instagram expires a continuation, restart the collection without that cursor.

A partial result preserves already collected rows. Review the warnings before treating an export as complete. If a post's continuation is repeatedly rejected, start that post again in a new request without `cursor`; any remaining `next_cursor` only continues the other unfinished posts. Deduplicate merged exports by `comment_id`. An inaccessible post in a mixed batch does not discard the comments from other readable posts. Posts that are missing, inaccessible or have no public comments do not produce fabricated data rows.

### Use cases for an Instagram comments export

- **Brand monitoring.** Track what people write under a campaign post or a product launch, per post and per day, without opening the thread by hand.
- **Engagement and sentiment analysis.** One row per comment carries text, likes and posting time, so a dataset can be scored for sentiment and grouped by hour or by post.
- **Influencer and creator reviews.** Export the comment section of a creator's recent posts to see who actually engages, whether the reactions are real and how much reach a paid placement produced.
- **Spam and moderation baselines.** Repeated promotional replies and link spam stand out once the text of a whole thread sits in one table.
- **Training and research data.** Public comment text with timestamps and like counts is a ready-made corpus for language models and social research, with ids that stay stable between exports.

Exports from several posts belong together: `post_id` keeps each thread separate, so a weekly batch of ten campaign posts can be appended to the same table. A batch of handles through `@handle` gives the recent posts of one account in a single run.

### Instagram comments scraper compared with the alternatives

| Option | What you get | Limits |
|---|---|---|
| Copying comments by hand | Whatever fits on the screen | Slow, and no comment ids, likes or timestamps |
| Browser extensions and export websites | A file for one post | One post at a time, a daily cap or a subscription, and no API to schedule |
| Instagram's own data tools | Data about your own account | Not the comment sections of other accounts |
| **This actor** | One structured row per top-level comment, for up to 100 posts or reels per run, no Instagram account needed | Top-level comments only, collected newest first |

Because the output is a plain dataset, runs can be scheduled, rows can go to Google Sheets, a webhook or your own database, and the comment rows can be joined with post metrics from another actor on the same platform. Compare the alternatives on what actually reaches your table: stable `comment_id` and `post_id` values, likes and posting time on every row, and billing per delivered comment instead of per seat.

### Pricing

Billing is per delivered comment row using the `comment` event. There is no start fee in this product's event map. Empty results have no comment charge. GIF-only and empty-text comments are real delivered comments and count as rows. Check the actor's current Pricing tab for the active amount before starting a large run.

Runs by non-paying Apify users are limited to ten delivered comments in total, including multi-post inputs. The same row billing applies to those delivered comments. The automatic continuation stops once that cap is reached. Paying users use the requested per-post limits.

### Frequently asked questions

#### Can I export Instagram comments to CSV or Excel?

Yes. Each run writes one row per delivered top-level comment to the default dataset, and that dataset downloads from Apify as JSON, CSV, Excel or another supported format. A single run can cover up to 100 post or reel links, so one export can hold a whole campaign instead of one thread. Import the CSV or Excel file with the id columns kept as text: `comment_id` and `post_id` look numeric but must not be rounded by a spreadsheet.

#### Does it collect replies?

Replies are unavailable. Only top-level comments are returned, and `parent_comment_id` remains null. Enabling `includeReplies` adds a warning so the limitation remains visible in the run output.

#### Why does the export contain fewer comments than the post counter?

Instagram's public comment connection can end before the displayed post count is reached. The counter and the accessible comment rows do not necessarily cover the same content. This scraper reports the rows actually received and does not promise that they match the visible total.

#### Can I sort by the most liked comments?

Only newest-first collection is supported. You can sort an exported dataset by `likes` for your own analysis, but that orders the collected sample and does not establish the most liked comments across the entire post.

#### Can I use it without an Instagram account?

Yes. You do not supply Instagram credentials or cookies. Supply public post or profile links. Private posts and content that Instagram does not expose publicly are outside the product's coverage.

#### Why are some text fields empty?

Instagram comments can contain a GIF instead of text. Check `gif_url` for an associated GIF. Other comments can also have empty text. The scraper preserves the original content instead of inserting a description or inferred text.

# Actor input Schema

## `urls` (type: `array`):

Public Instagram post or reel URLs, bare shortcodes, @handles or profile URLs. Up to 100 inputs; duplicates are removed. Strings accept one input per line or comma-separated inputs.

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

Maximum unique top-level comments per post, clamped to 1–5000 across continuation pages. Empty-text and GIF comments count as rows.

## `maxPostsPerProfile` (type: `integer`):

Recent public posts per @handle or profile URL, clamped to 1–12. Instagram may expose fewer posts.

## `sortBy` (type: `string`):

Newest first within each post. Top/most-liked sorting is unavailable and is rejected.

## `includeReplies` (type: `boolean`):

Replies are unavailable. Setting true returns a warning and top-level comments only.

## `cursor` (type: `string`):

Signed next_cursor from the preceding response. Keep the other inputs unchanged and continue promptly; upstream cursors can expire.

## Actor input object example

```json
{
  "urls": [
    "https://www.instagram.com/p/DfSzIWPJdRb/"
  ],
  "maxCommentsPerPost": 100,
  "maxPostsPerProfile": 6,
  "sortBy": "newest",
  "includeReplies": false
}
```

# Actor output Schema

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

One row per delivered top-level comment.

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

Run counts.

## `errors` (type: `string`):

Inputs that could not be read.

# 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 = {
    "urls": [
        "https://www.instagram.com/p/DfSzIWPJdRb/"
    ]
};

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

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

```

## MCP server setup

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