# Instagram Comment Scraper: Export Post & Reel Comments (`xmolodtsov/instagram-comment-scraper`) Actor

Export public top-level Instagram post and reel comments with text, likes, timestamps and public usernames. Public Instagram data, no login. Replies and reply counts are not included. Export JSON, CSV or Excel.

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

## Pricing

from $1.20 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Export **public Instagram post and reel comments** as structured data: comment text, likes, timestamps, public usernames and source post links. Public Instagram data, no login. This Actor collects **top-level comments only**; replies and reply counts are not included.

![Instagram comment scraper mascot](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/instagram-comment-avatar.png)

### Quick start

1. Paste a public post or reel URL into **Instagram post or reel URLs**.
2. Set **Comments per post** and a run-wide **Maximum comments per run**.
3. Run the Actor, open the **Overview** dataset view, and export JSON, CSV or Excel.

The prefill collects up to 20 top-level comments from a Kew Gardens post:

```json
{
  "directUrls": ["https://www.instagram.com/p/DeMo26sqYhl/"],
  "resultsLimit": 20
}
```

For several posts, put each URL in the list. Posts run in input order. Use `resultsLimit: 0` to collect all reachable top-level comments, while retaining a suitable `maxItems` cap.

### Input

| Field | Default | Meaning |
|---|---|---|
| `directUrls` | Required; working prefill supplied | 1–100 public Instagram URLs or bare shortcodes |
| `resultsLimit` | `50` | Saved comments per post, 0–50,000; `0` means all reachable |
| `maxItems` | `1000` | Run-wide saved comment cap, 1–100,000; free limits also apply |

Accepted URLs use `instagram.com` or `www.instagram.com`, with `/p/`, `/reel/`, `/reels/` or `/tv/`. Query parameters are accepted. Inputs are trimmed and duplicates removed by post ID. Invalid entries are skipped with a warning when some entries are valid; entirely invalid input fails with `invalid:`.

No proxy field or account credentials are needed. Cloud runs always use Apify datacenter proxies. There is no residential or third-party proxy mode. Guest cookies and public page tokens are fetched automatically; the Actor does not use Instagram accounts, logins or session cookies.

### Output

One row is one top-level comment. This example is from a real proof run; commenter identity fields are replaced with placeholders, and the optional profile image is omitted for privacy:

```json
{
  "id": "18113165762164515",
  "text": "Spooky",
  "timestamp": "2026-10-17T07:54:49.000Z",
  "ownerUsername": "user_a",
  "ownerId": "123456789",
  "ownerProfilePicUrl": null,
  "ownerIsVerified": true,
  "likesCount": 0,
  "postUrl": "https://www.instagram.com/p/DeMo26sqYhl/",
  "postShortCode": "DeMo26sqYhl",
  "postId": "4002753864564050021",
  "inputUrl": "https://www.instagram.com/p/DeMo26sqYhl/",
  "scrapedAt": "2026-10-21T21:46:54.446Z"
}
```

![Real comment output with placeholder commenter handles](https://api.apify.com/v2/key-value-stores/2DxCOvbMjhvK3S1qP/records/instagram-comment-preview.png)

| Fields | Meaning |
|---|---|
| `id` | Exact comment ID as a string |
| `text` | Comment text, or null for a textless GIF/sticker comment |
| `timestamp` | Source creation time in ISO UTC, or null |
| `ownerUsername`, `ownerId` | Public username and exact string owner ID, when provided |
| `ownerProfilePicUrl`, `ownerIsVerified` | Public profile image URL and source verification boolean, or null |
| `likesCount` | Source comment likes count, or null |
| `postUrl`, `postShortCode`, `postId` | Canonical source URL, shortcode and exact string media ID |
| `inputUrl` | Trimmed input URL or shortcode that identified the post |
| `scrapedAt` | Collection time in ISO UTC |

Missing values are **null**, never empty strings. A comment without text remains a billable saved row. IDs stay strings so large values are not rounded. The source can return signed image URLs that expire; this Actor exports the URL and does not download images.

The order is **Instagram's default order**, preserved as returned by the logged-out query. It is not a newest-first or chronological guarantee. Replies are excluded, and there is no `repliesCount` field: Instagram does not reliably supply it to logged-out visitors. Public usernames and profile fields are returned as displayed, with no contact enrichment.

### Pricing

One **Comment** event (`apify-default-dataset-item`) is billed per saved dataset row. There is no start fee or add-on event. Duplicate comments within a run are not saved or charged again, including after an Actor reboot.

| Apify pricing tier | Per 1,000 saved comments |
|---|---:|
| FREE | $1.56 |
| BRONZE | $1.44 |
| SILVER | $1.32 |
| GOLD | $1.20 |
| PLATINUM / DIAMOND | $1.20 |

Example Actor result charges:

| Saved comments | BRONZE | GOLD |
|---|---:|---:|
| 100 | $0.144 | $0.12 |
| 1,000 | $1.44 | $1.20 |
| 5,000 | $7.20 | $6.00 |

These are Actor result-event totals; applicable platform charges and account credits follow your Apify plan. Set the run charge budget before starting a large export.

#### Is it free?

On the Apify free plan, this Actor allows **100 results per run and 20 runs per calendar month (UTC)**. These are limits set by the developer. Run 21 succeeds gracefully with a quota message before making target requests. The allowance resets on the first of the UTC month. Paid plans use the requested input limits. Apify's credits and billing rules still apply; the FREE pricing tier does not mean unlimited free usage.

### Reach and reliability

The Actor collects **the top-level comments Instagram shows to logged-out visitors; very large posts may expose fewer than the total count**. A private proof collected **1,533 top-level comments from Kew Gardens** (1,607 reported total) and **1,395 from LEGO** (1,855 reported total), each with a confirmed clean server end and no duplicate IDs. Displayed totals include replies and may include hidden or inaccessible comments. A requested limit is a cap, not a promised result count. Comments can be added, removed or reordered during collection.

- Posts with comments off, private/deleted posts and unknown items are recorded as not available when Instagram confirms this across fresh guest sessions. They do not stop later inputs. A valid empty answer is a possible result.
- The Actor tries two pinned comments query IDs first. Only if both return schema or persisted-query errors does it scan public page JavaScript for a replacement, caching that attempt per run. Blocks and network errors use bounded retries without discovery. A malformed connection or failed query is recorded as an `outdated` per-post outcome.
- Apparent server ends are checked on fresh guest sessions. A missing or repeating cursor, or a page that adds nothing while the server still promises more, is recorded as truncation. It is not reported as a clean end.
- `STATISTICS` records posts requested/done/not available/failed, per-post counts and end states, requests/pages, rows, refusals by code, query-ID source, truncations, transfer and wall time. Saved rows survive a later per-post error.
- A run with saved rows succeeds as partial after a later processing error or deadline. Zero rows succeed as “no results” only after confirmed empty/unavailable answers; otherwise the run fails with a reason token such as `blocked:`, `network:`, `timeout:`, `outdated:`, `invalid:` or `quota:`.
- The Actor stops starting requests before the platform timeout, flushes statistics, and succeeds with saved partial output. An exhausted charge budget stops collection and succeeds with “run budget reached.” Only saved rows count toward result charges.
- Reboots seed exact comment IDs and post counts from the existing dataset. Source pages may be fetched again, but saved comments are not pushed again. Deduplication applies within a run; separate runs are independent.
- Default memory is 256 MB, with a 512 MB maximum; the default timeout is 3,600 seconds. No source availability or exhaustive historical coverage is guaranteed.

### API and integrations

Send the same input JSON through Apify's API. Keep your Apify token in an environment variable:

```bash
curl -X POST \
  'https://api.apify.com/v2/acts/xmolodtsov~instagram-comment-scraper/run-sync-get-dataset-items' \
  -H "Authorization: Bearer $APIFY_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"directUrls":["https://www.instagram.com/p/DeMo26sqYhl/"],"resultsLimit":20}'
```

For large jobs, start an asynchronous run and download its dataset after completion. JSON, CSV and Excel exports work with spreadsheets and analytics pipelines. Use Apify integrations with n8n, Make, webhooks or scheduled runs to supply post URLs and consume output. The Actor does not create tasks or schedules automatically.

### Support

Open the Actor's Issues tab with your run ID, input and expected output. Do not include account credentials or private data.

### More scrapers from this developer

**TikTok:** [TikTok Search Scraper](https://apify.com/xmolodtsov/tiktok-search-scraper): Videos and creators for any keyword, pay per result · [TikTok Profile Scraper (Pay Per Result)](https://apify.com/xmolodtsov/tiktok-profile-scraper): Profiles, followers and latest posts by username · [TikTok Comments Scraper](https://apify.com/xmolodtsov/tiktok-comments-scraper): Comments and full reply threads from any video · [TikTok Hashtag Scraper](https://apify.com/xmolodtsov/tiktok-hashtag-scraper): Videos for any hashtag, with views, likes and music · [TikTok Sound & Music Scraper](https://apify.com/xmolodtsov/tiktok-sound-scraper): Videos that use a sound or song · [TikTok Top Ads Scraper](https://apify.com/xmolodtsov/tiktok-top-ads-scraper): Public Creative Center ad rankings, engagement, media and landing pages

**Social & news:** [Reddit Search Scraper](https://apify.com/xmolodtsov/reddit-scraper): Posts by keyword, subreddit or author · [Google News Scraper](https://apify.com/xmolodtsov/google-news-scraper): Google News results as clean full-text articles · [Threads Replies Scraper](https://apify.com/xmolodtsov/threads-replies-scraper): Public post replies, likes, authors and inline nested replies

**E-commerce:** [Prom.ua Product Search Scraper](https://apify.com/xmolodtsov/prom-ua): Prom.ua product search results, no browser needed · [Amazon Product Search & Bestsellers Scraper](https://apify.com/xmolodtsov/amazon-search-scraper): Search results, Best Sellers and product details from Amazon · [AliExpress Search Scraper](https://apify.com/xmolodtsov/aliexpress-search-scraper): AliExpress products by keyword with prices, orders and shipping · [AliExpress Product Reviews Scraper](https://apify.com/xmolodtsov/aliexpress-reviews-scraper): Public product reviews, ratings, buyer photos and follow-up feedback

**Maps & leads:** [Google Maps Scraper](https://apify.com/xmolodtsov/google-maps-scraper): Places, leads and emails from Google Maps

**Ads:** [Facebook Ad Library Scraper (Meta Ads Library)](https://apify.com/xmolodtsov/facebook-ads-library-scraper): Ads from the Meta Ad Library, with EU reach and payers · [Google Ads Transparency Scraper](https://apify.com/xmolodtsov/google-ads-transparency-scraper): Google ad creatives by advertiser or domain, with regional details

**Video:** [YouTube Transcript Scraper](https://apify.com/xmolodtsov/youtube-transcript-scraper): Transcripts, subtitles and captions from YouTube videos · [YouTube Shorts Scraper](https://apify.com/xmolodtsov/youtube-shorts-scraper): Shorts of any channel with exact views, likes and duration · [YouTube Channel Scraper](https://apify.com/xmolodtsov/youtube-channel-scraper): Every video of a channel, with channel stats · [YouTube Search Scraper](https://apify.com/xmolodtsov/youtube-search-scraper): Search results and videos for any keyword · [YouTube Comments Scraper](https://apify.com/xmolodtsov/youtube-comments-scraper): Comments, replies and likes from any video · [Bilibili Comments Scraper](https://apify.com/xmolodtsov/bilibili-comments-scraper): Public hot comments and reply threads by video or keyword

**Jobs:** [SEEK Job Listings Scraper](https://apify.com/xmolodtsov/seek-jobs-scraper): Public AU/NZ job listings, salaries and redacted descriptions

### Frequently asked questions

**Can I collect replies or reply counts?** No. This Actor exports top-level comments only. It leaves reply counts out rather than presenting unreliable guest values.

**Why is my result count below the post's total?** The total can include replies and inaccessible comments. The guest query may expose only a subset. Your input caps, free allowance, charge budget or run deadline can also stop collection. Inspect `STATISTICS` for the per-post outcome.

**Is it legal to scrape Instagram comments?** The Actor requests publicly accessible data without login and does not collect contact details. Public usernames, profile images and comment text can still be personal data. Public access alone does not establish permission for every reuse. Check applicable law, including GDPR/CCPA, Instagram terms and your intended purpose before collecting, retaining or republishing results.

**Can it access private posts?** No. No Instagram account credentials are accepted or used.

**Can I request newest first?** No. The Actor keeps Instagram's default guest-query order and does not promise chronological results.

# Changelog

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

# Actor input Schema

## `directUrls` (type: `array`):

1–100 public Instagram /p/, /reel/, /reels/ or /tv/ URLs, or bare shortcodes. Trimmed and deduplicated. Invalid entries are skipped when others are valid. No account login or cookies.

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

Maximum top-level comments saved per post. 0 means all reachable, subject to maxItems. Replies are not included; Instagram guest reach can be below the displayed total.

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

Run-wide comment cap, processing posts in input order. On the Apify free plan: 100 results per run and 20 runs per calendar month (UTC), limits set by the developer. Paid plans use the requested cap.

## Actor input object example

```json
{
  "directUrls": [
    "https://www.instagram.com/p/DeMo26sqYhl/"
  ],
  "resultsLimit": 20,
  "maxItems": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

One top-level comment per row: id, text, timestamp, ownerUsername, ownerId, ownerProfilePicUrl, ownerIsVerified, likesCount, postUrl, postShortCode, postId, inputUrl, scrapedAt. IDs are exact strings. Missing values are null; text can be null for stickers or GIFs. No replies or repliesCount.

# 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 = {
    "directUrls": [
        "https://www.instagram.com/p/DeMo26sqYhl/"
    ],
    "resultsLimit": 20
};

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

# Run the Actor and wait for it to finish
run = client.actor("xmolodtsov/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 '{
  "directUrls": [
    "https://www.instagram.com/p/DeMo26sqYhl/"
  ],
  "resultsLimit": 20
}' |
apify call xmolodtsov/instagram-comment-scraper --silent --output-dataset

```

## MCP server setup

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