Instagram Comments Scraper By Sentiment Analysis
Pricing
Pay per usage
Instagram Comments Scraper By Sentiment Analysis
Instagram Comments Scraper extracts comments from any public Instagram post. Capture usernames, text, timestamps, likes, and replies in structured format. Ideal for sentiment analysis, research, audience insights, and automated workflows needing clean comment data.
Pricing
Pay per usage
Rating
5.0
(1)
Developer
API Empire
Maintained by CommunityActor stats
1
Bookmarked
74
Total users
11
Monthly active users
5 days ago
Last modified
Categories
Share
Instagram Comments Scraper — Extract Sentiment, Replies & Summaries
Instagram Comments Scraper By Sentiment Analysis pulls the comments and replies off any public Instagram post or reel and scores every one of them for sentiment, emotion, language, and topics. Every response is typed, normalized JSON — no HTML, no selectors, no parsing — with a deterministic rule-based sentiment score on every comment plus an optional per-post AI enrichment layer. Point it at a batch of post URLs and get back comment rows, nested reply rows, and a per-post sentiment summary ready to drop into a spreadsheet, a moderation queue, or an LLM pipeline.
What is Instagram Comments Scraper By Sentiment Analysis?
Instagram Comments Scraper By Sentiment Analysis is an Apify Actor that reads a public Instagram post or reel's comment thread through Instagram's own web GraphQL endpoints and returns every comment, its replies, and a per-post sentiment rollup as structured JSON. Comment surfaces are login-walled by Instagram, so reliable retrieval requires a sessionId cookie from your own Instagram account; without one, runs are likely to return no comments. Rule-based sentiment analytics always run at no extra cost — optional AI enrichment is available on top when you supply a model API key.
- Scrape top-level comments and their nested replies from any public post/reel
- Score every comment's sentiment, emoji polarity, language guess, and topics with a keyless rule-based engine
- Roll each post up into a summary row (sentiment split, top topics, top emojis)
- Optionally layer on model-graded sentiment/emotion/topics from Anthropic, OpenAI, Google, xAI, DeepSeek, Perplexity, or Mistral
- Export as JSON or CSV — no proxy management required
What data does Instagram Comments Scraper By Sentiment Analysis collect?
Each run returns three kinds of rows: individual comments, the replies nested inside them, and one sentiment summary per post.
| Data Type | Key Fields | JSON Field Names |
|---|---|---|
| Comments | text, likes, timestamp, commenter, reply count | text, likesCount, timestamp, ownerUsername, repliesCount |
| Replies (nested) | reply text, likes, commenter, parent comment | replies[].text, replies[].likesCount, replies[].ownerUsername, replies[].parentCommentId |
| Rule-based sentiment & language | sentiment label/score, emoji count, language guess | ruleSentiment, ruleSentimentScore, emojiCount, languageGuess |
| Optional AI enrichment | model-graded sentiment, emotion, topics | aiSentiment, aiEmotion, aiTopics |
| Per-post summary | sentiment split, top topics, top emojis, volume | sentimentPositivePct, topTopics, topEmojis, commentCount |
Need more Instagram data?
If you need engagement data at the account level instead of the comment level, Instagram Profile Scraper: Per-Post Likes & Comments pulls per-post like and comment counts straight from a profile's feed. If you're tracking brand mentions beyond a single post's comment thread, Instagram Mentions Scraper With Brand Mention Tracker watches for @mentions of an account across Instagram rather than analyzing one post's comments.
Why not build this yourself?
Instagram's comment surfaces are reverse-engineered GraphQL endpoints, not a documented public API — the queries, doc_id values, and pagination cursors are extracted at runtime from Instagram's own JS bundles and change without notice. Building and maintaining this yourself means reverse-engineering the same GraphQL calls, handling Instagram's login wall on comment threads, building a proxy escalation ladder for blocked requests, and then building a sentiment/emotion classification layer on top — all of which breaks again the next time Instagram changes its bundle. Instagram Comments Scraper By Sentiment Analysis maintains that scraping and scoring layer so you only maintain the URLs you feed it.
Why do developers and teams scrape Instagram?
For brand and community moderation teams
Moderation teams point this scraper at a brand's recent posts to surface the comments most likely to need a response — ruleSentiment: "negative" rows with high likesCount flag public complaints gaining traction, while isQuestion: true rows surface unanswered customer questions. Because replies are nested under each parent comment, a moderator can see whether a negative comment already got an internal reply without opening Instagram itself. Running this across a campaign's posts in one batch turns comment moderation from manual scrolling into a filterable dataset.
For marketers and social listening teams
Marketers use the per-post summary row to gauge audience reaction to a launch or campaign post without reading every comment — sentimentPositivePct, sentimentNegativePct, and topTopics give a quick read on whether a post landed well and what people are actually talking about. Comparing summary rows across several posts in the same run highlights which content style or messaging drew the most positive comment sentiment, and topEmojis adds a fast emotional-tone signal that plain text sentiment can miss.
For AI engineers and agent builders
Every comment row ships with ruleSentiment, ruleSentimentScore, languageGuess, and (optionally) aiSentiment/aiEmotion/aiTopics as stable typed fields, so an agent can filter or route comments without writing a classifier itself. A reputation-monitoring agent can watch for a spike in ruleSentiment: "negative" comments on a newly posted URL and escalate only the flagged rows to a human, while aiTopics gives the agent a short label to route the comment to the right internal queue.
For researchers and analysts
Researchers studying audience reaction, disclosure language, or sentiment trends around public posts can pull ruleSentiment, wordCount, languageGuess, and topTopics across a batch of posts without ever touching a private account or login-gated content. Because rule-based sentiment is deterministic and labelled ruleBased: true, the same input always produces the same score, which matters for reproducible analysis — and the per-post summary gives a ready-made aggregate instead of hand-tallying counts from raw comment rows.
How to scrape Instagram (step by step)
- Open Instagram Comments Scraper By Sentiment Analysis on its Apify Store listing and start a new run.
- Provide
analyzeUrls— one or more Instagram post/reel URLs or bare shortcodes to analyze. - Set
maxComments,includeNestedComments, andmaxRepliesto control collection depth, and supply your InstagramsessionIdcookie for reliable comment retrieval — Instagram login-walls its comment surfaces. - Optionally turn on
aiEnhancementwith anaiModelandaiApiKeyto layer model-graded sentiment/emotion/topics on top of the always-on rule-based analytics. - Start the run and download comment and summary rows as JSON or CSV from the Dataset tab, or read the full output array from the key-value store's
OUTPUTkey.
What to do when Instagram changes its structure
Instagram Comments Scraper By Sentiment Analysis is maintained, and its output field names and types stay stable even when Instagram changes its internal GraphQL queries or comment feed. Integrations built against this Actor's dataset schema keep working without code changes on your end.
⬇️ Input
| Parameter | Required | Type | Description | Example Value |
|---|---|---|---|---|
analyzeUrls | No | array | Instagram post/reel URLs (or bare shortcodes) to analyze. Accepts /p/, /reel/, /reels/, and /tv/. | ["https://www.instagram.com/p/DN8-GjPkgjS"] |
maxComments | No | integer | How many top comments to analyze per post. Min 1, max 500, default 20. | 20 |
includeNestedComments | No | boolean | Also collect and analyze replies for each top-level comment. Default true. | true |
maxReplies | No | integer | Replies to fetch per comment when replies are enabled. Min 0, max 50, default 5. | 5 |
aiEnhancement | No | boolean | Enable model-graded AI sentiment/emotion/topics enrichment on top of the rule-based analytics. Default false. | false |
aiModel | No | string | AI model to use when aiEnhancement is on. Provider auto-detected from the name (Claude/GPT/Gemini/Grok/DeepSeek/Sonar/Mistral). Default claude-haiku-4-5. | claude-haiku-4-5 |
aiApiKey | No | string | Provider API key for AI enrichment. Falls back to the matching provider env var if left empty. | sk-ant-... |
deduplicateResults | No | boolean | Drop duplicate comments (same id or identical normalized text) within the run. Default true. | true |
includeRunMetadata | No | boolean | Attach a runMetadata block (source URL, run id, scrapedAt) to every row. Default true. | true |
sessionId | No | string | Your Instagram sessionid cookie. Needed for reliable comment retrieval since Instagram login-walls comment surfaces. | "58012345%3A..." |
proxyConfiguration | No | object | Optional proxy configuration. The Actor also self-escalates none → datacenter → residential when Instagram restricts a request. | {"useApifyProxy": false} |
Example input
{"analyzeUrls": ["https://www.instagram.com/p/DN8-GjPkgjS"],"maxComments": 50,"includeNestedComments": true,"maxReplies": 10,"aiEnhancement": true,"aiModel": "claude-haiku-4-5","aiApiKey": "","deduplicateResults": true,"includeRunMetadata": true,"sessionId": "58012345%3Aabc123...","proxyConfiguration": { "useApifyProxy": false }}
The most common input mistake is leaving sessionId empty: Instagram login-walls its comment surfaces, so a run without a valid sessionid cookie is likely to complete cleanly but return zero comments.
⬆️ Output
Every result is typed, normalized JSON pushed to the Apify dataset — one row per comment, plus one summary row per post — exportable as JSON or CSV. Comment rows nest their replies and commenter details; summary rows aggregate the whole thread.
Scraped comment
{"postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/","commentUrl": "https://www.instagram.com/p/DN8-GjPkgjS/c/18123456789","id": "18123456789","text": "This is amazing! 😍 love the new drop","ownerUsername": "fan_account92","ownerProfilePicUrl": "https://scontent.cdninstagram.com/...jpg","timestamp": "2026-07-20T14:32:10.000Z","repliesCount": 1,"replies": [{"id": "18129988776","text": "totally agree, best drop yet","ownerUsername": "brand_official","ownerProfilePicUrl": "https://scontent.cdninstagram.com/...jpg","timestamp": "2026-07-20T14:40:02.000Z","repliesCount": 0,"replies": [],"likesCount": 4,"owner": {"fbid_v2": null,"id": "778899","username": "brand_official","is_verified": true,"profile_pic_url": "https://scontent.cdninstagram.com/...jpg","full_name": "Brand Official","is_private": false,"is_mentionable": true,"latest_reel_media": null,"profile_pic_id": null},"commentUrl": "https://www.instagram.com/p/DN8-GjPkgjS/c/18123456789/r/18129988776","parentCommentId": "18123456789","ruleSentiment": "positive","ruleSentimentScore": 0.5,"ruleBased": true,"emojis": [],"emojiCount": 0,"emojiPolarity": 0,"hashtags": [],"mentions": [],"wordCount": 5,"isQuestion": false,"isEmojiOnly": false,"languageGuess": "en"}],"likesCount": 132,"owner": {"fbid_v2": null,"id": "554433","username": "fan_account92","is_verified": false,"profile_pic_url": "https://scontent.cdninstagram.com/...jpg","full_name": "Fan Account","is_private": null,"is_mentionable": null,"latest_reel_media": null,"profile_pic_id": null},"ruleSentiment": "positive","ruleSentimentScore": 0.667,"ruleBased": true,"emojis": ["😍"],"emojiCount": 1,"emojiPolarity": 1,"hashtags": [],"mentions": [],"wordCount": 7,"isQuestion": false,"isEmojiOnly": false,"languageGuess": "en","aiSentiment": "positive","aiEmotion": "joy","aiTopics": ["product launch", "praise"],"type": "comment","isSummary": false,"scrapedAt": "2026-07-25T10:00:00.000Z","runMetadata": {"sourceUrl": "https://www.instagram.com/p/DN8-GjPkgjS/","sourceType": "instagram_post","runId": "abcXYZ123","scrapedAt": "2026-07-25T10:00:00.000Z","aiEnhancement": true}}
Per-post sentiment summary
{"type": "summary","isSummary": true,"postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/","commentCount": 50,"sentimentPositive": 31,"sentimentNegative": 6,"sentimentNeutral": 13,"sentimentPositivePct": 62.0,"sentimentNegativePct": 12.0,"sentimentNeutralPct": 26.0,"topTopics": ["drop", "price", "quality", "shipping", "colorway"],"topTopicCounts": { "drop": 14, "price": 9, "quality": 7, "shipping": 5, "colorway": 4 },"topEmojis": ["😍", "🔥", "❤️"],"languageBreakdown": { "en": 41, "es": 6, "pt": 3 },"questionCount": 8,"avgWordCount": 9.4,"totalLikes": 612,"scrapedAt": "2026-07-25T10:00:00.000Z","runMetadata": {"sourceUrl": "https://www.instagram.com/p/DN8-GjPkgjS/","sourceType": "instagram_post","runId": "abcXYZ123","scrapedAt": "2026-07-25T10:00:00.000Z","aiEnhancement": true}}
Every pushed row — each comment row and each per-post summary row — is billed as one row_result event; replies are nested inside their parent comment's row rather than billed as separate rows.
How many results can you scrape with Instagram Comments Scraper By Sentiment Analysis?
maxComments caps analyzed comments at up to 500 per post (default 20), and maxReplies separately caps replies at up to 50 per comment (default 5) — both are honest caps enforced in code, not silently clamped lower. There is no hard cap on how many post URLs you list in analyzeUrls; each is processed in turn within the same run. Pagination through Instagram's comment and reply GraphQL cursors is handled automatically, so you never manage after tokens yourself. No benchmark run time is published, since actual duration depends on how many posts, comments, and replies a given run requests, plus whether AI enrichment is enabled.
Integrate Instagram Comments Scraper By Sentiment Analysis and automate your workflow
Instagram Comments Scraper By Sentiment Analysis works with any language or tool that can send an HTTP request, through the standard Apify API.
REST API integration
from apify_client import ApifyClientclient = ApifyClient("<YOUR_APIFY_API_TOKEN>")run = client.actor("api-empire/instagram-comments-scraper-by-sentiment-analysis").call(run_input={"analyzeUrls": ["https://www.instagram.com/p/DN8-GjPkgjS"],"maxComments": 50,"sessionId": "58012345%3Aabc123...",})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item.get("type"), item.get("ruleSentiment"), item.get("text"))
Works in Python, Node.js, Go, Ruby, cURL.
MCP for AI agents
The Actor is callable through Apify's own MCP Server, which exposes any Apify Actor as a tool an MCP-compatible agent can invoke mid-task:
npx -y @apify/actors-mcp-server --actors API-Empire/instagram-comments-scraper-by-sentiment-analysis
Once registered, an agent running in Claude Desktop, Claude Code, Cursor, or another MCP client can call the Actor directly and get back typed comment and summary rows — no separate scraping or scoring step.
Automation platforms (n8n, Make)
In n8n, use the Apify node's "Run Actor" action with the Actor ID API-Empire/instagram-comments-scraper-by-sentiment-analysis and pass the JSON input shown above; the node returns comment and summary rows to the next step in your workflow. In Make, the Apify app's "Run Actor and Get Dataset Items" module accepts the same Actor ID and input object, letting you route negative-sentiment comments into a Slack alert, a moderation queue, or a spreadsheet without custom code.
Is it legal to scrape Instagram?
Yes — Instagram Comments Scraper By Sentiment Analysis only returns comments and replies from public Instagram posts and reels; private accounts and their comment threads are never accessible to it. Because comment rows include commenter usernames, full names, and profile pictures, they are personal data under GDPR and CCPA, and you are responsible for having a lawful basis before storing, analyzing, or otherwise processing that data at scale. Consult legal counsel for commercial use cases involving bulk personal data.
Frequently asked questions
Does Instagram Comments Scraper By Sentiment Analysis work without an Instagram account?
Technically it can run without one, but Instagram login-walls its comment surfaces — without a valid sessionId cookie from your own Instagram account, a run is likely to complete cleanly but return zero comments. No Apify-side Instagram account or login flow is required beyond your own session cookie.
How often is the scraped data updated?
Every run fetches comments and replies live from Instagram's GraphQL endpoints at the moment it runs. Nothing is cached or served from a previous run.
What happens if a post has no comments or can't be reached?
If a post has zero comments, the Actor returns a summary row with commentCount: 0 and no comment rows. If the post can't be reached at all (deleted, blocked, or persistently login-walled after proxy retries), the Actor logs an error and skips that post, continuing on to the next URL in analyzeUrls.
Can I scrape private Instagram posts or accounts?
No. Only comments on public posts and reels are accessible. Private accounts' posts and comment threads cannot be read without an authenticated session with access to that account, which this Actor does not provide.
Is the sentiment analysis real, or just a label?
It's real, and it's two layers. A deterministic rule-based engine — a word lexicon plus emoji polarity, with simple negation handling — always scores every comment and reply, marked ruleBased: true in the output, with no API key required. On top of that, optional AI enrichment (aiEnhancement) sends comment batches to a real LLM provider (Anthropic, OpenAI, Google, xAI, DeepSeek, Perplexity, or Mistral, based on the aiModel you pick) for model-graded aiSentiment, aiEmotion, and aiTopics; if that call fails for any reason, the AI fields are returned as null rather than a fabricated value — the rule-based fields are unaffected either way.
Does Instagram Comments Scraper By Sentiment Analysis work for AI agent workflows and LLM pipelines?
Yes. It's registered with Apify's MCP Server for direct tool-call access from MCP-compatible agents, and it's callable as a plain HTTP endpoint by any agent framework through the Apify API. Every response is typed JSON — no HTML, no selectors, no parsing step before passing results to an LLM.
How does Instagram Comments Scraper By Sentiment Analysis handle Instagram's anti-bot system?
It rotates a browser-matching user agent, sends unique CSRF tokens per request, and self-escalates its connection from none to a datacenter proxy group to a residential proxy group (retrying on fresh sticky sessions) whenever Instagram returns a blocked or login-wall response.
Does Instagram Comments Scraper By Sentiment Analysis return data in a format LLMs can use directly?
Yes. Every comment and summary row is typed, normalized JSON with stable field names — pass it directly into an LLM context window, index it into a vector store, or route it through an agent tool without a parsing step.
Can I use Instagram Comments Scraper By Sentiment Analysis without managing proxies?
Yes. The Actor self-escalates from a direct connection to Apify's datacenter and residential proxy groups automatically when Instagram blocks a request; you can optionally pass proxyConfiguration to influence the starting setup, but you never provision or rotate IPs yourself.
What happens when Instagram changes its structure or blocks the scraper?
Instagram Comments Scraper By Sentiment Analysis is maintained, and its output schema stays stable — field names and types don't change on your end even when Instagram's internal GraphQL queries or comment feed do.
Your feedback
Found a bug or missing a field? We want to know. Reach out through the Actor's page on Apify or the Apify Store issue channel for this Actor, and we'll take a look. Feedback like this is what keeps the schema accurate as Instagram's own comment feed evolves.