scraping-instagram-comments — Claude Code skill
Collects Instagram post comments through Apify, including text, engagement counts, timestamps, and commenter details. Useful for audience reaction analysis.
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a claude-codeWhat scraping-instagram-comments does
This skill runs the apidojo~instagram-comments-scraper actor on Apify. It accepts post URLs in startUrls or post IDs in postIds; maxItems limits the returned comments, while customMapFunction can reshape each output object. Results include the comment text, creation time, like and reply counts, user data, and ranking status.
The included workflow uses scripts/run_actor.js and can print a table or write CSV and JSON files. A REST fallback uses $APIFY_TOKEN, and an available Apify MCP connection can call the actor through call_actor. Private posts produce 0 results. A rate limit calls for a lower maxItems, while a deleted post returns an error and requires checking the URL.
What it helps with
- collect comments from an Instagram post URL
- export comment data to CSV or JSON
- inspect likes and replies for each comment
- gather commenter usernames and timestamps
- cap the result size with
maxItems
Example prompts for the agent
- Collect comments from the Instagram post
https://www.instagram.com/p/POSTCODE/and show them as a table. - Export up to 100 comments from
https://www.instagram.com/p/POSTCODE/toresults.csv. - Save this post's comments to
results.jsonas JSON.
How to install scraping-instagram-comments
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a claude-code2Manually: put the files in place
~/.claude/skills/scraping-instagram-comments/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/scraping-instagram-comments/
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a codex2Manually: put the files in place
.agents/skills/scraping-instagram-comments/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a cursor2Manually: put the files in place
.cursor/skills/scraping-instagram-comments/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install apidojo-io/apidojo-skills scraping-instagram-comments2Manually: put the files in place
.github/skills/scraping-instagram-comments/SKILL.md1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a gemini-cli2Platform CLI
gemini skills install https://github.com/apidojo-io/apidojo-skills --path skills/primitives/scraping-instagram-commentsManually: put the files in place
.devin/skills/scraping-instagram-comments/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about scraping-instagram-comments
How do I install scraping-instagram-comments in Claude Code?
Run npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a claude-code, then check ~/.claude/skills/scraping-instagram-comments/SKILL.md.
What does scraping-instagram-comments do?
It runs an Apify actor to collect comments from Instagram posts. The output contains comment text, timing, engagement counts, and commenter data.
How does the skill handle private posts and rate limits?
A private post produces 0 results. When requests are rate-limited, lower maxItems.
Source text
SKILL.md · Apache-2.0
---
name: scraping-instagram-comments
description: >
Extracts comments from Instagram posts using apidojo's Instagram Comments Scraper on Apify.
Triggers when the user asks to: get all comments on an Instagram post, scrape Instagram comment
data, export comments from an Instagram URL, fetch comment text and engagement from Instagram posts,
collect commenter usernames from a post, or download audience reaction data from Instagram content.
Returns comment text, like count, reply count, commenter username, verified status, and timestamp.
Ideal for sentiment analysts, community managers, and social media researchers.
license: Apache-2.0
metadata:
author: apidojo
version: "1.0"
apify-actor: apidojo/instagram-comments-scraper
---
# Scraping Instagram Comments
Raw data collection. No assumed use case — returns the full dataset for downstream analysis.
---
## Inputs
| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `startUrls` | array | Optional | `[]` | Instagram post URLs |
| `postIds` | array | Optional | `[]` | Instagram post IDs |
| `maxItems` | number | Optional | Unlimited | Maximum comments to return |
| `customMapFunction` | string | Optional | — | JavaScript function to transform each output object |
## How to Run
### Using run_actor.js (recommended)
```bash
# Quick answer (table)
node scripts/run_actor.js --actor "apidojo~instagram-comments-scraper" --input '{"startUrls": ["https://www.instagram.com/p/POSTCODE/"], "maxItems": 100}'
# Save as CSV
node scripts/run_actor.js --actor "apidojo~instagram-comments-scraper" --input '{"startUrls": ["https://www.instagram.com/p/POSTCODE/"], "maxItems": 100}' --output results.csv --format csv
# Save as JSON
node scripts/run_actor.js --actor "apidojo~instagram-comments-scraper" --input '{"startUrls": ["https://www.instagram.com/p/POSTCODE/"], "maxItems": 100}' --output results.json --format json
```
### REST API fallback
```bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~instagram-comments-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://www.instagram.com/p/POSTCODE/"], "maxItems": 100}'
```
If Apify MCP is available:
Use the Apify MCP `call_actor` tool with actor `apidojo~instagram-comments-scraper` and the input above.
---
## Output Fields
| Field | Type | Description |
|-------|------|-------------|
| `postId` | string | Parent post ID |
| `type` | string | Always `comment` |
| `id` | string | Comment ID |
| `userId` | string | Commenter user ID |
| `message` | string | Comment text |
| `createdAt` | string | Comment timestamp (ISO 8601) |
| `likeCount` | number | Likes on comment |
| `replyCount` | number | Number of replies |
| `user.id` | string | Commenter ID |
| `user.username` | string | Commenter @username |
| `user.fullName` | string | Commenter full name |
| `user.profilePicUrl` | string | Commenter profile picture |
| `isRanked` | boolean | Whether comment is ranked/top |
## Edge Cases
- **Private post**: Returns 0 results. Tell user the post or account is private.
- **Deleted post**: Returns error. Verify URL is correct.
- **Few comments**: Normal — post may genuinely have low engagement.
- **Missing fields**: Some users may not have fullName or isVerified; handle gracefully.
- **Rate limit**: Reduce maxItems or run at off-peak time.
© apidojo · Apache-2.0 · apidojo-io/apidojo-skills