npx skills add ...
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-posts-by-hashtag
Scrapes Instagram posts for any hashtag using apidojo's Instagram scraper on Apify. Triggers when the user asks to: get Instagram posts for a hashtag, scrape Instagram content by tag, export Instagram post data for a keyword or topic, fetch posts under an Instagram challenge or trend, collect Instagram media for a specific tag, or download Instagram post metadata by hashtag. Returns post URL, caption, like count, comment count, author handle, and timestamp per post. Ideal for trend analysts, UGC collectors, and social media researchers.
npx skills add apidojo-io/apidojo-skills --skill scraping-instagram-posts-by-hashtag
Raw Instagram post dataset for any hashtag. Returns post-level metadata including engagement and author info.
APIFY_TOKEN environment variable set| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
startUrls | array | Optional | [] | Instagram hashtag search URLs |
keyword | string | Optional | — | Hashtag keyword to search (e.g. fitness) |
getReels | boolean | Optional | false | Include Reels in results |
getPosts | boolean | Optional | true | Include regular posts in results |
until | string | Optional | — | Date filter (YYYY-MM-DD) |
maxItems | number | Optional | Unlimited | Maximum posts to return |
customMapFunction | string | Optional | — | JavaScript function to transform each output object |
Recommended — run_actor.js (handles waiting, output, and file saving automatically):
APIFY_TOKENmust be set in environment or.envfile.
If Apify MCP is available:
REST API fallback:
Save id as RUN_ID. Poll until status = SUCCEEDED:
Fetch results:
0 results: Hashtag may be banned or restricted by Instagram.
Rate limiting: Keep maxItems ≤ 200 per run; space runs 5 minutes apart.
Tool: apify:run-actor
Actor: "apidojo~instagram-hashtag-scraper"
Input:
{
"keywords": ["tag1", "tag2"],
"maxItems": 100,
"mediaType": "all"
}curl -X POST \
"https://api.apify.com/v2/acts/apidojo~instagram-hashtag-scraper/runs?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"keywords": ["tag1"], "maxItems": 100}'curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"# Instagram Post Dataset: #<hashtag>
Posts collected: N | Media type: all/image/video
| Post ID | Author | Caption (truncated) | Likes | Comments | Type | Timestamp |
|---------|--------|---------------------|-------|----------|------|-----------|
| ... | ... | ... | ... | ... | ... | ... |
Available fields: id, ownerUsername, caption, likesCount, commentsCount, type,
timestamp, url, mediaUrl, hashtags, mentions