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

- **URL**: https://apify.com/scrapapi/instagram-comments-scraper.md
- **Developed by:** [ScrapAPI](https://apify.com/scrapapi) (community)
- **Categories:** Automation, Lead generation, Social media
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 — Extract Instagram Comment Data Easily! 💬

Unlock the full potential of your Instagram insights with the Instagram Comments Scraper 🧩 — the ultimate tool for collecting, analyzing, and exporting comments from Instagram posts, reels, and stories. Whether you’re a marketer, developer, or researcher, this scraper helps you gather real user feedback and audience sentiment effortlessly.

### 💡 What does Instagram Comments Scraper do?

The Instagram Comments Scraper automatically extracts comments, usernames, likes, timestamps, and reply counts from any Instagram post or reel. 🕵️‍♀️  
It’s perfect for:

*   Social media analytics  
      
    
*   Market research  
      
    
*   Influencer tracking  
      
    
*   Competitor sentiment analysis  
      
    

This powerful Apify Instagram comment scraper or Python-based tool helps you save hours of manual data collection and provides structured, ready-to-use datasets.

By leveraging AI and automation, you can instantly turn Instagram conversations into actionable insights.

* * *

### 📊 What “Instagram Comments Scraper” Can Extract

| 🧩 Data Type | 📘 Description |
| --- | --- |
| Comment ID | Unique ID for each comment on the post |
| Username | Instagram handle of the commenter |
| Full Name | Public name of the user |
| Profile Picture URL | Direct image URL of the commenter |
| Comment Text | The full text of each comment |
| Like Count | Number of likes on each comment |
| Replies Count | Total number of replies to that comment |
| Timestamp | Date and time when the comment was posted |
| Post URL / Post ID | The source Instagram post or reel |

⚡ You can scrape comments from:

*   Instagram posts, reels, and carousels  
      
    
*   Public pages without login  
      
    
*   Multiple URLs in one go  
      
    

* * *

#### 🔑 Key Features of Instagram Comments Scraper

*   🚀 Fast & Reliable Extraction — Scrape thousands of Instagram comments in seconds.  
      
    
*   🧱 No Login Needed — Many Apify Instagram Comment Scraper versions work without authentication.  
      
    
*   💾 Multiple Export Formats — Download in JSON, CSV, Excel, XML, or Google Sheets.  
      
    
*   🐍 Python Ready — Use it in Python scripts or automate with API integration.  
      
    
*   🌐 Free & Open Source Options — Check out Instagram comments scraper GitHub for free versions.  
      
    
*   🔍 Sentiment & Trend Analysis — Analyze audience tone and trending phrases.  
      
    
*   💬 Instagram Reels Comments Scraper Support — Collect comment data even from Instagram reels.  
      
    
*   🧩 Browser Extension Integration — Some tools offer Instagram comments scraper extensions for Chrome.  
      
    
*   ☁️ Cloud-based (Apify) — Automate scraping and schedule runs via Apify platform.  
      
    

* * *

### 🪄 How to Use Instagram Comments Scraper

Follow these easy steps to start scraping Instagram comments instantly 👇

1.  Log in to Apify – Create a free account or sign in.  
      
    
2.  Search the Actor – Find “Instagram Comments Scraper” in the Apify Store.  
      
    
3.  Enter Input Data – Paste your Instagram post or reel URLs.  
      
    
4.  Select Options – Choose whether to extract replies, usernames, timestamps, etc.  
      
    
5.  Run the Scraper – Hit Start, and let automation do the magic!  
      
    
6.  Download Results – Export results in CSV, JSON, or other formats.  
      
    

💡 Tip: You can also try Instagram Comments Scraper Python scripts or Apify REST API for advanced automation workflows.

* * *

### 🎯 Use Cases

Harness the power of Instagram comments scraping for:

*   📈 Social Media Analytics — Understand audience engagement and reactions.  
      
    
*   💼 Marketing Insights — Track product sentiment and brand perception.  
      
    
*   🧑‍💻 Research & AI Training — Use comment data for sentiment analysis models.  
      
    
*   🔍 Influencer Campaign Tracking — Identify high-performing posts.  
      
    
*   🧠 Competitor Monitoring — Analyze engagement strategies and feedback loops.  
      
    
*   💬 Community Management — Surface top comments, FAQs, or brand mentions.  
      
    
*   🎥 Instagram Reels Analysis — Extract user reactions from reels.  
      
    

* * *

### 💎 Why Choose Our Instagram Comments Scraper?

✨ Because we deliver speed, accuracy, and simplicity.

*   🕒 Ultra-fast performance — 100–200 comments per second.  
      
    
*   💰 Affordable pricing — From $0.50 per 1,000 comments.  
      
    
*   🧩 No proxy or login required.  
      
    
*   🧠 AI-compatible output for NLP and data analysis tools.  
      
    
*   🔐 Ethical & secure — Only extracts publicly available data.  
      
    
*   ⚙️ Integrates with Zapier, Make.com, Slack, Google Sheets, and more.  
      
    

Whether you want a free scraper, Apify actor, or Python automation, this tool adapts to your workflow perfectly.

* * *

### ⚡ How Many Results Can You Scrape?

Our Instagram comments scraper is designed for high scalability and performance:

*   Scrape up to 100K+ comments per run depending on post size.  
      
    
*   Supports multiple URLs or batch scraping at once.  
      
    
*   Handles rate limits and pagination automatically.  
      
    
*   Available as:  
      
    

*   Apify Instagram Comments Scraper (no login)  
      
    
*   Instagram Comment Scraper Python (custom script)  
      
    
*   Instagram Comments Scraper GitHub (open-source)  
      
    
*   Instagram Comments Scraper Extension (Chrome-based)  
      
    

⚙️ Best for marketers, researchers, and data professionals who need clean, structured data at scale.

* * *

### ⚖️ Is It Legal to Scrape Instagram Comments?

Scraping public Instagram data is generally allowed when done ethically 🧑‍⚖️.  
Here’s what to keep in mind:

*   ✅ Only extract publicly available comments.  
      
    
*   ❌ Do not collect private user data (emails, locations, etc.).  
      
    
*   ⚙️ Comply with GDPR and local data protection laws.  
      
    
*   💡 Always review Instagram’s Terms of Service before scraping.  
      
    

Our scrapers respect all legal boundaries — they only gather public content for analytical or research purposes.

* * *

### 🧩 Input Parameters

Example JSON Input:

```json
{
    "proxyConfiguration": {
        "useApifyProxy": false
    },
    "startUrls": [
        "DN8-GjPkgjS",
        "iamsrk"
    ]
}
````

### 📦 Output Format

Example JSON Output:

```json
[
  {
    "id": "17894957058162897",
    "text": "None of them. #saynotoaiart",
    "timestamp": "2025-08-29T21:11:18Z",
    "ownerUsername": "delicious.avocados07",
    "ownerProfilePicUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/573688225_17904015192272986_5048172375480541314_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_cat=110&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=Uc1KMCh0zw8Q7kNvwGuGbrB&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfgtvNChA9sGKz9LQYrZhUzaYjV7PCXsZypFw0G06oL5fg&oe=69176DCF&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18340877686201129",
    "text": "Someone point me to the Instagram logo ferris wheel NEOW!! 😍🎡🎠",
    "timestamp": "2025-08-29T21:07:02Z",
    "ownerUsername": "sokarlnerry",
    "ownerProfilePicUrl": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/150218070_438087447273269_142732859845588991_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby45NjYuYzIifQ&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=105&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=xU851sXZrQwQ7kNvwFVcKTD&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfjACae06RWNfXpZ2TFVmo8flILnSKfF0yKWk2IRjdeAPA&oe=69173FFB&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "17854674252477260",
    "text": "عالیه😍",
    "timestamp": "2025-09-16T05:22:02Z",
    "ownerUsername": "hichkas_2029",
    "ownerProfilePicUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/564843070_17901280824294530_686449939991985603_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_cat=102&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=5jY1_Ug71WMQ7kNvwFprFhz&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfgU6jm-otEkVLogPZ-KDkz8QGUthCsag3KVNDSXSYH8nQ&oe=6917532C&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18129572566471082",
    "text": "👏",
    "timestamp": "2025-10-26T08:12:38Z",
    "ownerUsername": "hhsj.njm",
    "ownerProfilePicUrl": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/572842478_17845701039600149_8428428272876571079_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=105&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=PS2E1uYJkUMQ7kNvwH_DA3R&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfiBMBmfRvrwRFdgMCmEUYz0wG3Eh592ihArIJ2uLWQ4bA&oe=69175143&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18076796989963271",
    "text": "....dont use ai.....literally you could've had it commissioned.....",
    "timestamp": "2025-08-29T20:44:38Z",
    "ownerUsername": "pumpkin_jadi3",
    "ownerProfilePicUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/575597796_17906414025267748_3961066130682138052_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDI0LmMyIn0&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_cat=104&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=00TqKTPnrvEQ7kNvwFuyn6Q&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfgkFr4XyS1RJwLFdWcyLAq4ZwzVMUIlfUBODg-edMEAiQ&oe=69174CA4&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18138927151425955",
    "text": "NO to AI images!\nYES to human craftsmanship!",
    "timestamp": "2025-08-29T20:48:20Z",
    "ownerUsername": "lizziemontgomerydesign",
    "ownerProfilePicUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/358428998_1366323010584079_281163575974401184_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4zMjcuYzIifQ&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_cat=107&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=Qq-udatHhJAQ7kNvwGMKUMa&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfjCTTNq0hRlmfv8k1jyZ_qT4vbBKuAvIwsn6aNoxyV44g&oe=6917401F&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "17869707738430044",
    "text": "por que não consigo recuperar minha conta do Instagram eu não sei a senha nem o gmail e não tenho acesso ao número de telefone me ajudem 🙌",
    "timestamp": "2025-09-02T03:54:02Z",
    "ownerUsername": "obito_uchiha_1508",
    "ownerProfilePicUrl": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/572956406_17873957451442548_3499332193722196548_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=100&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=U48Uh5UXbOsQ7kNvwHiT0e6&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfhKM24hoSn1XYq_NgIW4A8pKdjIdUg69gcjeVkdWpwAhg&oe=6917448F&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18074498521843883",
    "text": "not the ai slop",
    "timestamp": "2025-08-29T20:41:48Z",
    "ownerUsername": "alexanicoleparlapiano",
    "ownerProfilePicUrl": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/548894457_18529299976014470_5122690611298232171_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xMDgwLmMyIn0&_nc_ht=scontent-iad3-1.cdninstagram.com&_nc_cat=102&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=R4_PJRTdpHMQ7kNvwGBmPBC&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfhaX5hSBlyiw5WD_cm94cHrwolSpWShlT-xjqicU4v58Q&oe=691739C7&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "17979221762908612",
    "text": "Ferris wheel ❤️",
    "timestamp": "2025-08-29T20:52:42Z",
    "ownerUsername": "karanbohora_",
    "ownerProfilePicUrl": "https://instagram.fgua3-4.fna.fbcdn.net/v/t51.2885-19/573323465_1219825463302212_7278921664109726296_n.png?stp=dst-jpg_e0_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby4xNTAuYzIifQ&_nc_ht=instagram.fgua3-4.fna.fbcdn.net&_nc_cat=1&_nc_oc=Q6cZ2QH0DHyN4CzxzEw3Hccl73yvCHuBvWil2gZkusszAUrq0zuM9gofO3OaD60R6d8eNj3ocIHhNW74yj_vInpZJNra&_nc_ohc=Cu8xClCUdtEQ7kNvwH2Zpu6&_nc_gid=dCJojxMxGV6ic6kO6Q_l7Q&edm=AGqCYasBAAAA&ccb=7-5&ig_cache_key=YW5vbnltb3VzX3Byb2ZpbGVfcGlj.3-ccb7-5&oh=00_AfgCT3kojyWi0l8js3kHZcSIjI7rxKFm9ogeKJdwo1oRjA&oe=6917566A&_nc_sid=6c5dea",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  },
  {
    "id": "18092252623674844",
    "text": "cat one best",
    "timestamp": "2025-08-29T20:59:56Z",
    "ownerUsername": "madalinawai_",
    "ownerProfilePicUrl": "https://scontent-iad3-2.cdninstagram.com/v/t51.2885-19/515453055_17900517537228797_1579270338560252299_n.jpg?stp=dst-jpg_s150x150_tt6&efg=eyJ2ZW5jb2RlX3RhZyI6InByb2ZpbGVfcGljLmRqYW5nby43MzYuYzIifQ&_nc_ht=scontent-iad3-2.cdninstagram.com&_nc_cat=105&_nc_oc=Q6cZ2QHtS-gAW0sGI6EtGqDV2kQD4gsIzEf-2ywpBqfAlPv0oB7PIqLEt6BqcPq20w_5ttM&_nc_ohc=zPjRoFWaqWQQ7kNvwGcs5YY&_nc_gid=Sd0W_QT8ATIsDfulad-Czg&edm=AKp6CbIBAAAA&ccb=7-5&oh=00_AfhnQyLUXC2Snu4QiHpAK64FM2xBU9Cp4WgtdH4wJuJK2w&oe=69174673&_nc_sid=d62176",
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"
  }
]
```

### ❓ FAQ — Instagram Comments Scraper

#### 1️⃣ Is there a free version of Instagram Comments Scraper?

Yes! You can find Instagram comments scraper free tools on Apify and GitHub.

#### 2️⃣ Can I scrape Instagram Reels comments?

Absolutely. Use the Instagram Reels Comments Scraper to get comments from any reel.

#### 3️⃣ Do I need coding skills?

Not necessarily. Apify Instagram Comment Scraper is no-code. For devs, use the Python version.

#### 4️⃣ Is it safe to use?

Yes — it only collects public data and complies with scraping ethics.

#### 5️⃣ What output formats are supported?

Export your results in JSON, CSV, Excel, or Google Sheets.

#### 6️⃣ Can I use it via API?

Yes! Integrate with the Apify API or your Python automation scripts.

#### 7️⃣ Is there a Chrome extension?

Yes, try Instagram comments scraper extensions for one-click scraping.

#### 8️⃣ How fast is it?

Average speed: 100–200 comments per second depending on post size.

### 🚀 Final Takeaway

The Instagram Comments Scraper is your key to unlocking comment insights across posts and reels — without manual effort.\
Whether you prefer Apify, Python scripts, or GitHub tools, this scraper delivers fast, free, and reliable data for your next big project.

💬 Start today, and turn Instagram comments into real competitive intelligence!

# Actor input Schema

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

Add one or more Instagram post/reel URLs (example: https://www.instagram.com/p/SHORTCODE/).

## `scrapingOptions` (type: `object`):

Comment limits, reply options, sort hint, and optional Instagram session—in one place.

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

Optional. Use a proxy only if direct requests are restricted.

## Actor input object example

```json
{
  "directUrls": [
    "https://www.instagram.com/p/DN8-GjPkgjS"
  ]
}
```

# 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/DN8-GjPkgjS"
    ]
};

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

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Comments Scraper",
        "version": "0.2",
        "x-build-id": "SUA00S5wDyc6Eqb4h"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapapi~instagram-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapapi-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/scrapapi~instagram-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapapi-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/scrapapi~instagram-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapapi-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",
                "properties": {
                    "directUrls": {
                        "title": "🔗 Post URLs",
                        "type": "array",
                        "description": "Add one or more Instagram post/reel URLs (example: https://www.instagram.com/p/SHORTCODE/).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "scrapingOptions": {
                        "title": "⚙️ Limits, replies & access",
                        "type": "object",
                        "description": "Comment limits, reply options, sort hint, and optional Instagram session—in one place.",
                        "properties": {
                            "maxComments": {
                                "title": "💬 Max comments per post",
                                "type": "integer",
                                "description": "Maximum number of comments to collect per URL.",
                                "minimum": 1,
                                "maximum": 10000,
                                "default": 10
                            },
                            "maxReplies": {
                                "title": "↪️ Max replies per comment",
                                "type": "integer",
                                "description": "Maximum number of replies to fetch for each comment.",
                                "minimum": 0,
                                "maximum": 500,
                                "default": 2
                            },
                            "sessionId": {
                                "title": "🔐 Session ID",
                                "type": "string",
                                "description": "Paste your Instagram `sessionid` cookie for more reliable access to comment data.",
                                "editor": "textfield"
                            },
                            "includeNestedComments": {
                                "title": "🧵 Include replies",
                                "type": "boolean",
                                "description": "Enable to collect replies for each top-level comment.",
                                "default": true
                            },
                            "isNewestComments": {
                                "title": "🕒 Newest first (limited support)",
                                "type": "boolean",
                                "description": "Kept for compatibility. In many cases, Instagram returns popular comments first.",
                                "default": false
                            }
                        }
                    },
                    "proxyConfiguration": {
                        "title": "🌐 Proxy (optional fallback)",
                        "type": "object",
                        "description": "Optional. Use a proxy only if direct requests are restricted."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
