使い方
- インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
- 必要なツール、認証情報、対応環境を原文で確認します。
- 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/apidojo-io/apidojo-skills --skill scraping-instagram-comments開始前の確認
- 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
- スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。
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)
# 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 jsonREST 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
| 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.

