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

Scrape public Instagram post comments and turn them into structured rows with usernames, timestamps, engagement counts, owner metadata, and direct comment URLs.

- **URL**: https://apify.com/apple\_yang/instagram-comments-scraper.md
- **Developed by:** [APISmith](https://apify.com/apple_yang) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

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

Scrape public Instagram post comments and turn them into structured rows with usernames, timestamps, engagement counts, owner metadata, and direct comment URLs.

Paste one or more Instagram post URLs, run the Actor, and export the comments to JSON, CSV, or your workflow without manually opening each post in a browser.

### What you get

For each public Instagram post URL you submit, the Actor returns a batch of comment records with:

- comment text and direct comment URL
- username, user ID, and owner profile metadata
- created timestamp and comment engagement counts

### Why use this Actor

- Pull comments from multiple Instagram posts in one run instead of opening each post manually.
- Collect comments in a structured format for analysis, moderation, reporting, or downstream AI workflows.
- Keep the output easy to export and integrate into spreadsheets, scripts, dashboards, and APIs.
- Handle multiple URLs in one batch without needing a browser session.

### Short output example

```json
[
  {
    "id": "18099948950110378",
    "comment_url": "https://www.instagram.com/p/DcvbKxGlSm7/c/18099948950110378",
    "text": "My friends who buy fr SHEIN never once say the quality is good",
    "user_id": "286570646",
    "username": "3388boo",
    "created_at": 1788258442,
    "child_comment_count": 0,
    "comment_like_count": 12,
    "owner": {
      "id": "286570646",
      "username": "3388boo",
      "full_name": "3388boo",
      "is_private": true,
      "is_verified": false,
      "profile_pic_url": "https://..."
    },
    "input_url": "https://www.instagram.com/p/DcvbKxGlSm7",
    "errMsg": "",
    "timestamp": "2026-09-14T06:16:14.821Z"
  }
]
```

### Quick start

1. Open the Actor in Apify Console.
2. Add one or more public Instagram post URLs in `videoUrls`.
3. Set `resultsLimit` to the maximum number of comments you want per URL.
4. Click Start.
5. Open the Dataset when the run finishes and export the results.

Example input:

```json
{
  "videoUrls": [
    "https://www.instagram.com/p/DcvbKxGlSm7"
  ],
  "resultsLimit": 14
}
```

### Input

The Actor accepts a JSON object with the exact fields below.

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

#### Input fields

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `videoUrls` | array of strings | Yes | None | Public Instagram post or reel URLs to scrape comments from. |
| `resultsLimit` | integer | Yes | 14 | Maximum number of comment results to return per URL. The code enforces a hard cap of 100. |

Notes:

- `videoUrls` is processed one by one in a single run.
- Invalid or empty URLs are recorded with an `errMsg` instead of silently disappearing.
- A batch can contain several URLs; each URL is processed independently.

### Output

The Actor pushes a dataset item for each comment, and it also includes an error row if an input URL is empty or unreachable.

#### Output fields

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | Comment ID from Instagram. |
| `comment_url` | string | Direct comment URL. |
| `text` | string | Comment text. |
| `user_id` | string | Comment author user ID. |
| `username` | string | Comment author username. |
| `created_at` | number | Unix timestamp for comment creation. |
| `child_comment_count` | number | Number of replies attached to the comment. |
| `comment_like_count` | number | Number of likes on the comment. |
| `owner` | object | Nested metadata for the comment author, including profile details and verification status. |
| `input_url` | string | Original post URL passed to the Actor. |
| `errMsg` | string | Error message for invalid or empty input; empty string on successful records. |
| `timestamp` | string | ISO timestamp when the result was recorded. |

### Common use cases

- Social listening — collect comment sentiment and discussion around public Instagram posts.
- Creator research — track recurring reactions and community feedback on content you follow.
- Brand monitoring — review public responses to campaigns, product launches, or announcements.
- Moderation support — review large comment volumes in a structured format for reporting or triage.
- AI workflows — feed extracted comment text and metadata into downstream classification, summarization, or search pipelines.

### Pricing

This Actor follows the standard Apify pricing model for the run. The runtime cost depends on your Apify plan and the current pricing shown in Apify Console, not on a custom per-comment fee coded in the Actor itself.

For a predictable estimate, check the pricing page in the Apify Console before running large batches. The Actor does not add a separate hidden fee per result.

### API and automation

You can run this Actor through the Apify API and connect it to scheduled jobs, exports, or downstream automation.

```bash
curl "https://api.apify.com/v2/acts/instagram-comments-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "videoUrls": [
      "https://www.instagram.com/p/DcvbKxGlSm7"
    ],
    "resultsLimit": 20
  }'
```

JavaScript example:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('instagram-comments-scraper').call({
    input: {
        videoUrls: ['https://www.instagram.com/p/DcvbKxGlSm7'],
        resultsLimit: 20,
    },
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.slice(0, 5));
```

Python example:

```python
import os
from apify_client import ApifyClient

client = ApifyClient(token=os.environ['APIFY_TOKEN'])

run = client.actor('instagram-comments-scraper').call(
    input={
        'videoUrls': ['https://www.instagram.com/p/DcvbKxGlSm7'],
        'resultsLimit': 20,
    }
)

items = client.dataset(run['defaultDatasetId']).list_items()
print(items['items'][:5])
```

### FAQ

#### Can I scrape comments from multiple posts in one run?

Yes. Add several URLs to `videoUrls` and the Actor will process each URL sequentially in the same run.

#### Does it work with private or login-gated Instagram posts?

No. This Actor targets public Instagram post URLs. Private, hidden, or login-restricted content may return no data or an error record.

#### What happens if a URL is invalid or empty?

The Actor records the input with an `errMsg` instead of silently dropping it, so you can see exactly what failed.

#### Is there a hard limit on the number of comments returned?

Yes. `resultsLimit` is the per-URL ceiling.

### Limitations

- Public Instagram post URLs only; private or login-restricted content is not supported.
- Some posts may return no comments or empty data depending on Instagram availability.
- The implementation reads comments from the provided post URLs; it does not crawl an entire account or profile feed.
- The results are constrained by Instagram response availability and the `resultsLimit` cap.

### Responsible use

Use this Actor only for public data you are permitted to access and process. Make sure your usage complies with Instagram's terms, applicable privacy laws, and relevant platform policies.

### Support

Need help or want to report an issue? Contact support@apismith.online.

When reporting a bug, include the Apify Run ID, the related input URL, the returned `status` or `errMsg`, and any non-sensitive data needed to reproduce the issue. Do not send tokens, cookies, passwords, or authorization headers.

# Actor input Schema

## `videoUrls` (type: `array`):

The post urls of the instagram you want to get the data from.

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

The maximum number of results to return.

## Actor input object example

```json
{
  "videoUrls": [
    "https://www.instagram.com/p/DcvbKxGlSm7"
  ],
  "resultsLimit": 14
}
```

# Actor output Schema

## `results` (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 = {
    "videoUrls": [
        "https://www.instagram.com/p/DcvbKxGlSm7"
    ],
    "resultsLimit": 14
};

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

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

```

## MCP server setup

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