# Instagram Comment Scraper (`datascrapers/my-actor-1`) Actor

Instagram Comment Scraper. get usernames, profile images, comment text, likes, reply counts, and dates — perfect for research, sentiment analysis, or influencer insights. Just for $2/1000 comments.

- **URL**: https://apify.com/datascrapers/my-actor-1.md
- **Developed by:** [Farhan Ali](https://apify.com/datascrapers) (community)
- **Categories:** Social media, News, Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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.

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 Comment Scraper

Extract every comment from Instagram posts and reels — just drop a URL and get usernames, comment text, likes, timestamps, and profile data. Perfect for sentiment analysis, influencer research, community management, and brand monitoring at scale.

### What can Instagram Comment Scraper do for you?

- **Scrape all comments from any post or reel** — No login required. Works with single posts or bulk URLs.
- **Full commenter profile data** — Username, profile picture, verification status, and profile link for every commenter.
- **Likes, timestamps, and engagement signals** — See how many likes each comment received and exactly when it was posted.
- **Reply-aware structure** — Parent-comment IDs let you reconstruct nested conversation threads.
- **Built-in rate-limit handling** — Automatic cooldown and retry mechanisms keep your scrape running smoothly even on high-volume posts.
- **Proxy support** — Use Apify residential proxies or bring your own for geo-targeted extraction.

### What data can you extract?

| Field | Description |
|-------|-------------|
| 🖼️ Profile Pic | Avatar URL of the commenter |
| 👤 Username | Instagram handle |
| 💬 Comment Text | The full comment content |
| ❤️ Likes | Number of likes on the comment |
| 🕐 Created At | Timestamp of when the comment was posted |
| 🔗 Profile Link | Direct link to the commenter's profile |
| 📎 Post URL | The original post or reel URL |

### Why use this scraper?

- **Market Research** — Analyze what audiences are saying about brands, products, or campaigns under Instagram posts.
- **Influencer Due Diligence** — Assess engagement quality by reviewing real comments and commenter authenticity.
- **Community Management** — Monitor comments across your owned posts or competitor content for sentiment and feedback.
- **Content Automation** — Feed scraped comments into NLP pipelines for trend analysis, topic clustering, or moderation workflows.

### How to use Instagram Comment Scraper

1. **Create a free Apify account** at [apify.com](https://apify.com) and get your API token.
2. **Open the [Instagram Comment Scraper](https://apify.com/rigelbytes/instagram-comment-scraper)** page on Apify Console.
3. **Paste one or more Instagram post/reel URLs** into the `post_urls` field.
4. **Configure optional settings** — concurrency, delays, max comments per post, and proxy preferences.
5. **Click Start** and download your data as JSON, CSV, or XLSX when the run finishes.

### Pricing

| Model | Price |
|-------|-------|
| Per 1,000 comments | **$1.5** |

No hidden fees or limits on usage. Each actor run also incurs a small platform start fee. Save up to **20%** by purchasing an Apify subscription plan.

### Input

The actor accepts the following configuration:

- **post_urls** (`array[string]`, **required**) — List of Instagram post or reel URLs to scrape comments from.
- **posts_concurrency** (`integer`, optional, default: `2`) — Number of posts to scrape concurrently.
- **sleep_min** (`number`, optional, default: `5`) — Minimum random delay between pagination requests (seconds).
- **sleep_max** (`number`, optional, default: `12`) — Maximum random delay between pagination requests (seconds).
- **request_timeout** (`number`, optional, default: `120`) — Timeout per GraphQL request (seconds).
- **request_retries** (`integer`, optional, default: `1`) — Retries for transient request failures.
- **rate_limit_cooldown** (`number`, optional, default: `100`) — Wait time after hitting a rate limit (seconds).
- **rate_limit_max_waits** (`integer`, optional, default: `3`) — Max rate limit cooldowns before stopping for a post.
- **max_comments** (`integer`, optional, default: `100`) — Maximum comments to scrape per post. Set `0` for unlimited.
- **proxyConfiguration** (`object`, optional) — Proxy settings. Supports Apify proxy groups (recommended: `RESIDENTIAL`) or custom proxy URLs.

#### 📝 Copy for Use:

```json
{
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "posts_concurrency": 2,
  "sleep_min": 5,
  "sleep_max": 12,
  "request_timeout": 120,
  "request_retries": 1,
  "rate_limit_cooldown": 300,
  "rate_limit_max_waits": 3
}
````

### Why Choose This Scraper?

- **Affordable**: Pay only **$1.5 per 1,000 comments** with no hidden fees or minimum commitments.
- **Comprehensive**: Extract every comment — including text, likes, timestamps, profile data, and reply structure.
- **Easy to Use**: Paste a URL, configure optional settings, and start scraping in under a minute.
- **Reliable**: Built with automatic rate-limit handling, retry logic, and configurable delays for uninterrupted scraping.

### Output

![Output](https://raw.githubusercontent.com/faizanalii/apify-images/97263d5090e46365474ae4dd3f32bdfd58530f83/instagram-comment-scraper.gif)

### API Examples

#### Python

```python
from apify_client import ApifyClient

## Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")

## Prepare the Actor input
run_input = {
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "posts_concurrency": 2,
  "sleep_min": 5,
  "sleep_max": 12,
  "request_timeout": 120,
  "request_retries": 1,
  "rate_limit_cooldown": 300,
  "rate_limit_max_waits": 3
}

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

#### JavaScript

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

// Initialize the ApifyClient with your API token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "posts_concurrency": 2,
  "sleep_min": 5,
  "sleep_max": 12,
  "request_timeout": 120,
  "request_retries": 1,
  "rate_limit_cooldown": 300,
  "rate_limit_max_waits": 3
};

(async () => {
    const run = await client.actor("rigelbytes/instagram-comment-scraper").call(input);
})();
```

#### cURL

```shell
## Set your Apify API token
API_TOKEN=<YOUR_API_TOKEN>

## Prepare Actor input
cat > input.json <<'EOF'
{
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  },
  "posts_concurrency": 2,
  "sleep_min": 5,
  "sleep_max": 12,
  "request_timeout": 120,
  "request_retries": 1,
  "rate_limit_cooldown": 300,
  "rate_limit_max_waits": 3
}
EOF

## Run the Actor
curl "https://api.apify.com/v2/acts/rigelbytes/instagram-comment-scraper/runs?token=$API_TOKEN" \
  -X POST \
  -d @input.json \
  -H 'Content-Type: application/json'
```

### Detailed Data

```json
[
  {
    "pk": "18121785391719030",
    "username": "mc_gang04",
    "text": "😍",
    "comment_like_count": 0,
    "created_at": "2026-04-13T16:50:18",
    "post_url": "https://www.instagram.com/p/DWte0fylh5b/",
    "profile_link": "https://www.instagram.com/mc_gang04/",
    "profile_pic_url": "https://scontent.cdninstagram.com/v/...",
    "user": {
      "is_verified": false,
      "username": "mc_gang04"
    }
  },
  {
    "pk": "18028046117804176",
    "username": "brandy_capello",
    "text": "😍😍",
    "comment_like_count": 0,
    "created_at": "2026-04-13T14:57:33",
    "post_url": "https://www.instagram.com/p/DWte0fylh5b/",
    "profile_link": "https://www.instagram.com/brandy_capello/",
    "profile_pic_url": "https://scontent.cdninstagram.com/v/...",
    "user": {
      "is_verified": false,
      "username": "brandy_capello"
    }
  },
  {
    "pk": "17854058193637224",
    "username": "zad_abdelreheem",
    "text": "❤️❤️❤️",
    "comment_like_count": 0,
    "created_at": "2026-04-12T23:53:03",
    "post_url": "https://www.instagram.com/p/DWte0fylh5b/",
    "profile_link": "https://www.instagram.com/zad_abdelreheem/",
    "profile_pic_url": "https://scontent.cdninstagram.com/v/...",
    "user": {
      "is_verified": false,
      "username": "zad_abdelreheem"
    }
  }
]
```

### 🚀 Other Tools by Rigel Bytes

[![Airbnb Images Downloader](https://img.shields.io/badge/Airbnb_Images_Downloader-blue?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-images-downloader)\
Extracts all photos from Airbnb listing pages and packages them into a compressed archive.

[![Zillow Scraper](https://img.shields.io/badge/Zillow_Scraper-green?style=for-the-badge)](https://apify.com/rigelbytes/zillow-scraper)\
Extracts structured property listing data from Zillow for real estate analysis and monitoring.

[![Zillow Detail Scraper](https://img.shields.io/badge/Zillow_Detail_Scraper-orange?style=for-the-badge)](https://apify.com/rigelbytes/zillow-detail-scraper)\
Comprehensive Zillow property scraper with customizable proxy support for detailed real estate data.

[![Daraz](https://img.shields.io/badge/Daraz-blueviolet?style=for-the-badge)](https://apify.com/rigelbytes/daraz)\
Extracts product listings and seller data from Daraz.pk for ecommerce monitoring and analysis.

[![Airbnb Listing](https://img.shields.io/badge/Airbnb_Listing-red?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-listing)\
Bulk-extracts structured Airbnb listing data including metadata, descriptions, and property features.

[![Google Maps Scraper](https://img.shields.io/badge/Google_Maps_Scraper-yellow?style=for-the-badge)](https://apify.com/rigelbytes/google-maps-scraper)\
Extracts structured business profiles and local place intelligence from Google Maps at scale.

[![Airbnb Availability Calendar](https://img.shields.io/badge/Airbnb_Availability_Calendar-purple?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-availability-calendar)\
Exports Airbnb listing availability calendars as structured per-date data.

[![Instagram Profile Scraper](https://img.shields.io/badge/Instagram_Profile_Scraper-pink?style=for-the-badge)](https://apify.com/rigelbytes/instagram-profile-scraper)\
Extracts detailed Instagram profile and media metadata including follower counts and engagement.

[![Land.com Scraper](https://img.shields.io/badge/Land.Com_Scraper-cyan?style=for-the-badge)](https://apify.com/rigelbytes/landdotcom-scraper)\
Crawls Land.com property listings and extracts structured real estate data.

[![Airbnb Reviews](https://img.shields.io/badge/Airbnb_Reviews-success?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-reviews)\
Extracts unlimited reviews from Airbnb listings with reviewer profiles and ratings.

[![FurnishedFinder](https://img.shields.io/badge/Furnishedfinder-important?style=for-the-badge)](https://apify.com/rigelbytes/furnishedfinder)\
Extracts large-scale furnished rental data from Furnished Finder with full listing details.

[![Immobilienscout24](https://img.shields.io/badge/Immobilienscout24-critical?style=for-the-badge)](https://apify.com/rigelbytes/immobilienscout24)\
Scrapes immobilienscout24.de for real estate listings and contact data at scale.

[![Airbnb Listing Urls](https://img.shields.io/badge/Airbnb_Listing_Urls-informational?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-listing-urls)\
Extracts unlimited Airbnb listing URLs from search queries with structured metadata.

[![Instagram Engagement Tool](https://img.shields.io/badge/Instagram_Engagement_Tool-9cf?style=for-the-badge)](https://apify.com/rigelbytes/instagram-engagement-tool)\
Analyzes Instagram profiles and computes engagement metrics for posts and videos.

[![Instagram Post Scraper](https://img.shields.io/badge/Instagram_Post_Scraper-blue?style=for-the-badge)](https://apify.com/rigelbytes/instagram-post-scraper)\
Extracts every post from Instagram profiles with structured post-level metadata and media.

[![BBB Scraper](https://img.shields.io/badge/Bbb_Scraper-green?style=for-the-badge)](https://apify.com/rigelbytes/bbb-scraper)\
Extracts detailed business listings from the Better Business Bureau (BBB).

[![Linkedin Company Scraper](https://img.shields.io/badge/Linkedin_Company_Scraper-orange?style=for-the-badge)](https://apify.com/rigelbytes/linkedin-company-scraper)\
Extracts structured company profiles from LinkedIn for lead generation and intelligence.

[![linkedin-company-details](https://img.shields.io/badge/Linkedin_Company_Details-blueviolet?style=for-the-badge)](https://apify.com/rigelbytes/linkedin-company-details)\
Comprehensive LinkedIn company profiles and social content extraction.

[![Instagram Reel Scraper](https://img.shields.io/badge/Instagram_Reel_Scraper-red?style=for-the-badge)](https://apify.com/rigelbytes/instagram-reel-scraper)\
Extracts all Instagram Reels from public profiles with structured reel metadata.

[![Rottentomatoes Reviews Scraper](https://img.shields.io/badge/Rottentomatoes_Reviews_Scraper-yellow?style=for-the-badge)](https://apify.com/rigelbytes/rottentomatoes-reviews-scraper)\
Collects user and critic reviews from Rotten Tomatoes with structured review records.

[![Extract Furnished Finder Hosts](https://img.shields.io/badge/Extract_Furnished_Finder_Hosts-purple?style=for-the-badge)](https://apify.com/rigelbytes/furnished-finder-hosts)\
Scrapes Furnished Finder for listing and host profile data with geolocation details.

[![Trustpilot Reviews Scraper](https://img.shields.io/badge/Trustpilot_Reviews_Scraper-pink?style=for-the-badge)](https://apify.com/rigelbytes/trustpilot-reviews)\
Collects Trustpilot reviews and reviewer profiles at scale.

[![Furnished Finder Fast](https://img.shields.io/badge/Furnished_Finder_Fast-cyan?style=for-the-badge)](https://apify.com/rigelbytes/furnished-finder-fast)\
Scrapes Furnished Finder rental listings and host profiles with structured data output.

[![Zillow Agents](https://img.shields.io/badge/Zillow_Agents-success?style=for-the-badge)](https://apify.com/rigelbytes/zillow-agents)\
Extracts Zillow agent profiles and data for location-based queries.

[![Bayut Scraper](https://img.shields.io/badge/Bayut_Scraper-important?style=for-the-badge)](https://apify.com/rigelbytes/bayut-scraper)\
Extracts structured UAE property listings and market intelligence from Bayut.com.

[![dubai-listing-scraper](https://img.shields.io/badge/Dubai_Listing_Scraper-critical?style=for-the-badge)](https://apify.com/rigelbytes/dubai-listing-scraper)\
Extracts UAE property listings for sale and rent across Dubai and Abu Dhabi.

[![Tiktok Comment Scraper](https://img.shields.io/badge/Tiktok_Comment_Scraper-informational?style=for-the-badge)](https://apify.com/rigelbytes/tiktok-comment-scraper)\
Extracts all comments from TikTok videos with commenter metadata.

[![Tiktok Engagement Rate](https://img.shields.io/badge/Tiktok_Engagement_Rate-9cf?style=for-the-badge)](https://apify.com/rigelbytes/tiktok-engagement-rate)\
Analyzes TikTok profiles and computes engagement metrics from recent videos.

[![Company Service Finder](https://img.shields.io/badge/Company_Service_Finder-blue?style=for-the-badge)](https://apify.com/rigelbytes/company-service-finder)\
Scrapes business listings from Google Search and Maps across cities and states.

[![Website Services Finder](https://img.shields.io/badge/Website_Services_Finder-green?style=for-the-badge)](https://apify.com/rigelbytes/website-services-finder)\
Extracts and AI-analyzes company services from business websites.

[![Airbnb Address Finder](https://img.shields.io/badge/Airbnb_Address_Finder-orange?style=for-the-badge)](https://apify.com/rigelbytes/airbnb-address-finder)\
Bulk-extracts Airbnb listing addresses and comprehensive listing metadata.

[![Immowelt Scraper](https://img.shields.io/badge/Immowelt_Scraper-blueviolet?style=for-the-badge)](https://apify.com/rigelbytes/immowelt-scraper)\
Scrapes unlimited real estate listings from immowelt.de with structured property data.

[![Propertyfinder Scraper](https://img.shields.io/badge/Propertyfinder_Scraper-red?style=for-the-badge)](https://apify.com/rigelbytes/propertyfinder-scraper)\
Extracts unlimited real estate listings from propertyfinder.ae at scale.

[![Publix Scraper](https://img.shields.io/badge/Publix_Scraper-yellow?style=for-the-badge)](https://apify.com/rigelbytes/publix-scraper)\
Extracts grocery product data from Publix with delivery/pickup location support.

[![Redfin Scraper](https://img.shields.io/badge/Redfin_Scraper-purple?style=for-the-badge)](https://apify.com/rigelbytes/redfin-scraper)\
Extracts large-scale real estate listings from Redfin with structured property records.

[![Instacart Scraper](https://img.shields.io/badge/Instacart_Scraper-pink?style=for-the-badge)](https://apify.com/rigelbytes/instacart-scraper)\
Extracts structured product data from Instacart using search and location.

[![Homedepot Scraper](https://img.shields.io/badge/Homedepot_Scraper-cyan?style=for-the-badge)](https://apify.com/rigelbytes/homedepot-scraper)\
Crawls Home Depot collection pages with location-aware product extraction.

[![Doctify Scraper](https://img.shields.io/badge/Doctify_Scraper-success?style=for-the-badge)](https://apify.com/rigelbytes/doctify-scraper)\
Extracts healthcare provider and practice data from Doctify.

[![Facebook Ads Scraper](https://img.shields.io/badge/Facebook_Ads_Scraper-important?style=for-the-badge)](https://apify.com/rigelbytes/facebook-ads-scraper)\
Extracts structured ad data from Facebook Ads Library with creative assets.

[![Ticketmaster Scraper](https://img.shields.io/badge/Ticketmaster_Scraper-critical?style=for-the-badge)](https://apify.com/rigelbytes/ticketmaster-scraper)\
Extracts structured event metadata from Ticketmaster by location and date.

[![Scrape Instagram Creators](https://img.shields.io/badge/Scrape_Instagram_Creators-informational?style=for-the-badge)](https://apify.com/rigelbytes/scrape-instagram-creators)\
Extracts detailed Instagram creator profiles and media-level information.

[![Immowelt Property Scraper](https://img.shields.io/badge/Immowelt_Property_Scraper-9cf?style=for-the-badge)](https://apify.com/rigelbytes/immowelt-property-scraper)\
Harvests large volumes of German real estate listings from immowelt.de.

[![Immobilienscout24-scraper](https://img.shields.io/badge/Immobilienscout24_Scraper-blue?style=for-the-badge)](https://apify.com/rigelbytes/immobilienscout24-scraper)\
Extracts real estate listings and contact data from immobilienscout24.de.

[![Instagram Creator Stats](https://img.shields.io/badge/Instagram_Creator_Stats-green?style=for-the-badge)](https://apify.com/rigelbytes/instagram-creator-stats)\
Analyzes Instagram profiles and computes engagement metrics for creator analysis.

[![Etsy Scraper](https://img.shields.io/badge/Etsy_Scraper-orange?style=for-the-badge)](https://apify.com/rigelbytes/etsy-scraper)\
Extracts structured product data from Etsy across categories, searches, and product pages.

[![Rightmove Scraper](https://img.shields.io/badge/Rightmove_Scraper-blueviolet?style=for-the-badge)](https://apify.com/rigelbytes/rightmove-scraper)\
Scrapes Rightmove.co.uk property listings with structured real estate data.

[![Outdoorsy Scraper](https://img.shields.io/badge/Outdoorsy_Scraper-red?style=for-the-badge)](https://apify.com/rigelbytes/outdoorsy-scraper)\
Extracts rental listing data from Outdoorsy search results.

### Understanding Proxies

When scraping data or browsing anonymously, proxies are essential. They act as intermediaries, masking your original IP address and allowing you to send requests from another location.

#### Why Use Proxies?

- **Avoid IP Blocks** — By routing requests through proxies, you prevent the target website from recognizing your IP as a scraper or spammer.
- **Access Geo-restricted Content** — Proxies let you access content or websites restricted by location.
- **Enhance Anonymity** — Hide your actual IP, ensuring privacy while scraping or browsing.

#### Types of Proxies

1. **Residential Proxies** — Real IPs from ISPs that mimic regular users. Best for long-term, undetectable scraping.
2. **Data Center Proxies** — Fast and cheap but easier to detect. Best for high-speed scraping with lower anonymity needs.
3. **Mobile Proxies** — IPs from mobile carriers (3G/4G/5G). Very hard to detect — ideal for sophisticated scraping.

#### Rotating Proxies vs. Straight Proxies

- **Rotating Proxies**: Every request goes through a different proxy, making it harder for websites to detect scraping patterns.
- **Straight Proxies**: All requests use the same IP, which is easier to track but simpler to set up.

### Recommended Proxy Providers

- ### **Shifter**

  - Reliable residential proxies worldwide
  - Competitive pricing
  - [Order Shifter Now](https://shifter.io/r/YoBB/order)
  - Get **10% off** any product with coupon `rigelbytes-YoBB`

- ### **OxyLabs**

  - **100M+ proxy pool**
  - Fast residential and data center proxies
  - Real human-like residential IPs with quality assurance
  - [Get OxyLabs Proxies](https://oxylabs.go2cloud.org/aff_c?offer_id=7\&aff_id=1366\&url_id=7)

- ### **DataImpulse**

  - Covers **200+ countries**
  - Residential proxies from just **$1/GB**
  - [Get DataImpulse Proxies](https://dataimpulse.com/?aff=89421)

### [![Learn More About Proxies](https://img.shields.io/badge/Learn_More-About_Proxies-blue?style=for-the-badge)](#understanding-proxies)

### 🙌 Why Buy Through Our Affiliate Link?

- **Exclusive Deals**: Some providers offer special discounts when you use our link.
- **Support Our Work**: Each purchase helps us maintain and improve the tools and services we provide.
- **No Extra Cost**: You pay the same price, but part of it goes to supporting our efforts.

### About Rigel Bytes

Rigel Bytes specializes in web scraping, automation, and data analytics. We help businesses extract and leverage valuable data for informed decision-making.

### Contact Us

Ready to unlock the power of data? Reach out to us at <contact@rigelbytes.com> or [book an appointment](https://cal.com/faizanali/appointments) with us to learn more about how we can help you achieve your data goals.

# Actor input Schema

## `post_urls` (type: `array`):

List of Instagram post or reel URLs to scrape comments from.

## `posts_concurrency` (type: `integer`):

Number of posts to scrape concurrently. Adjust based on expected post volume and rate limits.

## `sleep_min` (type: `number`):

Minimum random delay between pagination requests.

## `sleep_max` (type: `number`):

Maximum random delay between pagination requests.

## `request_timeout` (type: `number`):

Timeout for each GraphQL request.

## `request_retries` (type: `integer`):

Number of retries for transient request failures.

## `rate_limit_cooldown` (type: `number`):

How long to wait after hitting a rate limit before retrying.

## `rate_limit_max_waits` (type: `integer`):

Maximum number of rate limit cooldowns before stopping scrape for a post.

## `max_comments` (type: `integer`):

Maximum number of comments to scrape per post. Set to 0 for unlimited.

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

Select proxy groups or use your custom proxies

## Actor input object example

```json
{
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "posts_concurrency": 2,
  "sleep_min": 5,
  "sleep_max": 12,
  "request_timeout": 120,
  "request_retries": 1,
  "rate_limit_cooldown": 100,
  "rate_limit_max_waits": 3,
  "max_comments": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/my-actor-1").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 = {
    "post_urls": ["https://www.instagram.com/p/DWte0fylh5b/"],
    "max_comments": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/my-actor-1").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 '{
  "post_urls": [
    "https://www.instagram.com/p/DWte0fylh5b/"
  ],
  "max_comments": 20
}' |
apify call datascrapers/my-actor-1 --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datascrapers/my-actor-1",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Comment Scraper",
        "description": "Instagram Comment Scraper. get usernames, profile images, comment text, likes, reply counts, and dates — perfect for research, sentiment analysis, or influencer insights. Just for $2/1000 comments.",
        "version": "0.0",
        "x-build-id": "abOjBlDLNvYbNRpxB"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datascrapers~my-actor-1/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datascrapers-my-actor-1",
                "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/datascrapers~my-actor-1/runs": {
            "post": {
                "operationId": "runs-sync-datascrapers-my-actor-1",
                "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/datascrapers~my-actor-1/run-sync": {
            "post": {
                "operationId": "run-sync-datascrapers-my-actor-1",
                "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": [
                    "post_urls"
                ],
                "properties": {
                    "post_urls": {
                        "title": "Post URLs",
                        "type": "array",
                        "description": "List of Instagram post or reel URLs to scrape comments from.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "https://www.instagram.com/p/DWte0fylh5b/"
                        ]
                    },
                    "posts_concurrency": {
                        "title": "Posts Concurrency",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Number of posts to scrape concurrently. Adjust based on expected post volume and rate limits.",
                        "default": 2
                    },
                    "sleep_min": {
                        "title": "Min Delay (seconds)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Minimum random delay between pagination requests.",
                        "default": 5
                    },
                    "sleep_max": {
                        "title": "Max Delay (seconds)",
                        "minimum": 0,
                        "type": "number",
                        "description": "Maximum random delay between pagination requests.",
                        "default": 12
                    },
                    "request_timeout": {
                        "title": "Request Timeout (seconds)",
                        "minimum": 1,
                        "type": "number",
                        "description": "Timeout for each GraphQL request.",
                        "default": 120
                    },
                    "request_retries": {
                        "title": "Request Retries",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Number of retries for transient request failures.",
                        "default": 1
                    },
                    "rate_limit_cooldown": {
                        "title": "Rate Limit Cooldown (seconds)",
                        "minimum": 0,
                        "type": "number",
                        "description": "How long to wait after hitting a rate limit before retrying.",
                        "default": 100
                    },
                    "rate_limit_max_waits": {
                        "title": "Max Rate Limit Waits",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of rate limit cooldowns before stopping scrape for a post.",
                        "default": 3
                    },
                    "max_comments": {
                        "title": "Max Comments",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of comments to scrape per post. Set to 0 for unlimited.",
                        "default": 100
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxy groups or use your custom proxies",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "apifyProxyCountry": "US"
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
