# Instagram Comment Leads Extractor (`coregent/instagram-comment-leads-extractor`) Actor

Extract leads from Instagram post and reel comments. Enrich commenter profiles, detect buying intent, score leads, and export flat CSV-friendly rows for outreach, prospecting, and social listening.

- **URL**: https://apify.com/coregent/instagram-comment-leads-extractor.md
- **Developed by:** [Delowar Munna](https://apify.com/coregent) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 comment 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

## Instagram Comment Leads Extractor

![Instagram Comment Leads Extractor](https://raw.githubusercontent.com/coregentdevspace/instagram-comment-leads-commenter-extractor-assets/main/thumbnail-instagram-comment-leads-commenter-extractor.jpg)

Extract leads from Instagram post and reel comments. Enrich commenter profiles, detect buying intent, score leads, and export flat CSV-friendly rows for outreach, prospecting, and social listening.

### What does this actor do?

**Instagram Comment Leads Extractor** is an Apify Actor that turns Instagram post and reel comments into actionable lead records. It identifies who is commenting, detects buying intent and contact signals, optionally enriches commenter profiles, and outputs one clean row per comment or per commenter — ready for CRM import, Google Sheets, or downstream enrichment.

Unlike generic Instagram comment scrapers that focus on raw comment data, this actor is **lead-generation-first** — built for agencies, brands, and sales teams who need prospect lists, not comment dumps.

Each comment row includes:
- **Post context** — source URL, post owner, caption, likes, comment count
- **Comment data** — text, timestamp, likes, reply status
- **Commenter identity** — username, full name, profile URL, verified status
- **Optional enrichment** — follower/following/post counts, bio, external URL, category
- **Intent signals** — question detection, buying intent, contact intent, recommendations, complaints
- **Lead scoring** — heuristic 0-100 score with transparent reasons
- **Keyword matching** — custom keyword tagging

### How it works

1. **Input** — Accept one or more public Instagram post/reel URLs
2. **Extraction** — Fetch post metadata and paginate comments via Instagram API
3. **Filtering** — Apply keyword filters, minimum likes, language allowlist
4. **Analysis** — Detect intent signals, match keywords, compute lead scores
5. **Enrichment** — Optionally fetch commenter public profile data
6. **Aggregation** — Optionally aggregate per commenter across multiple posts
7. **Export** — Output flat, CSV-friendly rows

### Use cases

#### Extract leads from competitor posts
A skincare brand wants commenters from competitor reels discussing acne, product recommendations, or purchase decisions.

#### Find high-intent commenters
A local service business wants comments containing phrases like "price?", "where are you located?", "DM me", "need this", "available in Canberra?", or "how can I order?".

#### Build creator or customer prospect lists
A UGC agency wants to identify active commenters on beauty, travel, or food niche posts, then optionally enrich profile-level details.

#### Social listening
A brand wants comments grouped by keyword themes like complaints, questions, praise, comparison, or buying intent.

#### Export clean CSV for outreach
A user needs one row per comment or one row per commenter, ready for Google Sheets, Airtable, CRM import, or downstream enrichment.

### Sample input

#### Example 1 — Quick comment export

```json
{
  "startUrls": [
    "https://www.instagram.com/p/DXFnCHojbs-/",
    "https://www.instagram.com/reel/DXG2abcDEF/"
  ],
  "maxCommentsPerUrl": 200,
  "outputMode": "comment_rows",
  "detectIntentSignals": true,
  "detectQuestionComments": true,
  "enableLeadScore": true
}
````

#### Example 2 — Lead discovery with enrichment

```json
{
  "startUrls": [
    "https://www.instagram.com/reel/DXF12abcXYZ/",
    "https://www.instagram.com/reel/DXG98defUVW/"
  ],
  "maxCommentsPerUrl": 500,
  "outputMode": "both",
  "includeReplies": true,
  "maxRepliesPerComment": 10,
  "enrichCommenterProfile": true,
  "includeProfileBio": true,
  "includeProfileExternalUrl": true,
  "includeProfileCounts": true,
  "detectIntentSignals": true,
  "enableLeadScore": true,
  "tagKeywords": ["price", "order", "available", "interested", "dm"],
  "dedupeCommentersAcrossUrls": true,
  "aggregateCommenterMetrics": true
}
```

### Input reference

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `startUrls` | string\[] | — | Instagram post or reel URLs (required) |
| `maxCommentsPerUrl` | integer | `500` | Max comments per URL |
| `maxRepliesPerComment` | integer | `10` | Max replies per comment |
| `maxUrls` | integer | `50` | Max URLs to process |
| `outputMode` | string | `"comment_rows"` | `comment_rows`, `commenter_rows`, or `both` |
| `includeReplies` | boolean | `false` | Include reply threads |
| `onlyPinnedComments` | boolean | `false` | Only pinned comments (best effort) |
| `sortMode` | string | `"default"` | `default`, `top_first`, `newest_first` |
| `minCommentLikes` | integer | `0` | Minimum comment likes filter |
| `keywordInclude` | string\[] | `[]` | Only comments with these keywords |
| `keywordExclude` | string\[] | `[]` | Exclude comments with these keywords |
| `languageAllowlist` | string\[] | `[]` | Language filter (best effort) |
| `enrichCommenterProfile` | boolean | `false` | Fetch commenter profile data |
| `includeProfileBio` | boolean | `true` | Include bio text |
| `includeProfileExternalUrl` | boolean | `true` | Include external URL |
| `includeProfileCounts` | boolean | `true` | Include follower/post counts |
| `includeRecentActivitySnapshot` | boolean | `false` | Include recent activity |
| `detectIntentSignals` | boolean | `true` | Detect buying/contact intent |
| `detectQuestionComments` | boolean | `true` | Detect questions |
| `tagKeywords` | string\[] | `[]` | Custom keywords to tag |
| `enableLeadScore` | boolean | `true` | Compute lead score (0-100) |
| `dedupeCommentersAcrossUrls` | boolean | `true` | Deduplicate commenters |
| `keepFirstSeenCommentOnly` | boolean | `false` | One comment per commenter |
| `aggregateCommenterMetrics` | boolean | `true` | Aggregate commenter metrics |
| `requestTimeoutSecs` | integer | `300` | Request timeout |
| `maxConcurrency` | integer | `1` | Max concurrent URLs |
| `debugMode` | boolean | `false` | Verbose logging |

### Output

The run produces four dataset views — **Comment Rows**, **Commenter Rows**, **Lead Signals**, and **Contact Hints** — all backed by the same dataset and each tuned for a specific workflow.

![Comment Rows table view](https://raw.githubusercontent.com/coregentdevspace/instagram-comment-leads-commenter-extractor-assets/main/instagram-comment-leads-commenter-extractor-output-comments-row-table-view.png)

#### Comment Rows

One row per comment, flat and CSV-friendly. Use this view for raw comment analysis, moderation, or as the base feed for downstream enrichment.

```json
{
  "sourceUrl": "https://www.instagram.com/p/DXFnCHojbs-/",
  "sourceType": "post",
  "postId": "3874674723871636286_217723373",
  "shortcode": "DXFnCHojbs-",
  "postOwnerUsername": "CNN",
  "postCaption": "Democratic Rep. Eric Swalwell announced Monday he planned to resign from Congress following explosive allegations of sexual misconduct against him.\n\nThe announcement from the California Democrat comes after mounting pressure from both Democrats and Republicans to step aside from his role in the House of Representatives.",
  "postTimestamp": "2026-04-13T21:54:09.000Z",
  "postLikeCount": 2840,
  "postCommentCount": 352,
  "commentId": "dom_2_1776130587350",
  "parentCommentId": null,
  "isReply": false,
  "commentText": "👏👏👏 And his bid for California governor. Don't care if you're a democrat or a republican or a flying purple people eater if you're accused of sexual assault, you deserve what you get.",
  "commentTextNormalized": "👏👏👏 and his bid for california governor. don't care if you're a democrat or a republican or a flying purple people eater if you're accused of sexual assault, you deserve what you get.",
  "commentTimestamp": "2026-04-14T01:32:29.000Z",
  "commentLikeCount": 0,
  "commenterUsername": "salty_but_humble_",
  "commenterFullName": null,
  "commenterProfileUrl": "https://www.instagram.com/salty_but_humble_/",
  "commenterIsVerified": false,
  "commenterFollowerCount": null,
  "commenterFollowingCount": null,
  "commenterPostCount": null,
  "commenterBio": null,
  "commenterExternalUrl": null,
  "commenterCategory": null,
  "commenterIsBusinessLike": null,
  "commenterRecentPostCount": null,
  "containsQuestion": false,
  "containsBuyingIntent": false,
  "containsContactIntent": false,
  "intentTags": null,
  "matchedKeywords": null,
  "leadScore": 30,
  "leadReason": "detailed_comment|multi_sentence",
  "extractedAt": "2026-04-14T01:36:41.558Z"
}
```

#### Commenter Rows

One row per unique commenter, aggregated across source URLs. Use this view when you want a de-duplicated prospect list with per-person activity metrics.

```json
{
  "commenterUsername": "salty_but_humble_",
  "commenterFullName": null,
  "commenterProfileUrl": "https://www.instagram.com/salty_but_humble_/",
  "commenterIsVerified": false,
  "commenterFollowerCount": null,
  "commenterFollowingCount": null,
  "commenterPostCount": null,
  "commenterBio": null,
  "commenterExternalUrl": null,
  "commenterCategory": null,
  "commenterIsBusinessLike": null,
  "totalCommentsCaptured": 2,
  "totalRepliesCaptured": 0,
  "distinctSourceUrls": 1,
  "firstSeenCommentAt": "2026-04-14T01:32:29.000Z",
  "lastSeenCommentAt": "2026-04-14T01:32:29.000Z",
  "sourceOwnerUsernames": "CNN",
  "sourceShortcodes": "DXFnCHojbs-",
  "exampleComments": "@american_muscle_truck your entire profile screams that you're compensating. 🍆. Ladies, you know exa | 👏👏👏 And his bid for California governor. Don't care if you're a democrat or a republican or a flying",
  "matchedKeywords": null,
  "aggregateIntentTags": null,
  "aggregateLeadScore": 30,
  "aggregateLeadReason": "active_commenter",
  "extractedAt": "2026-04-14T01:36:42.014Z"
}
```

#### Lead Signals

A focused view on lead-qualifying signals. Use this when you want to quickly rank commenters by buying intent, question presence, and lead score without the post-level noise.

```json
{
  "commenterUsername": "dannyperezcu",
  "commenterProfileUrl": "https://www.instagram.com/dannyperezcu/",
  "commentText": "Why you had to do it man why",
  "containsQuestion": true,
  "containsBuyingIntent": false,
  "containsContactIntent": false,
  "matchedKeywords": null,
  "intentTags": "question",
  "leadScore": 35,
  "leadReason": "question",
  "commenterIsVerified": false,
  "commenterFollowerCount": null,
  "commenterIsBusinessLike": null,
  "sourceUrl": "https://www.instagram.com/p/DXFnCHojbs-/",
  "postOwnerUsername": "CNN"
}
```

#### Contact Hints

A contact-oriented slice that highlights bio, external URL, category, and profile metrics next to the comment. Use this view to shortlist commenters you can actually reach out to (populated when `enrichCommenterProfile` is enabled).

```json
{
  "commenterUsername": "salty_but_humble_",
  "commenterFullName": null,
  "commenterProfileUrl": "https://www.instagram.com/salty_but_humble_/",
  "commenterBio": null,
  "commenterExternalUrl": null,
  "commenterCategory": null,
  "commenterFollowerCount": null,
  "commenterFollowingCount": null,
  "commenterPostCount": null,
  "commenterIsBusinessLike": null,
  "commentText": "@american_muscle_truck your entire profile screams that you're compensating. 🍆. Ladies, you know exactly what I mean about these big truck driving little wiener idiots 😂",
  "sourceUrl": "https://www.instagram.com/p/DXFnCHojbs-/"
}
```

### Intent tags

| Tag | Meaning |
|-----|---------|
| `question` | Comment contains a question |
| `buying_intent` | Mentions price, availability, ordering |
| `contact_intent` | Mentions DM, email, collaboration |
| `recommendation_request` | Asks for recommendations |
| `complaint` | Negative feedback |
| `spam_like` | Spam patterns detected |
| `emoji_only` | Comment is emoji-only |
| `generic_praise` | Single-word generic praise |

All intent tags and lead scores are **heuristic best-effort classifications**, not guaranteed labels.

### Lead scoring

Heuristic 0-100 score based on comment content and commenter profile signals:

**Positive signals**: questions (+15), buying intent (+25), contact intent (+20), detailed comment (+5), liked comment (+5-10), verified commenter (+10), commenter with external URL (+10), business-like commenter (+10), keyword matches (+10)

**Negative signals**: emoji-only (-30), generic praise (-20), spam patterns (-40), very short comment (-10)

### Pricing

Pay-per-event pricing:

- `comment-result`: one event per comment row output
- `commenter-result`: one event per aggregated commenter row output

The actor respects user spending limits — when the configured limit is reached, the run stops gracefully.

### Tips for best results

- **Start small** — test with `maxCommentsPerUrl: 20` to verify results
- **Use keyword filters** — `keywordInclude` and `tagKeywords` help find high-intent comments
- **Enable enrichment selectively** — `enrichCommenterProfile` significantly increases run time; use it for smaller batches
- **Commenter rows for prospecting** — use `outputMode: "commenter_rows"` with `dedupeCommentersAcrossUrls: true` to get one row per person

### Local development

```bash
cd actor
npm install
npm start      ## Run with INPUT.json
npm run dev    ## Run with local storage
```

# Actor input Schema

## `startUrls` (type: `array`):

Instagram post or reel URLs to extract comments from. Examples: https://www.instagram.com/p/ABC123/ or https://www.instagram.com/reel/XYZ789/

## `maxCommentsPerUrl` (type: `integer`):

Maximum number of comments to extract per post or reel URL.

## `maxRepliesPerComment` (type: `integer`):

Maximum number of replies to fetch per top-level comment (when replies are enabled).

## `maxUrls` (type: `integer`):

Maximum number of input URLs to process in a single run.

## `outputMode` (type: `string`):

Choose the output format: one row per comment, one row per commenter (aggregated), or both.

## `includeReplies` (type: `boolean`):

Include replies to top-level comments. Increases run time and data volume.

## `onlyPinnedComments` (type: `boolean`):

Extract only pinned comments (best effort, if detectable).

## `sortMode` (type: `string`):

Comment sort order (best effort, depends on API availability).

## `minCommentLikes` (type: `integer`):

Only include comments with at least this many likes. Leave 0 for no minimum.

## `keywordInclude` (type: `array`):

Only include comments containing at least one of these keywords (case-insensitive).

## `keywordExclude` (type: `array`):

Exclude comments containing any of these keywords (case-insensitive).

## `languageAllowlist` (type: `array`):

Only include comments that appear to be in one of these languages (best effort). Use two-letter codes: en, es, fr, etc.

## `enrichCommenterProfile` (type: `boolean`):

Fetch public profile data for each commenter (followers, bio, external URL). Significantly increases run time and cost.

## `includeProfileBio` (type: `boolean`):

Include commenter's biography text when profile enrichment is enabled.

## `includeProfileExternalUrl` (type: `boolean`):

Include commenter's external URL when profile enrichment is enabled.

## `includeProfileCounts` (type: `boolean`):

Include follower, following, and post counts when profile enrichment is enabled.

## `includeRecentActivitySnapshot` (type: `boolean`):

Include a recent posting activity snapshot when profile enrichment is enabled.

## `detectIntentSignals` (type: `boolean`):

Detect buying intent, contact intent, and other commercial signals in comments.

## `detectQuestionComments` (type: `boolean`):

Flag comments that contain questions.

## `tagKeywords` (type: `array`):

Custom keywords to match and tag in comments. Matched keywords appear in the matchedKeywords field.

## `enableLeadScore` (type: `boolean`):

Compute a heuristic lead score (0-100) for each comment based on intent signals and commenter profile.

## `dedupeCommentersAcrossUrls` (type: `boolean`):

When using commenter rows output, aggregate commenters across multiple input URLs.

## `keepFirstSeenCommentOnly` (type: `boolean`):

In comment rows mode, only keep the first comment per commenter (skip duplicates).

## `aggregateCommenterMetrics` (type: `boolean`):

When using commenter rows output, aggregate comment counts and intent tags per commenter.

## `requestTimeoutSecs` (type: `integer`):

Maximum time in seconds for processing each input URL.

## `maxConcurrency` (type: `integer`):

Maximum number of URLs to process concurrently.

## `debugMode` (type: `boolean`):

Enable verbose logging for debugging.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.instagram.com/p/DG8ntZ1OuGu/"
  ],
  "maxCommentsPerUrl": 500,
  "maxRepliesPerComment": 10,
  "maxUrls": 50,
  "outputMode": "comment_rows",
  "includeReplies": false,
  "onlyPinnedComments": false,
  "sortMode": "default",
  "minCommentLikes": 0,
  "keywordInclude": [],
  "keywordExclude": [],
  "languageAllowlist": [],
  "enrichCommenterProfile": false,
  "includeProfileBio": true,
  "includeProfileExternalUrl": true,
  "includeProfileCounts": true,
  "includeRecentActivitySnapshot": false,
  "detectIntentSignals": true,
  "detectQuestionComments": true,
  "tagKeywords": [],
  "enableLeadScore": true,
  "dedupeCommentersAcrossUrls": true,
  "keepFirstSeenCommentOnly": false,
  "aggregateCommenterMetrics": true,
  "requestTimeoutSecs": 300,
  "maxConcurrency": 1,
  "debugMode": false
}
```

# Actor output Schema

## `comments` (type: `string`):

No description

## `commenters` (type: `string`):

No description

## `leads` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("coregent/instagram-comment-leads-extractor").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("coregent/instagram-comment-leads-extractor").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 '{}' |
apify call coregent/instagram-comment-leads-extractor --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Comment Leads Extractor",
        "description": "Extract leads from Instagram post and reel comments. Enrich commenter profiles, detect buying intent, score leads, and export flat CSV-friendly rows for outreach, prospecting, and social listening.",
        "version": "1.0",
        "x-build-id": "P9O7tNfhAHdNrg7xz"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/coregent~instagram-comment-leads-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-coregent-instagram-comment-leads-extractor",
                "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/coregent~instagram-comment-leads-extractor/runs": {
            "post": {
                "operationId": "runs-sync-coregent-instagram-comment-leads-extractor",
                "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/coregent~instagram-comment-leads-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-coregent-instagram-comment-leads-extractor",
                "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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Post / Reel URLs",
                        "type": "array",
                        "description": "Instagram post or reel URLs to extract comments from. Examples: https://www.instagram.com/p/ABC123/ or https://www.instagram.com/reel/XYZ789/",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "https://www.instagram.com/p/DG8ntZ1OuGu/"
                        ]
                    },
                    "maxCommentsPerUrl": {
                        "title": "Max Comments Per URL",
                        "minimum": 1,
                        "maximum": 10000,
                        "type": "integer",
                        "description": "Maximum number of comments to extract per post or reel URL.",
                        "default": 500
                    },
                    "maxRepliesPerComment": {
                        "title": "Max Replies Per Comment",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Maximum number of replies to fetch per top-level comment (when replies are enabled).",
                        "default": 10
                    },
                    "maxUrls": {
                        "title": "Max URLs to Process",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum number of input URLs to process in a single run.",
                        "default": 50
                    },
                    "outputMode": {
                        "title": "Output Mode",
                        "enum": [
                            "comment_rows",
                            "commenter_rows",
                            "both"
                        ],
                        "type": "string",
                        "description": "Choose the output format: one row per comment, one row per commenter (aggregated), or both.",
                        "default": "comment_rows"
                    },
                    "includeReplies": {
                        "title": "Include Replies",
                        "type": "boolean",
                        "description": "Include replies to top-level comments. Increases run time and data volume.",
                        "default": false
                    },
                    "onlyPinnedComments": {
                        "title": "Only Pinned Comments",
                        "type": "boolean",
                        "description": "Extract only pinned comments (best effort, if detectable).",
                        "default": false
                    },
                    "sortMode": {
                        "title": "Sort Mode",
                        "enum": [
                            "default",
                            "top_first",
                            "newest_first"
                        ],
                        "type": "string",
                        "description": "Comment sort order (best effort, depends on API availability).",
                        "default": "default"
                    },
                    "minCommentLikes": {
                        "title": "Minimum Comment Likes",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Only include comments with at least this many likes. Leave 0 for no minimum.",
                        "default": 0
                    },
                    "keywordInclude": {
                        "title": "Keyword Include",
                        "type": "array",
                        "description": "Only include comments containing at least one of these keywords (case-insensitive).",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "keywordExclude": {
                        "title": "Keyword Exclude",
                        "type": "array",
                        "description": "Exclude comments containing any of these keywords (case-insensitive).",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "languageAllowlist": {
                        "title": "Language Allowlist",
                        "type": "array",
                        "description": "Only include comments that appear to be in one of these languages (best effort). Use two-letter codes: en, es, fr, etc.",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "enrichCommenterProfile": {
                        "title": "Enrich Commenter Profile",
                        "type": "boolean",
                        "description": "Fetch public profile data for each commenter (followers, bio, external URL). Significantly increases run time and cost.",
                        "default": false
                    },
                    "includeProfileBio": {
                        "title": "Include Profile Bio",
                        "type": "boolean",
                        "description": "Include commenter's biography text when profile enrichment is enabled.",
                        "default": true
                    },
                    "includeProfileExternalUrl": {
                        "title": "Include Profile External URL",
                        "type": "boolean",
                        "description": "Include commenter's external URL when profile enrichment is enabled.",
                        "default": true
                    },
                    "includeProfileCounts": {
                        "title": "Include Profile Counts",
                        "type": "boolean",
                        "description": "Include follower, following, and post counts when profile enrichment is enabled.",
                        "default": true
                    },
                    "includeRecentActivitySnapshot": {
                        "title": "Include Recent Activity Snapshot",
                        "type": "boolean",
                        "description": "Include a recent posting activity snapshot when profile enrichment is enabled.",
                        "default": false
                    },
                    "detectIntentSignals": {
                        "title": "Detect Intent Signals",
                        "type": "boolean",
                        "description": "Detect buying intent, contact intent, and other commercial signals in comments.",
                        "default": true
                    },
                    "detectQuestionComments": {
                        "title": "Detect Question Comments",
                        "type": "boolean",
                        "description": "Flag comments that contain questions.",
                        "default": true
                    },
                    "tagKeywords": {
                        "title": "Tag Keywords",
                        "type": "array",
                        "description": "Custom keywords to match and tag in comments. Matched keywords appear in the matchedKeywords field.",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "enableLeadScore": {
                        "title": "Enable Lead Score",
                        "type": "boolean",
                        "description": "Compute a heuristic lead score (0-100) for each comment based on intent signals and commenter profile.",
                        "default": true
                    },
                    "dedupeCommentersAcrossUrls": {
                        "title": "Deduplicate Commenters Across URLs",
                        "type": "boolean",
                        "description": "When using commenter rows output, aggregate commenters across multiple input URLs.",
                        "default": true
                    },
                    "keepFirstSeenCommentOnly": {
                        "title": "Keep First Seen Comment Only",
                        "type": "boolean",
                        "description": "In comment rows mode, only keep the first comment per commenter (skip duplicates).",
                        "default": false
                    },
                    "aggregateCommenterMetrics": {
                        "title": "Aggregate Commenter Metrics",
                        "type": "boolean",
                        "description": "When using commenter rows output, aggregate comment counts and intent tags per commenter.",
                        "default": true
                    },
                    "requestTimeoutSecs": {
                        "title": "Request Timeout (seconds)",
                        "minimum": 30,
                        "maximum": 600,
                        "type": "integer",
                        "description": "Maximum time in seconds for processing each input URL.",
                        "default": 300
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Maximum number of URLs to process concurrently.",
                        "default": 1
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Enable verbose logging for debugging.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
