Instagram Profile & Hashtag Scraper avatar

Instagram Profile & Hashtag Scraper

Pricing

Pay per usage

Go to Apify Store
Instagram Profile & Hashtag Scraper

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

Richard P

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

7 days ago

Last modified

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

FieldTypeDescriptionDefault
profileUrlsstring[]Instagram profile URLs to scrape[]
hashtagsstring[]Hashtags to explore (with or without #)[]
maxPostsintegerMax posts to extract per profile / hashtag (1-200)30
includeCommentsbooleanInclude comment counts when availabletrue
includeLikesbooleanInclude like counts when availabletrue

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

FieldTypeDescription
usernamestringInstagram handle
fullNamestring?Display name
biographystring?Profile bio text
followerCountinteger?Number of followers
followingCountinteger?Number of accounts followed
postCountinteger?Total number of posts
isPrivateboolean?Whether the account is private
isVerifiedboolean?Whether the account is verified
profilePicUrlstring?Profile picture URL
externalUrlstring?External link in bio
engagementRatenumber?(Likes + Comments) / Followers × 100
postsarrayList of extracted posts (see below)
scrapedAtstringISO 8601 timestamp of scrape
errorstring?Error message if scraping failed

Hashtag output fields

FieldTypeDescription
hashtagstringThe hashtag (without #)
postCountinteger?Estimated total post count
postsarrayList of extracted posts
scrapedAtstringISO 8601 timestamp of scrape

Post object fields

FieldTypeDescription
shortcodestringUnique post identifier
captionstring?Post caption text
likesinteger?Like count
commentsinteger?Comment count
mediaUrlstring?URL of the image/video
mediaTypestringGraphImage / GraphVideo / GraphSidepage
timestampstring?ISO 8601 timestamp of the post
isVideobooleanWhether the post is a video
videoUrlstring?URL of the video (if applicable)
hashtagsstring[]Hashtags extracted from caption
mentionsstring[]@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:

LimitationDetails
No loginSome data (stories, full follower lists, private profiles) requires authentication
Rate limitingInstagram may return 429 errors after several requests; the actor implements exponential back-off but heavy use will be blocked
JavaScript renderingInstagram 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 countThe full set of posts requires JS scrolling; this actor extracts what's available in the initial page load (usually first 12 posts)
Comment/like accuracyLive like/comment counts shown on the page may differ from what's embedded in the HTML
Hashtag total countThe 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 virtualenv
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Set Python path for apify CLI
export APIFY_ACTOR_PYTHON_VENV_PATH=.venv
# Run locally
apify 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