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

Fetch clean, easy-to-read comments from a social media post, reel, or video. Choose recent or popular comments and collect as many as you need.

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

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Social Media Comments Scraper

Social Media Comments Scraper is a simple Instagram comments extractor built for marketers, creators, agencies, and researchers who need clean comment data from a post, reel, or video. It helps you collect Instagram comments in a readable format so you can review audience feedback, spot trends, and compare engagement without manual copying and pasting. Choose whether you want recent comments or the most popular comments first, then let the actor gather as many comments as you need. It is designed to save time, reduce busywork, and turn public comment sections into useful business insights.

### Key Features

- Extract comments from an Instagram post, reel, or video in a clean, easy-to-read list.
- Collect newer comments first or prioritize the most popular comments based on engagement.
- Load more comments automatically until your requested result limit is reached.
- Capture useful comment details such as comment text, author name, time, likes, and available links or identifiers.
- Track progress with clear status updates while the actor runs.
- Return a tidy result set that is easy to review, export, and share with your team.
- Help you analyze audience sentiment, engagement quality, and conversation themes faster.

### Use Cases

#### Social Media Research
Marketing teams use this Instagram comments scraper to understand how people react to a post, reel, or video. By reviewing comment text, author names, like counts, and comment time, they can quickly identify what content resonates and what questions keep coming up.

#### Brand Reputation Monitoring
Brands and community managers can collect comments to see how audiences respond to campaigns, product launches, or announcements. The combination of comment text, popularity, and timing helps teams spot praise, confusion, complaints, or recurring concerns before they grow.

#### Content Performance Analysis
Creators and social media managers often want to know which posts spark the strongest conversations. With recent or popular sorting, they can compare the tone and engagement of comments to decide what style of content to publish next.

#### Customer Feedback Review
If your audience uses Instagram to ask questions or leave feedback, this actor makes it easier to review those messages in one place. Comment text, author details, and timestamps help teams organize feedback and identify patterns that may influence product, service, or messaging decisions.

#### Influencer and Campaign Reporting
Agencies can use the collected comments to build clearer reports for clients. Comment volume, engagement signals, and the most active discussions help show whether a campaign created meaningful audience interaction, not just views.

### Input

| Field | Type | Required | Description | Example |
|---|---|---:|---|---|
| Post URL or ID | string | Yes | Paste the Instagram post link, or enter the post code or ID so the actor knows which post to read comments from. | CxYQJO8xuC6 |
| Sort comments by | string | No | Choose whether you want the newest comments first or the most popular comments first. | popular |
| Max results | integer | No | Set the total number of comments you want returned. The actor keeps loading more until it reaches this limit. | 10 |

### Output

| Field | Type | Description |
|---|---|---|
| comment_text | string | The text written by the commenter. This is the main content you want to review. |
| author_name | string | The display name of the person who wrote the comment. Useful for identifying who said what. |
| comment_time | string | When the comment was posted, shown in a readable format. Helpful for understanding timing and recency. |
| like_count | integer | How many likes the comment received. This helps you spot the most engaging or popular comments. |
| comment_id | string | A unique identifier for the comment, if available. Useful for tracking or referencing a specific comment later. |
| comment_url | string | A direct link to the comment or the post context, if available. Helpful for opening the source quickly. |
| post_id | string | The identifier of the post, reel, or video the comment belongs to. Useful when working with multiple posts. |
| run_summary | string | A short summary of how many comments were collected and whether the requested limit was reached. |

### Sample Output

```json
{
  "comment_text": "This is exactly the kind of content I needed today!",
  "author_name": "maria.creates",
  "comment_time": "2026-07-05 14:22",
  "like_count": 18,
  "comment_id": "17912345678901234",
  "comment_url": "https://www.instagram.com/p/CxYQJO8xuC6/",
  "post_id": "CxYQJO8xuC6",
  "run_summary": "Collected 1 comment from the selected post."
}
````

### How It Works

1. You paste the Instagram post URL, code, or ID into the input field.
2. You choose whether you want recent comments or popular comments first.
3. You set how many comments you want to collect, or leave the default if you only need a small sample.
4. The actor gathers the comments automatically and keeps loading more until it reaches your limit.
5. You receive a clean result set with readable comment details and a short summary of what was collected.

### Getting Started

Getting started is simple and does not require any coding experience. Click **Try for free**, paste your post URL or ID, choose your sorting preference, and set the number of comments you want. Then click **Run** and let the actor do the rest. When it finishes, you can review the results in a clean table and export them as JSON, CSV, or Excel for reporting and analysis.

### Frequently Asked Questions

#### Do I need technical skills?

No. This actor is designed for non-technical users. You only need to paste the post URL or ID, choose how you want the comments sorted, and click Run.

#### How fast does it run?

Speed depends on how many comments you request and how active the post is. Smaller requests usually finish quickly, while larger comment collections may take a bit longer because the actor keeps loading more results until it reaches your limit.

#### What format is the output?

The results are available in a clean, easy-to-review format and can be exported as JSON, CSV, or Excel. That makes it simple to share with teammates, analyze in spreadsheets, or import into your reporting workflow.

#### Is this legal to use?

This tool is intended for collecting publicly available comment data from posts you are allowed to review. You should always make sure your use complies with applicable laws, platform rules, and your own internal policies.

#### Can I schedule it to run automatically?

Yes, you can set it up to run on a schedule if you want regular comment tracking. This is useful for monitoring campaigns, launches, or ongoing audience feedback without checking manually every day.

# Actor input Schema

## `sort_by` (type: `string`):

Choose how comments should be ordered.

## `max_results` (type: `integer`):

Set the total number of comments you want returned. The actor will keep loading more comments until it reaches this limit.

## `code_or_id_or_url` (type: `string`):

Paste the post link, or enter the post code or ID. This tells the actor which post's comments to fetch.

## Actor input object example

```json
{
  "sort_by": "popular",
  "max_results": 10,
  "code_or_id_or_url": "DaX4sW1xJNW"
}
```

# 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 = {
    "sort_by": "popular",
    "max_results": 10,
    "code_or_id_or_url": "DaX4sW1xJNW"
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamagnet/instagram-post-comments-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {
    "sort_by": "popular",
    "max_results": 10,
    "code_or_id_or_url": "DaX4sW1xJNW",
}

# Run the Actor and wait for it to finish
run = client.actor("datamagnet/instagram-post-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 '{
  "sort_by": "popular",
  "max_results": 10,
  "code_or_id_or_url": "DaX4sW1xJNW"
}' |
apify call datamagnet/instagram-post-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Post Comments Scraper",
        "description": "Fetch clean, easy-to-read comments from a social media post, reel, or video. Choose recent or popular comments and collect as many as you need.",
        "version": "0.0",
        "x-build-id": "RRhcQSSehT6pNGIuz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamagnet~instagram-post-comments-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamagnet-instagram-post-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/datamagnet~instagram-post-comments-scraper/runs": {
            "post": {
                "operationId": "runs-sync-datamagnet-instagram-post-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/datamagnet~instagram-post-comments-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-datamagnet-instagram-post-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": [
                    "code_or_id_or_url"
                ],
                "properties": {
                    "sort_by": {
                        "title": "Sort comments by",
                        "enum": [
                            "recent",
                            "popular"
                        ],
                        "type": "string",
                        "description": "Choose how comments should be ordered."
                    },
                    "max_results": {
                        "title": "Max results",
                        "type": "integer",
                        "description": "Set the total number of comments you want returned. The actor will keep loading more comments until it reaches this limit."
                    },
                    "code_or_id_or_url": {
                        "title": "Post URL or ID",
                        "type": "string",
                        "description": "Paste the post link, or enter the post code or ID. This tells the actor which post's comments to fetch."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
