Instagram Profile & Hashtag Scraper
Pricing
Pay per usage
Instagram Profile & Hashtag Scraper
Extract posts, comments, follower counts, engagement rates, and hashtag analytics from Instagram profiles using public page HTML parsing (meta tags, JSON-LD, embedded GraphQL data). Designed for influencer marketing research and campaign analysis.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Richard P
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
7 days ago
Last modified
Categories
Share
An Apify Actor that extracts public profile metadata, posts, follower counts, engagement rates, and hashtag analytics from Instagram.
Features
- Profile scraping — username, full name, biography, follower/following/post counts, verified status, profile picture, external URL
- Post extraction — shortcode, caption, likes, comments, media URL, timestamp, hashtags, mentions
- Hashtag exploration — recent posts for any hashtag with owner info
- Engagement rate — calculated from likes + comments per follower
- Multi-strategy extraction — tries meta tags, JSON-LD, embedded GraphQL data, and regex fallbacks
- Rate limited — 2-second delay between requests to avoid blocking
- Graceful abort — clean shutdown when the Actor is stopped
Input
| Field | Type | Description | Default |
|---|---|---|---|
profileUrls | string[] | Instagram profile URLs to scrape | [] |
hashtags | string[] | Hashtags to explore (with or without #) | [] |
maxPosts | integer | Max posts to extract per profile / hashtag (1-200) | 30 |
includeComments | boolean | Include comment counts when available | true |
includeLikes | boolean | Include like counts when available | true |
At least one of profileUrls or hashtags is required.
Example input
{"profileUrls": ["https://www.instagram.com/nasa/","https://www.instagram.com/natgeo/"],"hashtags": ["travel", "photography"],"maxPosts": 20,"includeComments": true,"includeLikes": true}
Output
Each dataset item is either a profile result or a hashtag result.
Profile output fields
| Field | Type | Description |
|---|---|---|
username | string | Instagram handle |
fullName | string? | Display name |
biography | string? | Profile bio text |
followerCount | integer? | Number of followers |
followingCount | integer? | Number of accounts followed |
postCount | integer? | Total number of posts |
isPrivate | boolean? | Whether the account is private |
isVerified | boolean? | Whether the account is verified |
profilePicUrl | string? | Profile picture URL |
externalUrl | string? | External link in bio |
engagementRate | number? | (Likes + Comments) / Followers × 100 |
posts | array | List of extracted posts (see below) |
scrapedAt | string | ISO 8601 timestamp of scrape |
error | string? | Error message if scraping failed |
Hashtag output fields
| Field | Type | Description |
|---|---|---|
hashtag | string | The hashtag (without #) |
postCount | integer? | Estimated total post count |
posts | array | List of extracted posts |
scrapedAt | string | ISO 8601 timestamp of scrape |
Post object fields
| Field | Type | Description |
|---|---|---|
shortcode | string | Unique post identifier |
caption | string? | Post caption text |
likes | integer? | Like count |
comments | integer? | Comment count |
mediaUrl | string? | URL of the image/video |
mediaType | string | GraphImage / GraphVideo / GraphSidepage |
timestamp | string? | ISO 8601 timestamp of the post |
isVideo | boolean | Whether the post is a video |
videoUrl | string? | URL of the video (if applicable) |
hashtags | string[] | Hashtags extracted from caption |
mentions | string[] | @mentions extracted from caption |
Example output
{"username": "nasa","fullName": "NASA","biography": "Explore the universe and discover our home planet.","followerCount": 75000000,"followingCount": 78,"postCount": 4200,"isPrivate": false,"isVerified": true,"profilePicUrl": "https://instagram.com/...","externalUrl": "https://www.nasa.gov/","engagementRate": 2.4513,"posts": [{"shortcode": "CxYzAbCdEfG","caption": "Exploring new worlds #space #science","likes": 1250000,"comments": 8452,"mediaUrl": "https://instagram.com/...","mediaType": "GraphImage","timestamp": "2026-06-15T14:30:00+00:00","isVideo": false,"videoUrl": null,"hashtags": ["space", "science"],"mentions": []}],"scrapedAt": "2026-07-04T12:00:00+00:00"}
Limitations
Instagram aggressively blocks automated access. This actor works without login by parsing the public HTML of profile and hashtag pages, but:
| Limitation | Details |
|---|---|
| No login | Some data (stories, full follower lists, private profiles) requires authentication |
| Rate limiting | Instagram may return 429 errors after several requests; the actor implements exponential back-off but heavy use will be blocked |
| JavaScript rendering | Instagram is fully client-side rendered. The actor extracts what's available from embedded JSON and meta tags — the richest data comes from __NEXT_DATA__ / __INITIAL_STATE__ blobs, which aren't always present |
| Post count | The full set of posts requires JS scrolling; this actor extracts what's available in the initial page load (usually first 12 posts) |
| Comment/like accuracy | Live like/comment counts shown on the page may differ from what's embedded in the HTML |
| Hashtag total count | The total post count for hashtags is estimated from meta tag descriptions |
For production use with authentication and JS rendering, consider:
- Using Playwright/Selenium (requires the Apify Playwright Actor base image)
- Using Instagram's Basic Display API (requires Facebook app registration)
- Using a commercial Instagram data provider
Local development
# Create virtualenvpython3 -m venv .venvsource .venv/bin/activate# Install dependenciespip install -r requirements.txt# Set Python path for apify CLIexport APIFY_ACTOR_PYTHON_VENV_PATH=.venv# Run locallyapify run --purge
Changelog
0.1.0 — Initial release
- Profile scraping with multi-strategy extraction
- Hashtag exploration
- Engagement rate calculation
- Graceful abort handling
- Rate limiting with exponential back-off