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

Effortlessly extract comments from Instagram posts. Capture user details, engagement metrics, and nested replies. Perfect for social media analysis, influencer research, and brand monitoring. Stealth-enabled for reliable data collection.

- **URL**: https://apify.com/easyapi/instagram-comments-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 645 total users, 6 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: 1.80 out of 5 stars

## 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Instagram Comments Scraper 📸💬

Effortlessly extract comments from Instagram posts with this powerful Actor! 🚀

### 🌟 Features

- 🔍 Scrape comments from multiple Instagram posts
- 🕒 Retrieve historical comments, not just recent ones
- 👤 Capture user details like username, profile picture, and verification status
- 📊 Collect engagement metrics such as like counts and reply counts
- 🌐 Support for internationalization with multi-language comments

### 📊 Output Data

For each comment, the Actor collects:

- Comment ID and text
- User information (ID, username, profile picture URL)
- Timestamp
- Like count
- Reply count
- Parent comment ID (for nested comments)
- Verification status of the commenter
- And more!

### 🚀 Use Cases

- 📈 Social media analytics and sentiment analysis
- 🎯 Influencer marketing research
- 🔬 Academic studies on social media behavior
- 📣 Brand monitoring and reputation management

### 💡 Tips

- Use the `maxItems` parameter to limit the number of comments scraped
- Provide multiple post URLs to scrape comments from several posts in one run

Get valuable insights from Instagram comments today with this efficient and reliable scraper! 🎉

#### Input Example

A full explanation of an input example in JSON.

```
{
    "postUrls": [
        "https://www.instagram.com/p/DA9cFJ7RaaB/"
	],
    "maxItems": 20
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```
[
	{
		"postUrl": "https://www.instagram.com/p/DA9cFJ7RaaB/",
		"comment_id": "17989938422711285",
		"user_id": "459545336",
		"username": "joonaylton",
		"text": "Fenomenal",
		"created_at": "2024-10-11T19:55:08.000Z",
		"comment_like_count": 1,
		"parent_comment_id": null,
		"is_covered": false,
		"has_translation": null,
		"has_liked_comment": false,
		"giphy_media_info": null,
		"child_comment_count": 0,
		"restricted_status": null,
		"profile_pic_url": "https://scontent.cdninstagram.com/v/t51.2885-19/385177351_1370672637173531_438077278342037508_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=111&_nc_ohc=wTYox7OW6PAQ7kNvgHP9X53&_nc_gid=2427c96378094f6d8530393eff1e2bc7&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYB_HDxNct-Q7gMXUvo4UAvgHl2ycc1noQU9HtaBQs_ldg&oe=67196630&_nc_sid=10d13b",
		"fbid_v2": "17841400760087180",
		"is_verified": false,
		"is_unpublished": null
	},
	{
		"postUrl": "https://www.instagram.com/p/DA9cFJ7RaaB/",
		"comment_id": "18054124177853343",
		"user_id": "6982100797",
		"username": "andyespasandin",
		"text": "Que cantidad absurda de talento ❤️❤️",
		"created_at": "2024-10-10T22:18:50.000Z",
		"comment_like_count": 6,
		"parent_comment_id": null,
		"is_covered": false,
		"has_translation": true,
		"has_liked_comment": false,
		"giphy_media_info": null,
		"child_comment_count": 0,
		"restricted_status": null,
		"profile_pic_url": "https://scontent.cdninstagram.com/v/t51.2885-19/300651854_754917709122353_8491108705959008502_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent.cdninstagram.com&_nc_cat=105&_nc_ohc=93zEjfYJ71sQ7kNvgFDw724&_nc_gid=2427c96378094f6d8530393eff1e2bc7&edm=APs17CUBAAAA&ccb=7-5&oh=00_AYAXyrbQmkKKo7C3ClvzBc8B-RVRj9ZAm-GNkoiH9Ox85w&oe=67195107&_nc_sid=10d13b",
		"fbid_v2": "17841407103912762",
		"is_verified": false,
		"is_unpublished": null
	},
    ...
]
```

### Related Actors

- 📸 [Instagram Profile Scraper](https://apify.com/easyapi/instagram-profile-scraper) - Extract comprehensive Instagram profile data including follower counts, bios, and post stats.
- 📱 [Instagram Posts Scraper](https://apify.com/easyapi/instagram-posts-scraper) - Scrape Instagram posts data with comprehensive details including likes, comments, and hashtags.
- 🎥 [Instagram Videos Downloader](https://apify.com/easyapi/instagram-videos-downloader) - Download videos from Instagram posts, reels, and stories in high quality.
- 📸 [Instagram Photos Downloader](https://apify.com/easyapi/instagram-photos-downloader) - Save high-quality images from Instagram posts effortlessly.
- 🎬 [Instagram Reels Downloader](https://apify.com/easyapi/instagram-reels-downloader) - Download Instagram Reels videos in bulk with high quality.
- 📧 [Instagram Email Scraper](https://apify.com/easyapi/instagram-email-scraper) - Find and extract email addresses from Instagram profiles matching specific keywords.
- 🎯 [Instagram Hashtag Scraper](https://apify.com/easyapi/instagram-hashtag-scraper) - Scrape Instagram hashtag data including top posts and engagement metrics.
- 🎬 [Instagram Reels Scraper](https://apify.com/easyapi/instagram-reels-scraper) - Extract comprehensive metadata from Instagram Reels.
- 📸 [Instagram Tagged Posts Scraper](https://apify.com/easyapi/instagram-tagged-posts-scraper) - Extract detailed data from tagged posts on Instagram profiles.
- 💬 [Facebook Comments Scraper](https://apify.com/easyapi/facebook-post-comments-scraper) - Extract comments from public Facebook posts with detailed information.
- 💬 [TikTok Comments Scraper](https://apify.com/easyapi/tiktok-comments-scraper) - Scrape TikTok comments with advanced features and complete comment data.
- 💬 [YouTube Comments Scraper](https://apify.com/easyapi/youtube-comments-scraper) - Extract comprehensive YouTube video comments data with pagination support.
- 💬 [Reddit Comments Scraper](https://apify.com/easyapi/reddit-comments-scraper) - Extract Reddit comments with complete thread structure and engagement metrics.
- 📊 [Social Media Influencer Scraper](https://apify.com/easyapi/social-media-influencer-scraper) - Discover top influencers across TikTok, Instagram, and YouTube.
- 📧 [All-in-One Social Media Email Scraper](https://apify.com/easyapi/all-in-one-social-media-email-scraper) - Extract contact information across 30+ social platforms.

# Actor input Schema

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

List of Instagram post URLs to scrape comments from

## `maxItems` (type: `integer`):

Maximum number of comments to scrape (default: all available)

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DA9cFJ7RaaB/"
  ],
  "maxItems": 20
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("easyapi/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 = {}

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

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

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

```

## CLI example

```bash
echo '{}' |
apify call easyapi/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,easyapi/instagram-comments-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Is2z7LZ6gAOxIehh8/builds/iRrreHynSTh26AnTv/openapi.json
