# Instagram Comments Scraper With Lead Enrichment (`scraper-engine/instagram-comments-scraper`) Actor

The Instagram Comments Scraper extracts comments from posts or reels, capturing usernames, text, timestamps, and engagement metrics. Ideal for social listening, sentiment analysis, and audience research, it delivers clean, structured data for insights, analytics, or API integration.

- **URL**: https://apify.com/scraper-engine/instagram-comments-scraper.md
- **Developed by:** [Scraper Engine](https://apify.com/scraper-engine) (community)
- **Categories:** Social media, Lead generation, Automation
- **Stats:** 118 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

$19.99/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period. You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#rental-actors

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Instagram Comment Scraper — Buying Intent, Emails and Lead Flags

Instagram Comments Scraper With Lead Enrichment turns post and reel comment sections into a structured lead list: it flags `buyingIntent`, `priceQuestion` and `partnershipInterest` with a rule-based lexicon, extracts `commentEmails` and `phoneCandidates` straight from the text, and can enrich each commenter's profile with `commenterFollowersCount` and `commenterBioEmail`. Output is typed JSON, ready for a CRM or spreadsheet. Start a run below to see it on your own posts.

### What is Instagram Comments Scraper With Lead Enrichment?

It's an Apify Actor that reads the comment section of any Instagram post or reel, scores each comment against a keyless intent lexicon, pulls out contact clues from the raw text, and optionally fetches each commenter's own public profile for follower counts and bio contact details. A logged-in Instagram session is required to read comments at all — the Actor's own code logs a warning and skips a post if no `sessionId` cookie is supplied, because Instagram no longer serves comment data to guest requests. It's built for growth marketers, social-selling and community teams, and developers wiring Instagram comment leads into a CRM or AI pipeline.

### What Instagram comment data is publicly available to scrape?

Instagram gates comment data behind a login session even on fully public posts — the real restriction here, not a private-account wall.

| Data category | Publicly viewable (no login) | Requires a session (`sessionid`) |
| --- | --- | --- |
| Post/reel existing at a URL | Yes | — |
| Comment text, author, timestamp | — | Yes — session-gated |
| Reply threads | — | Yes — same gate |
| Comment like counts | — | Yes — bundled with the fetch |
| Commenter's bio, followers, business flags | Yes, via `web_profile_info` | Rate-limited only |
| Contact info in a bio or comment | Yes, if published | — |

This Actor only returns data visible once a session can view the page — nothing private is unlocked.

### What data can I extract with Instagram Comments Scraper With Lead Enrichment?

Every run returns one row per comment or reply, combining the base comment fields, four lead-intent flags, four contact-clue extractors, and (optionally) an eleven-field commenter enrichment profile.

#### Comment identity & content fields

| Field | Description |
| --- | --- |
| `id` | Comment or reply's numeric ID |
| `type` | `"comment"` or `"reply"` |
| `isChild` | `true` for reply rows |
| `parentId` | Parent comment's ID (reply rows only, else `null`) |
| `parentCommentId` | Same parent-comment ID, carried from the reply payload (reply rows only) |
| `text` | The comment or reply text |
| `ownerUsername` | Commenter's username |
| `ownerProfilePicUrl` | Commenter's profile picture URL, as returned inline with the comment |
| `ownerId` | Commenter's numeric user ID |
| `owner` | Nested snapshot object: `fbid_v2`, `full_name`, `id`, `is_mentionable`, `is_private`, `is_verified`, `latest_reel_media`, `profile_pic_id`, `profile_pic_url`, `username` |
| `timestamp` | ISO-8601 UTC time the comment/reply was posted |
| `commentUrl` | Deep link to the comment or reply on Instagram |
| `postUrl` | The post/reel URL that was scraped |
| `replies` | Nested array of reply objects (comment rows only, populated when `includeReplies` is on) |
| `repliesCount` | Number of child replies Instagram reports for the comment |
| `scrapedAt` | ISO-8601 UTC time this row was scraped |

#### Lead-intent & engagement fields

| Field | Description |
| --- | --- |
| `isLead` | `true` if commercial intent or a contact clue was found |
| `intentFlags` | Nested object bundling the four booleans below |
| `buyingIntent` / `priceQuestion` / `partnershipInterest` / `supportRequest` | One boolean per rule-based intent lexicon |
| `matchedIntentKeywords` | The exact lexicon phrases (or your `customIntentKeywords`) that fired |
| `leadIntentScore` | Count of distinct intent categories that fired (0–4) |
| `likesCount` | Like count Instagram reports for the comment/reply |
| `aiIntent` | Optional AI-generated intent label — `null` unless `aiEnhancement` is on with a key |

#### Contact-clue & commenter-enrichment fields

| Field | Description |
| --- | --- |
| `commentEmails` | Email addresses found in the comment text (obfuscated at/dot patterns normalized) |
| `phoneCandidates` | Raw text substrings that look phone-shaped — never validated or reformatted |
| `commentUrls` | URLs mentioned in the comment text |
| `mentionedHandles` | `@handles` mentioned in the comment text |
| `commenterFullName`, `commenterBio`, `commenterBioEmail`, `commenterExternalUrl` | From the commenter's own profile (enrichment only) |
| `commenterFollowersCount`, `commenterFollowingCount`, `commenterPostsCount` | From the commenter's own profile (enrichment only) |
| `commenterIsBusiness`, `commenterIsProfessional`, `commenterBusinessCategory` | Business-account flags (enrichment only) |
| `commenterIsVerified`, `commenterIsPrivate` | Verification/privacy flags (enrichment only) |

All enrichment fields return `null` when `enrichCommenterProfiles` is off, the lookup fails, or the commenter is past the `maxProfileLookups` cap — never a fabricated value.

#### 🤖 Add-on: Need additional Instagram data?

If you need more than comment sections, pair this Actor with [Instagram Profile Scraper](https://apify.com/scraper-engine/instagram-profile-scraper) for full bio and post depth, or [Instagram Followers Scraper With Bio Contact Enrichment](https://apify.com/scraper-engine/instagram-followers-scraper-with-bio-contact-enrichment) to prospect from a profile's follower list instead of its comments. To find the posts to feed into this scraper in the first place, [Instagram Hashtag Scraper](https://apify.com/scraper-engine/instagram-hashtag-scraper) and [Instagram Mentions Scraper](https://apify.com/scraper-engine/instagram-mentions-scraper) surface posts by hashtag or by inbound brand mention.

### How does Instagram Comments Scraper With Lead Enrichment differ from the official Instagram API?

Meta's Instagram Graph API requires a Business or Creator account linked to a Facebook Page and can only manage comments on media that account owns — it was never designed to prospect leads from comment sections on other people's public posts.

| Feature | Instagram Graph API | Instagram Comments Scraper With Lead Enrichment |
| --- | --- | --- |
| Account type required | Business/Creator account linked to a Facebook Page | None of your own — just a session cookie to read comments |
| Scope of accessible comments | Only media your linked account/Page owns | Any public post or reel URL you can view |
| App approval | Meta Developer App + App Review for comment permissions | None — run directly from the Apify Store |
| Lead-intent detection | Not provided; raw comment objects only | Built-in rule-based intent flags on every row |
| Contact-clue extraction | Not provided | Built-in email/URL/handle/phone-candidate extraction |
| Commenter profile enrichment | Separate call, still scoped to your own audience | Optional, capped enrichment of any commenter's public profile |
| Setup time | Developer app registration plus review cycle | Paste URLs and a session cookie, run |

Use the Graph API to moderate or reply to comments on content you manage. Use this Actor to prospect leads from comment sections on any public post, including ones you don't own.

### How to use Instagram Comments Scraper With Lead Enrichment

This Actor runs on the Apify platform — no separate signup or API integration is required to try it.

1. Open the Actor's page on Apify Store and start a new run.
2. Paste one or more Instagram post/reel URLs into `targetPosts`.
3. Paste your Instagram `sessionid` cookie into `sessionId` — comments won't load without it.
4. Optionally turn on `leadsOnly` or `enrichCommenterProfiles` to narrow and deepen the results.
5. Start the run and export the dataset as JSON or CSV once it finishes.

#### How to scale to bulk Instagram comment extraction

`targetPosts` is an array — paste as many post or reel URLs as you want mined in a single run, and each is processed in turn with its own comment rows pushed to the same dataset. There is no separate "bulk mode" toggle; adding more URLs to the same list is the scaling mechanism.

### What can you do with Instagram comment data?

- A growth marketer running a giveaway uses `buyingIntent` and `commentEmails` to build a warm-lead list without reading every comment by hand.
- A community manager watching a product launch uses `supportRequest` and `matchedIntentKeywords` to triage complaints before they escalate.
- A sales rep prospecting comment sections uses `commenterFollowersCount` and `commenterIsBusiness` to prioritize outreach to business accounts.
- An agency scouting collabs uses `partnershipInterest` and `mentionedHandles` to catch ambassador and reseller pitches directly from comments.
- An AI engineer wiring an outreach agent uses `isLead` and `leadIntentScore` as a pre-filter, then passes the `text` field to an LLM to draft a personalized reply.

### How does Instagram Comments Scraper With Lead Enrichment handle rate limits and blocking?

Every request carries a freshly generated CSRF token and starts on your configured proxy, if any. On a blocked response (HTTP 403/429/503) the Actor escalates to Apify's residential proxy pool and retries up to three times before giving up on that post, logging a warning and moving to the next URL rather than failing the run. Commenter-profile enrichment lookups get their own pool of distinct residential proxy sessions — one per lookup where possible — and each lookup retries up to three times with a short backoff on 429/401/403 before returning `null` for that commenter. No CAPTCHA solving is implemented; if Instagram serves a login wall the affected post or profile lookup is skipped, not faked.

### ⬇️ Input

| Parameter | Required | Type | Description | Example Value |
| --- | --- | --- | --- | --- |
| `targetPosts` | No | array | Instagram post or reel URLs whose comment sections you want to mine for leads. | `["https://www.instagram.com/p/DN8-GjPkgjS"]` |
| `maxComments` | No | integer | How many top-level comments to scan per post (1–1000, default 10). | `50` |
| `includeReplies` | No | boolean | Also scan replies under each comment. | `true` |
| `maxReplies` | No | integer | Cap replies fetched per comment when reply threads are included (0–100, default 5). | `10` |
| `detectLeadIntent` | No | boolean | Flag buying-intent, price-question, support-request and partnership-interest comments using a rule-based, keyless lexicon (default `true`). | `true` |
| `customIntentKeywords` | No | array | Extra phrases that should mark a comment as buying-intent, matched case-insensitively. | `["où acheter"]` |
| `leadsOnly` | No | boolean | Output only comments/replies with commercial intent or a contact clue (default `false`). | `true` |
| `enrichCommenterProfiles` | No | boolean | Fetch each unique commenter's public profile — followers, bio, bio email, external link, business flags (default `false`). | `true` |
| `maxProfileLookups` | No | integer | Hard cap on unique commenter-profile fetches per run (0–500, default 20). | `50` |
| `sessionId` | No | string (secret) | Your Instagram `sessionid` cookie. Needed to collect comments at all. | `"6032xxxxxxx%3AaBcDeF..."` |
| `proxyConfiguration` | No | object | Optional proxy. Residential is recommended when enrichment is on. | `{"useApifyProxy": true}` |
| `aiEnhancement` | No | boolean | Add an AI lead-intent label on top of the rule engine (default `false`). | `false` |
| `aiModel` | No | string | AI model/provider for optional intent classification (default `"gpt-4o-mini"`). | `"claude-haiku-4-5"` |
| `aiApiKey` | No | string (secret) | Provider API key (OpenAI or Anthropic). Only used when AI classification is on. | `""` |

#### Example input

```json
{
  "targetPosts": [
    "https://www.instagram.com/p/DN8-GjPkgjS",
    "https://www.instagram.com/reel/C1a2B3cDefG/"
  ],
  "maxComments": 50,
  "includeReplies": true,
  "maxReplies": 10,
  "detectLeadIntent": true,
  "customIntentKeywords": ["où acheter", "shop link"],
  "leadsOnly": true,
  "enrichCommenterProfiles": true,
  "maxProfileLookups": 50,
  "sessionId": "6032xxxxxxx%3AaBcDeFgHiJkLmN%3A5%3AAYi...",
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] },
  "aiEnhancement": false,
  "aiModel": "claude-haiku-4-5",
  "aiApiKey": ""
}
```

### ⬆️ Output

Results are stored in the Actor's dataset as typed, normalized JSON with a consistent field set across every run, one row per comment or reply. Export as JSON, CSV, Excel or via the Apify API directly from the dataset.

#### Example output

```json
[
  {
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS",
    "commentUrl": "https://www.instagram.com/p/DN8-GjPkgjS/c/17912345678901234",
    "id": "17912345678901234",
    "text": "How much is this? Do you ship to the UK? contact@shopexample.com",
    "ownerUsername": "jane_retail_buyer",
    "ownerProfilePicUrl": "https://scontent.cdninstagram.com/v/t51/jane_pic.jpg",
    "ownerId": "9988776655",
    "owner": {
      "fbid_v2": "17891234567890123",
      "full_name": "Jane Buyer",
      "id": "9988776655",
      "is_mentionable": true,
      "is_private": false,
      "is_verified": false,
      "latest_reel_media": 0,
      "profile_pic_id": "3201234567890_9988776655",
      "profile_pic_url": "https://scontent.cdninstagram.com/v/t51/jane_pic.jpg",
      "username": "jane_retail_buyer"
    },
    "timestamp": "2026-07-20T14:03:11.000Z",
    "repliesCount": 1,
    "replies": [],
    "likesCount": 4,
    "type": "comment",
    "isChild": false,
    "parentId": null,
    "isLead": true,
    "intentFlags": {
      "buyingIntent": false,
      "priceQuestion": true,
      "supportRequest": false,
      "partnershipInterest": false
    },
    "buyingIntent": false,
    "priceQuestion": true,
    "supportRequest": false,
    "partnershipInterest": false,
    "matchedIntentKeywords": ["how much", "do you ship"],
    "leadIntentScore": 1,
    "commentEmails": ["contact@shopexample.com"],
    "phoneCandidates": [],
    "commentUrls": [],
    "mentionedHandles": [],
    "aiIntent": null,
    "commenterFullName": "Jane Buyer",
    "commenterBio": "Small business owner | UK",
    "commenterBioEmail": "jane@buyerbrand.co.uk",
    "commenterExternalUrl": "https://buyerbrand.co.uk/",
    "commenterFollowersCount": 812,
    "commenterFollowingCount": 340,
    "commenterPostsCount": 96,
    "commenterIsBusiness": true,
    "commenterIsProfessional": true,
    "commenterBusinessCategory": "Retail Company",
    "commenterIsVerified": false,
    "commenterIsPrivate": false,
    "scrapedAt": "2026-07-25T09:12:47.000Z"
  },
  {
    "postUrl": "https://www.instagram.com/p/DN8-GjPkgjS",
    "commentUrl": "https://www.instagram.com/p/DN8-GjPkgjS/c/17912345678901234/r/17923456789012345",
    "id": "17923456789012345",
    "text": "@jane_retail_buyer yes we ship worldwide, DM to order!",
    "ownerUsername": "shopexample",
    "ownerProfilePicUrl": "https://scontent.cdninstagram.com/v/t51/shop_pic.jpg",
    "timestamp": "2026-07-20T15:11:02.000Z",
    "repliesCount": 0,
    "replies": [],
    "likesCount": 1,
    "owner": {
      "fbid_v2": "17899988877766655",
      "full_name": "Shop Example",
      "id": "1122334455",
      "is_mentionable": true,
      "is_private": false,
      "is_verified": true,
      "latest_reel_media": 0,
      "profile_pic_id": "3209988877766_1122334455",
      "profile_pic_url": "https://scontent.cdninstagram.com/v/t51/shop_pic.jpg",
      "username": "shopexample"
    },
    "parentCommentId": "17912345678901234",
    "type": "reply",
    "isChild": true,
    "parentId": "17912345678901234",
    "ownerId": "1122334455",
    "isLead": true,
    "buyingIntent": true,
    "priceQuestion": false,
    "supportRequest": false,
    "partnershipInterest": false,
    "matchedIntentKeywords": ["dm to order"],
    "leadIntentScore": 1,
    "commentEmails": [],
    "phoneCandidates": [],
    "commentUrls": [],
    "mentionedHandles": ["@jane_retail_buyer"],
    "aiIntent": null,
    "commenterFollowersCount": null,
    "commenterBioEmail": null,
    "commenterExternalUrl": null,
    "commenterIsBusiness": null,
    "scrapedAt": "2026-07-25T09:12:49.000Z"
  }
]
```

### How does it work?

The Actor decodes each post's `media_id` directly from its URL shortcode, then loads the post page to locate Instagram's current comment and reply GraphQL persisted-query IDs before they change. It calls those GraphQL endpoints using your `sessionId` cookie and a freshly generated CSRF token, paging through comments and replies with cursor-based pagination. When enrichment is on, each unique commenter's username is looked up against Instagram's `web_profile_info` endpoint, capped and cached so repeat commenters don't re-count. Every comment and reply's text is then run through a deterministic keyword lexicon and regex-based contact-clue extraction — no browser rendering or JavaScript execution happens on your end. Because fields are normalized in code rather than scraped from rendered HTML, the output schema stays stable even as Instagram's page layout changes.

### Integrations

Instagram Comments Scraper With Lead Enrichment runs on Apify, so it works with anything that can call an HTTP API or an Apify client library — no proprietary SDK required.

#### Calling Instagram Comments Scraper With Lead Enrichment programmatically

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_API_TOKEN>")

run = client.actor("scraper-engine/instagram-comments-scraper-with-lead-enrichment").call(run_input={
    "targetPosts": ["https://www.instagram.com/p/DN8-GjPkgjS"],
    "sessionId": "<YOUR_INSTAGRAM_SESSIONID>",
    "leadsOnly": True,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["ownerUsername"], item["isLead"], item["commentEmails"])
```

Works in Go, Ruby, Node.js, cURL — any language that can make an HTTP request.

#### MCP integration for AI agents

This Actor is reachable through Apify's Actors MCP Server, which exposes Actors on Apify Store as callable tools for MCP-compatible clients such as Claude Desktop and Claude Code. Register it by connecting from this Actor's page in Apify Console, or by running `npx @apify/actors-mcp-server` configured with this Actor's store ID.

#### No-code tools (n8n, Make, LangChain)

In n8n, use the HTTP Request node (or the community Apify node) pointed at this Actor's run endpoint, passing `targetPosts` and `sessionId` in the request body. In Make, use the Apify app's "Run Actor and get dataset items" module and map `targetPosts` from an earlier scenario step. In LangChain, call the same Apify API endpoint from a custom Tool, or load results with the community Apify dataset loader, so an agent can pull fresh comment leads mid-conversation.

### Is it legal to scrape Instagram comments?

Scraping publicly visible comments is generally lawful in most jurisdictions, since this Actor only returns what a viewer with the post's URL and a valid session can already see — nothing behind a private account is accessed. That said, comment text, usernames, emails and enriched profile fields are personal data about identifiable people, so GDPR (EU/UK), CCPA (California) and similar regimes govern how you store and use it — you'll generally need a lawful basis (such as legitimate interest) and a way to honor deletion requests. Instagram's Terms of Service also restrict automated data collection, independent of privacy law. Consult legal counsel if your use case involves bulk storage of personal data.

### Frequently asked questions

#### What Instagram comment fields does Instagram Comments Scraper With Lead Enrichment return?

The top fields are `text`, `isLead`, `commentEmails`, `commenterFollowersCount` and `matchedIntentKeywords`, alongside the base comment fields (`ownerUsername`, `timestamp`, `likesCount`). See [What data can I extract](#what-data-can-i-extract-with-instagram-comments-scraper-with-lead-enrichment) above for the full field list.

#### How does the lead enrichment actually work?

It's three real, verifiable mechanisms stacked together, not a single black box: a deterministic keyword lexicon flags `buyingIntent`, `priceQuestion`, `partnershipInterest` and `supportRequest` in the comment text; regex extraction pulls `commentEmails`, `commentUrls`, `mentionedHandles` and `phoneCandidates` from that same text; and, only if `enrichCommenterProfiles` is on, one extra capped HTTP request per unique commenter fetches their own public profile for followers, bio and business flags. An optional fourth layer, `aiEnhancement`, calls OpenAI or Anthropic to add an `aiIntent` label, but only when a key is supplied — it is off and unused by default. The rule-based lexicon can miss phrasing outside its list or over-match ambiguous words, and `phoneCandidates` are raw, unverified text, not confirmed phone numbers.

#### Does Instagram Comments Scraper With Lead Enrichment require an Instagram account or login?

Yes, functionally: you must paste your own Instagram `sessionid` cookie into `sessionId`. Instagram no longer returns comment data to logged-out requests, so a run without a session ID logs a warning and skips every post.

#### How many Instagram comments can I extract in one run, and can I scrape multiple posts at once?

Up to 1000 top-level comments and 100 replies per comment, per post — and `targetPosts` accepts multiple post/reel URLs in the same run, each processed in turn into the same dataset.

#### What happens if a post has no comments, is blocked, or requires login?

The Actor logs a warning for that specific URL and moves on to the next one rather than failing the run; zero rows are pushed for the skipped post. Blocked responses (403/429/503) trigger an automatic residential-proxy retry first, and only fall through to a skip after those retries are exhausted.

#### Does Instagram Comments Scraper With Lead Enrichment work with Claude, ChatGPT, and other AI agent tools?

Yes. It's reachable through Apify's Actors MCP Server for MCP-compatible clients, and callable as a plain HTTP endpoint by any agent framework that can make API calls. It can also optionally call OpenAI or Anthropic models internally for `aiIntent` classification when you supply your own key.

#### What makes this different from scraping raw Instagram comments yourself?

It adds four rule-based intent flags, four contact-clue extractors and optional profile enrichment on top of the standard comment fields (`text`, `likesCount`, `replies`, `owner`), so leads are pre-filtered instead of requiring manual review of every comment.

#### Does Instagram Comments Scraper With Lead Enrichment return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with consistent field names across runs — no HTML parsing or CSS selectors. Pass it directly to an LLM, index it into a vector store, or feed it to an agent tool.

#### What happens when Instagram changes its layout or anti-bot system?

The Actor is maintained and the output schema stays stable across updates, since fields are normalized in code rather than scraped from rendered HTML. No specific turnaround time is promised for any given change.

#### Can I use Instagram Comments Scraper With Lead Enrichment without managing proxies or browser infrastructure?

Yes. It makes direct HTTP/GraphQL calls rather than driving a headless browser, and it automatically escalates from your configured proxy to Apify's residential proxy pool on a block — you don't need to run or configure anything yourself beyond an optional `proxyConfiguration`.

#### Which Instagram comment fields work best for AI training data and RAG indexing?

For RAG, index `text` alongside `matchedIntentKeywords` and `commenterBio` for retrievable context. For training data, `isLead`, `leadIntentScore`, `buyingIntent`/`priceQuestion`/`partnershipInterest`/`supportRequest` and `commenterIsBusiness` all return as consistent typed booleans/integers across every record.

### Related scrapers

| Scraper | What it extracts |
| --- | --- |
| [Instagram Profile Scraper](https://apify.com/scraper-engine/instagram-profile-scraper) | Bio, follower counts, verification and business flags |
| [Instagram Followers Scraper With Bio Contact Enrichment](https://apify.com/scraper-engine/instagram-followers-scraper-with-bio-contact-enrichment) | A profile's followers, optionally enriched with bio and contact fields |
| [Instagram Hashtag Scraper](https://apify.com/scraper-engine/instagram-hashtag-scraper) | Posts and reels by hashtag or keyword |
| [Instagram Mentions Scraper — Inbound Tagged Posts](https://apify.com/scraper-engine/instagram-mentions-scraper) | Posts where other accounts tagged or @-mentioned a handle |
| [Facebook Comments Scraper: Reaction Breakdown](https://apify.com/scraper-engine/facebook-comments-scraper-reaction-breakdown) | Facebook comments with reaction breakdown and engagement metrics |

### Your feedback

Found a bug or missing a field? Let us know through the Issues tab on this Actor's Apify Console page so we can take a look. Feedback like this directly shapes what gets fixed and added next.

# Actor input Schema

## `targetPosts` (type: `array`):

Instagram post or reel URLs whose comment sections you want to mine for leads. Example: https://www.instagram.com/p/SHORTCODE/

## `maxComments` (type: `integer`):

How many top-level comments to scan per post. Example: 50. Default 10.

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

Also scan replies under each comment (emitted as separate labeled child rows + a per-run replies dataset). Default true.

## `maxReplies` (type: `integer`):

Cap replies fetched per comment when reply threads are included. Example: 3. Default 5.

## `detectLeadIntent` (type: `boolean`):

Flag buying-intent, price-question, support-request and partnership-interest comments using a rule-based lexicon (keyless). Default true.

## `customIntentKeywords` (type: `array`):

Extra phrases that should mark a comment as buying-intent (e.g. your product name, 'où acheter'). Matched case-insensitively.

## `leadsOnly` (type: `boolean`):

Output ONLY comments that show commercial intent (buying/price/partnership) or carry a contact clue (email/link/phone candidate). Default false (emit all).

## `enrichCommenterProfiles` (type: `boolean`):

Fetch each unique commenter's public profile (followers, bio, bioEmail, external link, business flags) via one extra request. Capped by the limit below. Default false.

## `maxProfileLookups` (type: `integer`):

Hard cap on unique commenter-profile fetches per run (repeat commenters are cached and don't re-count). Example: 20. Default 20.

## `sessionId` (type: `string`):

Your Instagram `sessionid` cookie. Required to collect comments — Instagram gates comment data behind login, so logged-out runs return no comments. Copy it from your browser cookies for instagram.com.

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

Optional proxy. Residential is recommended when enrichment is on.

## `aiEnhancement` (type: `boolean`):

Add an AI lead-intent label on top of the rule engine. OFF by default; requires an API key below. Keyless runs are fully functional without it.

## `aiModel` (type: `string`):

Provider auto-detected from the name: claude-*=Anthropic, gpt-*/o1/o3=OpenAI. Cheaper mini/haiku models are recommended for classification.

## `aiApiKey` (type: `string`):

Provider API key (OpenAI or Anthropic). Only used when AI intent classification is ON. Leave blank to stay fully rule-based.

## Actor input object example

```json
{
  "targetPosts": [
    "https://www.instagram.com/p/DN8-GjPkgjS"
  ],
  "maxComments": 10,
  "includeReplies": true,
  "maxReplies": 5,
  "detectLeadIntent": true,
  "customIntentKeywords": [],
  "leadsOnly": false,
  "enrichCommenterProfiles": false,
  "maxProfileLookups": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "aiEnhancement": false,
  "aiModel": "gpt-4o-mini"
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped items in the Actor's default dataset.

# 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 = {
    "targetPosts": [
        "https://www.instagram.com/p/DN8-GjPkgjS"
    ],
    "maxComments": 10,
    "includeReplies": true,
    "maxReplies": 5,
    "customIntentKeywords": [],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraper-engine/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 = {
    "targetPosts": ["https://www.instagram.com/p/DN8-GjPkgjS"],
    "maxComments": 10,
    "includeReplies": True,
    "maxReplies": 5,
    "customIntentKeywords": [],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

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

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

```

## CLI example

```bash
echo '{
  "targetPosts": [
    "https://www.instagram.com/p/DN8-GjPkgjS"
  ],
  "maxComments": 10,
  "includeReplies": true,
  "maxReplies": 5,
  "customIntentKeywords": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call scraper-engine/instagram-comments-scraper --silent --output-dataset

```

## MCP server setup

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

```

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

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4va2nFSqdNaEyODCp/builds/boC1hxDeL4uab70fA/openapi.json
