# Instagram Post Comments Scraper (`codenest/instagram-post-comments-scraper`) Actor

(Cheapest rate) Scrape thousands of Instagram posts in just minutes with full metadata - usernames, captions, reactions, comments, media URLs (images/videos/reels), thumbnails, and upload timestamps from any public profile.

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

## Pricing

from $4.00 / 1,000 post comments scrapeds

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/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 Post Comments Scraper - Ultimate Comment Extraction Tool

**Effortlessly extract comments from any Instagram post or Reel with our powerful **Instagram Post Comments Scraper**! This Apify actor enables bulk scraping of comments, commenter profiles, post metadata, and nested replies for complete engagement analysis.**

***

### 📋 Overview

Need to analyze audience sentiment, track brand mentions, or build engagement datasets? This **Instagram Post Comments Scraper** delivers:

- 💬 **Complete Comment Extraction** - Text, likes, timestamps, and comment IDs
- 👤 **Commenter Profiles** - Usernames, IDs, profile pictures, and verification status
- 📊 **Post Metadata** - Caption, likes, total comments, and upload time
- 🔁 **Child Comments** - Nested reply detection and extraction
- 📱 **Multi-Post Support** - Process posts and Reels in a single run
- 🌐 **Proxy Support** - Built-in Apify proxy integration for reliable scraping

Perfect for social media managers 📈, brand analysts 📊, sentiment researchers 🔬, and content strategists 🎭!

***

### ⭐ Core Capabilities of Instagram Post Comments Scraper

#### 💬 Comment Extraction

- **Full Comment Text** - Complete comment content including emojis and multilingual text
- **Comment IDs** - Unique identifiers for each comment
- **Like Counts** - Engagement metrics per comment
- **Timestamps** - Precise creation time in ISO 8601 format
- **Child Comments** - Nested replies with their own IDs and metadata

#### 👤 Commenter Data

- **Username Extraction** - Commenter Instagram handle
- **Owner ID** - Unique Instagram user ID
- **Profile Pictures** - Commenter profile image URLs
- **Verification Status** - Identify verified commenters
- **Profile URLs** - Direct links to commenter profiles

#### 📊 Post Metadata

- **Caption Extraction** - Full post caption text
- **Post Type Detection** - Video, image, or carousel
- **Upload Timestamp** - When the post was published
- **Like Count** - Total post likes
- **Total Comments Count** - Full comment count on the post
- **Thumbnail URL** - Post preview image
- **Media ID** - Unique post identifier

#### ⚡ Technical Features

- **Comment Limit Control** - Set maximum comments per post
- **Multi-Post Batching** - Process multiple posts and Reels at once
- **Proxy Configuration** - Apify proxy with RESIDENTIAL group support
- **Session Management** - Optional session persistence
- **JSON Output** - Clean structured data with optional file export
- **Duplicate Handling** - Prevents duplicate comment extraction

***

### ⚙️ Input Configuration

Simply enter Instagram post or Reel URLs, configure limits, and click "Start". Input looks like this:

```json
{
  "maxComments": 100,
  "postUrls": [
    "https://www.instagram.com/p/Dcl4SbSlNZA/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/p/Dc53Me7E9sO/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/reel/DdRhAIluVnr/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/reel/DdRMVvHglvP/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/reel/DYSOR4-syKB/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ=="
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "sessionId": "",
  "outputFile": "comments_data.json"
}
```

#### 📝 Input Specifications

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `postUrls` | Array | ✅ Yes | - | Instagram post or Reel URLs to scrape comments from |
| `maxComments` | Integer | ❌ No | 100 | Maximum comments to extract per post |
| `proxyConfiguration.useApifyProxy` | Boolean | ❌ No | true | Enable Apify proxy rotation |
| `proxyConfiguration.apifyProxyGroups` | Array | ❌ No | \["RESIDENTIAL"] | Proxy groups for scraping |
| `sessionId` | String | ❌ No | "" | Session ID for cookie persistence |
| `outputFile` | String | ❌ No | "comments\_data.json" | Output filename for JSON export |

***

### 📤 Output Structure

Your **Instagram Post Comments Scraper** produces comprehensive comment data with post metadata and commenter profiles:

```json
[
  {
    "post_url": "https://www.instagram.com/p/Dcl4SbSlNZA/",
    "shortcode": "Dcl4SbSlNZA",
    "scraped_at": "2026-09-15T14:57:13.751338Z",
    "author": {
      "username": "apple",
      "full_name": "apple",
      "followers_count": 38000000,
      "following_count": 10,
      "is_verified": true,
      "profile_pic_url": "https://scontent-ord5-2.cdninstagram.com/...",
      "profile_url": "https://www.instagram.com/apple"
    },
    "post_metadata": {
      "caption": "Wembley after hours 🩸 @theweeknd  #ShotoniPhone by @hyghly",
      "post_type": "carousel",
      "is_video": false,
      "upload_time": "2026-08-28T17:17:29Z",
      "like_count": 122562,
      "total_comments_count": 1608,
      "thumbnail_url": "https://scontent-ord5-2.cdninstagram.com/...",
      "media_id": "3973829803082307136"
    },
    "total_comments_scraped": 100,
    "comments": [
      {
        "id": "18119389409482830",
        "text": "samsung no appel yeah❤️❤️❤️",
        "owner_username": "ksoudahamida",
        "owner_id": "8190703202",
        "owner_profile_pic_url": "https://scontent-ord5-2.cdninstagram.com/...",
        "owner_is_verified": false,
        "created_at": "2026-09-15T10:40:34Z",
        "like_count": 1,
        "child_comment_count": 0,
        "child_comments": []
      }
    ]
  }
]
```

#### 📖 Output Field Documentation

**🔹 Post Identification**
| Field | Description |
|-------|-------------|
| `post_url` | Cleaned Instagram post URL |
| `shortcode` | Unique post shortcode identifier |
| `scraped_at` | Timestamp when scraping occurred |

**🔹 Author Data**
| Field | Description |
|-------|-------------|
| `author.username` | Post author's Instagram handle |
| `author.full_name` | Author's display name |
| `author.followers_count` | Author's follower count |
| `author.following_count` | Author's following count |
| `author.is_verified` | Author verification status |
| `author.profile_pic_url` | Author's profile picture URL |
| `author.profile_url` | Direct link to author's profile |

**🔹 Post Metadata**
| Field | Description |
|-------|-------------|
| `caption` | Full post caption text |
| `post_type` | Post type (video, image, carousel) |
| `is_video` | Video post indicator |
| `upload_time` | Post upload timestamp (ISO 8601) |
| `like_count` | Total post likes |
| `total_comments_count` | Total comments on post |
| `thumbnail_url` | Post thumbnail image URL |
| `media_id` | Unique media identifier |

**🔹 Comment Data**
| Field | Description |
|-------|-------------|
| `id` | Unique comment ID |
| `text` | Full comment text |
| `owner_username` | Commenter's Instagram handle |
| `owner_id` | Commenter's unique user ID |
| `owner_profile_pic_url` | Commenter's profile picture URL |
| `owner_is_verified` | Commenter verification status |
| `created_at` | Comment creation timestamp |
| `like_count` | Likes on the comment |
| `child_comment_count` | Number of nested replies |
| `child_comments` | Array of nested reply comments |

***

### 🎨 Key Features of This Instagram Post Comments Scraper

#### 📊 Engagement Analytics

- **Comment Likes** - Track most-liked comments
- **Reply Threads** - Identify conversation starters
- **Verification Detection** - Spot verified commenters
- **Temporal Analysis** - Track comment timing patterns

#### 👤 Commenter Intelligence

- **Profile Extraction** - Complete commenter profile data
- **Verification Status** - Identify notable commenters
- **Profile Pictures** - Direct image URLs
- **Cross-Post Tracking** - Same user across multiple posts

#### 🔁 Nested Reply Support

- **Child Comment Detection** - Identify reply threads
- **Child Comment Counts** - Reply volume per comment
- **Reply Data Structure** - Ready for thread analysis

#### 🌐 Multi-Post Support

- **Post and Reel URLs** - Works with both post types
- **Batch Processing** - Multiple posts in one run
- **Per-Post Results** - Clean separation of comment data

#### 🚀 Reliability Features

- **Residential Proxies** - Built-in Apify proxy support
- **Session Management** - Optional cookie persistence
- **Rate Limiting** - Smart throttling to avoid blocks
- **Duplicate Handling** - Prevents comment duplication

***

### 💡 Use Cases for Instagram Post Comments Scraper

- **📊 Sentiment Analysis** - Analyze audience reactions to posts
- **🎯 Brand Monitoring** - Track brand mentions in comments
- **📈 Campaign Analysis** - Measure engagement quality
- **🔬 Research** - Study comment patterns and virality
- **🎭 Content Strategy** - Identify what resonates with audiences
- **👥 Community Management** - Understand audience segments
- **📱 Influencer Analysis** - Assess authentic engagement
- **🤖 AI Training** - Build comment datasets for NLP models

***

### ✨ Why Choose Our Instagram Post Comments Scraper?

- **⚡ Fast & Efficient** - Quick comment extraction from any post
- **🎯 100% Accurate** - Preserves all comment data without alteration
- **📦 Complete Data** - Everything from commenter profiles to nested replies
- **🔄 Regular Updates** - Adapts to Instagram platform changes
- **🛡️ Production Ready** - Reliable with thousands of posts
- **💰 Cost Efficient** - Optimized for minimal compute time
- **🔒 Privacy Focused** - No personal data stored or shared

***

### ⚠️ Limitations

- Only works with public Instagram posts (non-private content)
- Comments may be limited by Instagram's rate limits
- Deleted or hidden comments are not accessible
- Comments on Stories are not supported
- Some comment data may be subject to privacy restrictions

***

### 📧 Need Custom Features for Your Instagram Post Comments Scraper?

Want **sentiment analysis**, **specific comment filters**, **custom output formats**, **automated reporting**, or **CRM integration**?

✉️ Email **<codenest2.0@gmail.com>** for tailored enterprise solutions!

***

# Actor input Schema

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

Enter one or more specific Instagram post or reel URLs to scrape comments from. Example: https://www.instagram.com/p/DdRhA8klE\_5/ or https://www.instagram.com/reel/DW1jJbtCMB8/

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

Maximum number of comments to scrape per post. Note: Free users are limited to 10 comments and 2 posts. To scrape 50, 100, 1,000, or all comments, please upgrade your Apify plan.

## `sessionId` (type: `string`):

Optional: If you wish to use your own Instagram session cookie, paste it here. Deep comment pagination is already pre-configured.

## `maxTotalChargeUsd` (type: `number`):

Optional spending limit in USD for Pay-Per-Event pricing (e.g. 5.00 for $5.00 USD).

## `outputFile` (type: `string`):

Name of the output JSON file. Default is comments\_data.json.

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

Select proxies to be used by the scraper.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DdRhA8klE_5/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/reel/DW1jJbtCMB8/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ=="
  ],
  "maxComments": 100,
  "sessionId": "",
  "outputFile": "comments_data.json",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Tabular view of scraped Instagram posts and their extracted comments with engagement and author metrics.

## `allResults` (type: `string`):

Complete dataset containing full comment objects, timestamps, commenter profiles, and basic post metadata.

## `outputRecord` (type: `string`):

Consolidated JSON array of all scraped posts and comments stored in the default Key-Value Store.

# 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/DdRhA8klE_5/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
        "https://www.instagram.com/reel/DW1jJbtCMB8/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ=="
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("codenest/instagram-post-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/DdRhA8klE_5/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
        "https://www.instagram.com/reel/DW1jJbtCMB8/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("codenest/instagram-post-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/DdRhA8klE_5/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ==",
    "https://www.instagram.com/reel/DW1jJbtCMB8/?utm_source=ig_web_copy_link&stkn=NTc4MTIwNjQ2YQ=="
  ]
}' |
apify call codenest/instagram-post-comments-scraper --silent --output-dataset

```

## MCP server setup

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