mcpField
S
scraping-instagram-comments

scraping-instagram-comments

github.com/apidojo-ioData & databases1779 installsUpdated 24w ago
Repository

About scraping-instagram-comments

An Apify-based workflow for collecting raw Instagram post comments for downstream analysis. It accepts post URLs or IDs and returns comment text, timestamps, engagement counts, and commenter details.

Key features

  1. 01Scrape by post URL or ID
  2. 02Set a comment result limit
  3. 03Return comment text and timestamps
  4. 04Include commenter details and engagement
  5. 05Customize output mapping

Use cases

  1. 01Collect comments from selected posts
  2. 02Analyze comment text and likes
  3. 03Review commenters and reply counts

MCP support

Use Apify MCP's call_actor tool with apidojo~instagram-comments-scraper.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-instagram-comments

After installing, type/scraping-instagram-commentsin Claude Code to confirm it loaded.

Details

From the project README

Scraping Instagram Comments

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.


Inputs

ParameterTypeRequiredDefaultNotes
startUrlsarrayOptional[]Instagram post URLs
postIdsarrayOptional[]Instagram post IDs
maxItemsnumberOptionalUnlimitedMaximum comments to return
customMapFunctionstringOptional—JavaScript function to transform each output object

How to Run

Using run_actor.js (recommended)
# 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
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

FieldTypeDescription
postIdstringParent post ID
typestringAlways comment
idstringComment ID
userIdstringCommenter user ID
messagestringComment text
createdAtstringComment timestamp (ISO 8601)
likeCountnumberLikes on comment
replyCountnumberNumber of replies
user.idstringCommenter ID
user.usernamestringCommenter @username
user.fullNamestringCommenter full name
user.profilePicUrlstringCommenter profile picture
isRankedbooleanWhether 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.

Comments

Markdown supported