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

Collect and download Instagram posts, profiles, locations, hashtags, photos, and comments 📸. Retrieve data from Instagram using one or more URLs or search queries 🔍. Export the gathered data, run the scraper via API, schedule and track your runs, or integrate with other tools 🔄.

- **URL**: https://apify.com/scrapestorm/instagram-comments-scraper.md
- **Developed by:** [Storm\_Scraper](https://apify.com/scrapestorm) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 13 total users, 13 monthly users, 0.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## 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

## Advanced Instagram Comments Scraper 💬

The Instagram Comments Scraper is a tool designed to extract comments data from Instagram Posts. Simply provide the post link, and this scraper will retrieve:

        All the comments from the selected post with the possibility to define max comments 📝.
        Detailed information such as:
        Comment text 💬
        Author name 👤
        Profile URL 🌐
        Author profile image 🖼️
        Published date 📅
        And more additional information 🔍.

### Description 💪

Its strength 💪 lies in its ability to scrape not only comments from posts (with URLs containing "/p/"), 
but also even if authentication is required 🔒 to access the content!

### How to Use Instagram Comments Scraper? 🔍

Using the Instagram Comments Scraper is straightforward! It's designed to be user-friendly and accessible for all skill levels. Here's how you can use it:

1. **Sign up** for an account on **Apify**.
2. Open the **Instagram Comments Scraper** on the Apify platform.
3. Input the Instagram post URL for which you want to scrape comments.
4. Click the **"Start"** button and wait for the scraping process to complete.
5. Download the extracted data in various formats:
   - JSON
   - CSV
   - XML
   - Excel
   - HTML

### Pricing for Instagram Comments Scraper 💰

This scraper operates on a **pay-per-month** basis. You only pay for the successful results returned by the scraper.

- **Price**: $15.99 per month.

### Related Actors

If you're interested in other social media or real estate Actors:

- [Facebook Followers & Following Scraper 📊👥- Rental](https://apify.com/scrapestorm/facebook-followers-following-scraper)
- [Facebook Comments Scraper (All-in-One) 💬](https://apify.com/scrapestorm/facebook-comments-scraper-all-in-one)
- [Facebook Comments Scraper (All-in-One) 💬 - Pay Per Results](https://apify.com/scrapestorm/facebook-comments-scraper-all-in-one---pay-per-results)     
- [YouTube Scraper (By Keyword) - ⭐⭐⭐⭐⭐ Fast & cheap](https://apify.com/scrapestorm/youtube)  
- [YouTube Scraper (By Keyword) - ⭐ Fast & cheap - Result](https://apify.com/scrapestorm/youtube-scraper-by-keyword---fast-cheap---resultl) 
- [Youtube Channel Scraper](https://apify.com/scrapestorm/youtube-channel-scraper)
- [Youtube Shorts Scraper 📺 (Rental) - Fast & cheap](https://apify.com/scrapestorm/youtube-shorts-scraper-rental---fast-cheap)
- [Zillow (Find a Home Improvement Agent) 🛠️)](https://apify.com/scrapestorm/zillow-find-a-home-improvement-agent)   
- [YouTube Transcript Video Scraper 📝 (⚡ Fast & 💸 Cheap)](https://apify.com/scrapestorm/youtube-transcript-videos) 
- [Youtube Playlist Scraper 🎵 - Rental (Fast & cheap)](https://apify.com/scrapestorm/youtube-playlist-scraper---rental-fast-cheap)     

---

### Why scrape Instagram comments?

🚨 Detect and analyze social media trends, uncovering misinformation or harmful content.

📊 Perform market research and gain valuable insights.

🏁 Keep an eye on competitors and their activities.

💬 Measure brand sentiment and monitor changes in customer engagement.

### Input for Instagram Comments Scraper

The scraper accepts Instagram post URL as input. Here’s how to structure the input JSON:

````

{
"maxcomments": 200,
"post\_url": "https://www.instagram.com/p/C9fjv3PiOFa/"
}

```

### Output for Instagram Comments Scraper 📊

```

{
"Comment ID": 3,
"Comment Text": "You play against us 🐢 go back to you McDonald's league 🖕💔",
"Comment Creation Date": "2024-12-05 13:24:25",
"Author Username": "firincbd121",
"Author Profile Image": "https://instagram.frba3-1.fna.fbcdn.net/v/t51.2885-19/464247352\_853339110306517\_5009788475215377346\_n.jpg?stp=dst-jpg\_s150x150&\_nc\_ht=instagram.frba3-1.fna.fbcdn.net&\_nc\_cat=101&\_nc\_ohc=oC9Qe90njFsQ7kNvgElrxvq&\_nc\_gid=419a64a497b443938dca9b62c6215f82\&edm=AKp6CbIBAAAA\&ccb=7-5\&oh=00\_AYAARwaBVGr4UvXgf-FJIRfOlrejKMXt7V6IZSn\_fvGIgw\&oe=6757A7EA&\_nc\_sid=d62176",
"Author Profile URL": "https://www.instagram.com/firincbd121/",
"Isverified": false,
"Like count": 20,
"Reply count": 1,
"User id": "7950029662"
}

````

The results may differ from what you see when logged into your Instagram account.

# Actor input Schema

## `post_url` (type: `string`):

URL of the post to scrape comments from
## `maxcomments` (type: `integer`):

The maximum number of comments to fetch

## Actor input object example

```json
{
  "post_url": "https://www.instagram.com/p/C9fjv3PiOFa/",
  "maxcomments": 55
}
````

# 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_url": "https://www.instagram.com/p/C9fjv3PiOFa/",
    "maxcomments": 55
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapestorm/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 = {
    "post_url": "https://www.instagram.com/p/C9fjv3PiOFa/",
    "maxcomments": 55,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapestorm/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 '{
  "post_url": "https://www.instagram.com/p/C9fjv3PiOFa/",
  "maxcomments": 55
}' |
apify call scrapestorm/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Comments Scraper 💬",
        "description": "Collect and download Instagram posts, profiles, locations, hashtags, photos, and comments 📸. Retrieve data from Instagram using one or more URLs or search queries 🔍. Export the gathered data, run the scraper via API, schedule and track your runs, or integrate with other tools 🔄.",
        "version": "0.0",
        "x-build-id": "4dCf2L41f8HRZVp0C"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapestorm~instagram-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapestorm-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/scrapestorm~instagram-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapestorm-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/scrapestorm~instagram-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapestorm-instagram-comments-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "post_url"
                ],
                "properties": {
                    "post_url": {
                        "title": "Post_URL 🚨 (which preferably should contain the characters /p/) ",
                        "type": "string",
                        "description": "URL of the post to scrape comments from",
                        "default": "https://www.instagram.com/p/C9fjv3PiOFa/"
                    },
                    "maxcomments": {
                        "title": "Max comments, 🚨 Please do not increase the number of comments too much to avoid detection.",
                        "type": "integer",
                        "description": "The maximum number of comments to fetch",
                        "default": 55
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
