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

Scrape comments with Instagram Comments Scraper! Exports flat rows with comment\_id, text, created\_at, like\_count, child\_comment\_count, commented\_author\_username, profile\_pic\_url, is\_verified, user\_id, fbid\_v2, post\_url, post\_number\_link, and post\_author\_username ✨ Instagram Comments Scraper⚡

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

## Pricing

from $1.00 / 1,000 comments

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 ⚡ | Premium Public Post & Reel Comments Extractor

Welcome to the **Instagram Comments Scraper**! Earning its reputation as a premium, enterprise-grade public data harvesting solution, the **Instagram Comments Scraper** is designed specifically to extract public comments from any Instagram post or reel with high efficiency and reliability. 🚀

The **Instagram Comments Scraper** operates on a resilient, dual-phase pipeline architecture. It enables developers, businesses, research groups, and marketing agencies to harvest public comments, track brand mentions, analyze social sentiment, and monitor influencer feedback with absolute precision using the **Instagram Comments Scraper**.

With the **Instagram Comments Scraper**, you can bypass standard API limitations, and fetch fully structured flat dataset outputs. The **Instagram Comments Scraper** is the ultimate tool to extract, format, and organize public comment feeds instantly.

---

### 📥 Input Controls for Instagram Comments Scraper

Configuring the **Instagram Comments Scraper** is simple and highly customizable. It features the following input parameters:

*   🔗 **Post or Reel URLs** (`instagram_urls`): Direct URLs pointing to post feeds or reel pages (e.g. `https://www.instagram.com/p/DZp5vZeCPpB/`). The **Instagram Comments Scraper** converts these and scrapes their comment listings.
*   🌐 **Proxy Country** (`proxyCountry`): Residential proxy exit country (default is `US` for broad public availability).
*   💬 **Comments Limit Per Item** (`comments_limit`): This parameter determines the maximum comments the **Instagram Comments Scraper** will fetch for each link before stopping (default `30`).

---

### 📤 Output Fields in Instagram Comments Scraper

Every single record outputted by the **Instagram Comments Scraper** is clean, structured, and flat. In addition, the **Instagram Comments Scraper** completely removes null fields from the output, showing keys ONLY when they have actual data.

Here is a detailed breakdown of the fields provided by the **Instagram Comments Scraper**:

#### 1. Comment Attributes
*   `comment_id` (String): Unique alphanumeric identifier of the comment (e.g., `"18105017360285522"`).
*   `text` (String): The plain text comment written by the user.
*   `created_at` (String): Human-readable UTC creation timestamp formatted as an ISO datetime string (e.g., `"2026-06-18T09:33:15Z"`).
*   `like_count` (Integer): Total likes on this comment.
*   `child_comment_count` (Integer): Total reply comments count.
*   `did_report_as_spam` (Boolean): True if the comment was reported as spam.
*   `has_liked_comment` (Boolean): True if the viewing user has liked this comment.
*   `pk` (String): The primary key identifier of the comment.
*   `is_covered` (Boolean): True if the comment is hidden under sensitive content filters.
*   `is_edited` (Boolean): True if the comment has been edited.
*   `comment_like_count` (Integer): Alternative comment like count metric.
*   `__typename` (String): Internal GraphQL typename (e.g. `"XDTCommentDict"`).
*   `is_verified` (Boolean): True if the commenter's account is verified.
*   `id` (String): The identifier of the comment.
*   `is_unpublished` (Boolean): True if the comment is unpublished.
*   `profile_pic_url` (String): The avatar URL of the commenter.
*   `commented_author_username` (String): The username of the commenter who wrote the comment.
*   `fbid_v2` (String): Facebook internal identifier for the comment.
*   `user_id` (String): Unique user ID of the commenter.
*   `giphy_media_info` (Object - *Optional*): Omitted entirely if the comment is not a GIF. Shows GIPHY media URLs only when a GIF comment is present.

#### 2. Media Link Mapping (Additional Details)
*   `post_url` (String): The original URL of the post or reel from which this comment was scraped.
*   `post_number_link` (Integer): The 1-indexed number of the post/reel link in your input request list.
*   `post_author_username` (String): The username of the publisher who posted the media.

---

### 💻 JSON Output Sample from Instagram Comments Scraper

Here is a realistic example showing how the **Instagram Comments Scraper** outputs clean data. Note how `giphy_media_info` is present only when active, and keys with null values are completely pruned:

```json
[
  {
    "comment_id": "18095985296186315",
    "text": "Goat 🐐🇵🇹🏆🙌",
    "created_at": "2026-06-18T09:18:42Z",
    "like_count": 1,
    "child_comment_count": 0,
    "did_report_as_spam": false,
    "has_liked_comment": false,
    "pk": "68352871654",
    "is_covered": false,
    "giphy_media_info": {
      "first_party_cdn_proxied_images": {
        "fixed_height": {
          "url": "https://cdn.fbsbx.com/v/t59.2708-21/473001797_621391606949774_7636581239385040192_n.gif?_nc_cat=1&oh=03_Q7cD5&oe=6A359896"
        }
      },
      "images": {
        "fixed_height": {
          "url": "https://static.cdninstagram.com/rsrc.php/v4/yr/r/xg_5YoVlvjp.gif"
        }
      },
      "id": "1028585059724904"
    },
    "is_edited": false,
    "comment_like_count": 1,
    "__typename": "XDTCommentDict",
    "is_verified": false,
    "id": "68352871654",
    "is_unpublished": false,
    "profile_pic_url": "https://scontent-ord5-1.cdninstagram.com/v/t51.82787-19/696530186_17927502819279655_8079751383813488680_n.jpg?oh=00_Af-L0&oe=6A397E52",
    "commented_author_username": "___kaique_sousa",
    "fbid_v2": "17841468389644108",
    "user_id": "68352871654",
    "post_url": "https://www.instagram.com/p/DZp5vZeCPpB/",
    "post_number_link": 1,
    "post_author_username": "cristiano"
  },
  {
    "comment_id": "18105498784869846",
    "text": "🏆🏆🏆🏆",
    "created_at": "2026-06-18T09:17:40Z",
    "like_count": 1,
    "child_comment_count": 0,
    "did_report_as_spam": false,
    "has_liked_comment": false,
    "pk": "68352871654",
    "is_covered": false,
    "is_edited": false,
    "comment_like_count": 1,
    "__typename": "XDTCommentDict",
    "is_verified": false,
    "id": "68352871654",
    "is_unpublished": false,
    "profile_pic_url": "https://scontent-ord5-1.cdninstagram.com/v/t51.82787-19/696530186_17927502819279655_8079751383813488680_n.jpg?oh=00_Af-L0&oe=6A397E52",
    "commented_author_username": "___kaique_sousa",
    "fbid_v2": "17841468389644108",
    "user_id": "68352871654",
    "post_url": "https://www.instagram.com/p/DZp5vZeCPpB/",
    "post_number_link": 1,
    "post_author_username": "cristiano"
  }
]
````

***

### 📋 Logging and Progress Tracking in Instagram Comments Scraper

The **Instagram Comments Scraper** prints beautifully formatted console logs so you can monitor progress easily:

1. **Billing logs** are prefixed with `💸` to denote successful charging operations.
2. **Verbose network request logs** are logged as debug output to keep your standard run view clean.

Get started with the **Instagram Comments Scraper** today to experience the most reliable, clean, and professional comment scraping solution on the market! 🚀

# Actor input Schema

## `instagram_urls` (type: `array`):

Add one or more Instagram post or reel URLs (e.g. https://www.instagram.com/p/shortcode/ or https://www.instagram.com/reel/shortcode/).

## `proxyCountry` (type: `string`):

Select the residential proxy country for Instagram requests. US is recommended.

## `comments_limit` (type: `integer`):

Maximum number of comments to return for each post/reel link. Set higher limits for large posts (scrapes sequentially).

## Actor input object example

```json
{
  "instagram_urls": [
    {
      "url": "https://www.instagram.com/p/DZp5vZeCPpB/"
    },
    {
      "url": "https://www.instagram.com/reel/DZN0A4Mgx8-/"
    }
  ],
  "proxyCountry": "US",
  "comments_limit": 30
}
```

# 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 = {
    "instagram_urls": [
        {
            "url": "https://www.instagram.com/p/DZp5vZeCPpB/"
        },
        {
            "url": "https://www.instagram.com/reel/DZN0A4Mgx8-/"
        }
    ],
    "proxyCountry": "US",
    "comments_limit": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("premiumscraper/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 = {
    "instagram_urls": [
        { "url": "https://www.instagram.com/p/DZp5vZeCPpB/" },
        { "url": "https://www.instagram.com/reel/DZN0A4Mgx8-/" },
    ],
    "proxyCountry": "US",
    "comments_limit": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("premiumscraper/instagram-comments-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "instagram_urls": [
    {
      "url": "https://www.instagram.com/p/DZp5vZeCPpB/"
    },
    {
      "url": "https://www.instagram.com/reel/DZN0A4Mgx8-/"
    }
  ],
  "proxyCountry": "US",
  "comments_limit": 30
}' |
apify call premiumscraper/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=premiumscraper/instagram-comments-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Comments Scraper⚡",
        "description": "Scrape comments with Instagram Comments Scraper! Exports flat rows with comment_id, text, created_at, like_count, child_comment_count, commented_author_username, profile_pic_url, is_verified, user_id, fbid_v2, post_url, post_number_link, and post_author_username ✨ Instagram Comments Scraper⚡",
        "version": "1.0",
        "x-build-id": "WHWXyb3yqqC607PTu"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/premiumscraper~instagram-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-premiumscraper-instagram-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/premiumscraper~instagram-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-premiumscraper-instagram-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/premiumscraper~instagram-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-premiumscraper-instagram-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "instagram_urls"
                ],
                "properties": {
                    "instagram_urls": {
                        "title": "🔗 Post or Reel URLs",
                        "type": "array",
                        "description": "Add one or more Instagram post or reel URLs (e.g. https://www.instagram.com/p/shortcode/ or https://www.instagram.com/reel/shortcode/).",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "proxyCountry": {
                        "title": "🌐 Proxy Country",
                        "enum": [
                            "US",
                            "GB",
                            "AU",
                            "CA",
                            "DE",
                            "FR",
                            "NL",
                            "IT",
                            "ES",
                            "SE",
                            "NO",
                            "DK",
                            "FI",
                            "BE",
                            "AT",
                            "CH",
                            "IE",
                            "PL",
                            "PT",
                            "CZ",
                            "HU",
                            "RO",
                            "GR",
                            "JP",
                            "KR",
                            "SG",
                            "IN",
                            "BR",
                            "MX",
                            "AR",
                            "TR"
                        ],
                        "type": "string",
                        "description": "Select the residential proxy country for Instagram requests. US is recommended.",
                        "default": "US"
                    },
                    "comments_limit": {
                        "title": "💬 Comments Limit Per Item",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of comments to return for each post/reel link. Set higher limits for large posts (scrapes sequentially).",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
