Scrapes Instagram posts by hashtag, returning media items with captions, like/comment counts, media URLs and user info from the hashtag explore feed. Use whe...
Browser
scraping-instagram-posts-by-hashtag
Try itScrapes 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.
What it does
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.
The skill document
Scraping Instagram Posts by Hashtag
Raw Instagram post dataset for any hashtag. Returns post-level metadata including engagement and author info.
Prerequisites
APIFY_TOKENenvironment variable set- Optional: Apify MCP server installed
Inputs
| 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 |
Workflow
Progress:
- [ ] Step 1: Normalize hashtag input
- [ ] Step 2: Run instagram-scraper
- [ ] Step 3: Poll for SUCCEEDED
- [ ] Step 4: Deliver post dataset
Step 2: Run the Actor
Recommended — run_actor.js (handles waiting, output, and file saving automatically):
# Quick answer (prints table to chat)
node scripts/run_actor.js \
--actor "apidojo~instagram-hashtag-scraper" \
--input '{"param": "value"}'
# Save as CSV
node scripts/run_actor.js \
--actor "apidojo~instagram-hashtag-scraper" \
--input '{"param": "value"}' \
--output YYYY-MM-DD_results.csv --format csv
# Save as JSON
node scripts/run_actor.js \
--actor "apidojo~instagram-hashtag-scraper" \
--input '{"param": "value"}' \
--output YYYY-MM-DD_results.json --format json
APIFY_TOKENmust be set in environment or.envfile.
If Apify MCP is available:
Tool: apify:run-actor
Actor: "apidojo~instagram-hashtag-scraper"
Input:
{
"keywords": ["tag1", "tag2"],
"maxItems": 100,
"mediaType": "all"
}
REST API fallback:
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}'
Save id as RUN_ID. Poll until status = SUCCEEDED:
curl "https://api.apify.com/v2/actor-runs/$RUN_ID?token=$APIFY_TOKEN" | grep '"status"'
Fetch results:
curl "https://api.apify.com/v2/actor-runs/$RUN_ID/dataset/items?token=$APIFY_TOKEN&format=json"
Step 3: Handle Edge Cases
- Banned hashtag: Instagram hides some hashtags — returns 0. Try parent category.
- Only top posts returned: Instagram limits hashtag feeds; very popular tags may return only top posts.
- Private account posts: Post metadata visible but media URL may be restricted.
Output Format
# Instagram Post Dataset: #
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
Troubleshooting
0 results: Hashtag may be banned or restricted by Instagram.
Rate limiting: Keep maxItems ≤ 200 per run; space runs 5 minutes apart.
Related skills
Scrapes Instagram posts tagged at a specific location or place using apidojo's Instagram Location scraper on Apify. Triggers when the user asks to: get Instagram posts from a location, scrape photos tagged at a restaurant or hotel, fetch Instagram content from an event or venue, collect posts from a geographic area on Instagram, export location- tagged Instagram media, or find what people post from a specific place on Instagram. Returns post URL, author handle, caption, likes, comments, and timestamp per post. Ideal for hospitality brands, event teams, and UGC content collectors.
Scrapes Instagram posts tagged at a specific location using apidojo's Instagram Location scraper on Apify. Triggers when the user asks to: find Instagram posts from a specific location or venue, scrape user-generated content from a restaurant, hotel, or event on Instagram, find photos tagged at a conference or festival, monitor what guests or visitors post from a location, discover content creators who visited a place, build a UGC library from a location tag, or find influencers who have been to a specific venue or city. Returns post URL, caption, author handle, likes, comments, and timestamp per location post. Ideal for hospitality brands, event marketers, and UGC content curation teams.
Monitors Instagram for brand mentions and tagged posts using apidojo's Instagram scraper on Apify. Triggers when the user asks to: track Instagram mentions of a brand or product, monitor hashtag activity around a brand on Instagram, find posts where users tag or mention a company on Instagram, discover organic brand sentiment on Instagram, find untagged brand mentions in captions, track user-generated content featuring a brand, or monitor competitor mentions on Instagram. Returns post URL, caption, author handle, likes, comments, timestamp, and mention type. Ideal for brand managers, social listening teams, PR agencies, and community managers.
Monitors Instagram hashtag performance and trends using apidojo's Instagram scraper on Apify. Triggers when the user asks to: track Instagram hashtag performance, monitor trending hashtags in a niche on Instagram, find the best hashtags for a content category, analyze hashtag reach and engagement on Instagram, discover new hashtags gaining traction in an industry, compare hashtag performance for a brand, or build an optimal Instagram hashtag strategy for a post. Returns hashtag volume, avg engagement per post, growth trend, and top-performing posts per tag. Ideal for Instagram content creators, social media managers, and brand content teams.
Scrapes Instagram posts tagged at a specific location or place, returning media items with captions, like/comment counts, media URLs and user info. Use when...