Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a claude-code
Open on GitHub

What 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/ to results.csv.
  • Save this post's comments to results.json as JSON.

How to install scraping-instagram-comments

1Skills CLI (Vercel)

npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-comments -a claude-code

2Manually: put the files in place

~/.claude/skills/scraping-instagram-comments/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/scraping-instagram-comments/

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

Similar skills

All skills for Browser and scraping →

From the same set57

benchmarking-instagram-influencer-engagement Pulls recent Instagram posts and turns them into engagement benchmarks: followers, average likes and comments, ER, posting frequency. CX Codex +1 757installs extracting-tiktok-comments-for-research Collects TikTok comments and supports sentiment, theme, and top-reaction analysis. Useful for audience research, product feedback, and content studies. CX Codex +1 757installs discovering-pre-launch-startups-on-twitter Finds startups before public launch on Twitter and groups signals by stage. Use it to scout early products, beta programs, and waitlists. CX Codex +1 754installs finding-software-engineers-on-twitter A skill that hunts for engineers and developers on Twitter/X by tech stack and open-to-work signals. Built for technical recruiters and hiring managers. CX Codex +1 752installs finding-freelancers-by-skill-on-twitter Finds freelancers and independent contractors on Twitter by skill, profile details, and signs they are open to work. Useful when a project needs outside specialists. CX Codex +1 740installs monitoring-instagram-hashtag-trends Pulls Instagram posts per hashtag and works out which tags actually earn engagement. Useful when you need a hashtag set for a post or a brand comparison. CX Codex +1 740installs finding-real-estate-professionals-on-twitter Finds real estate agents, brokers, investors, and other property professionals on Twitter/X through Apify. Useful for building targeted profile lists. CX Codex +1 739installs building-twitter-industry-watchlist Builds a curated list of key voices in an industry on X, with handle, follower count, engagement and an influence score. CX Codex +1 739installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor