Instagram Data Scraper
Under maintenancePricing
Pay per usage
Instagram Data Scraper
Under maintenanceScrape public Instagram profile data, posts, captions, hashtags, engagement metrics, and profile information. Export results as JSON, CSV, or Excel. Fast, reliable, and easy to integrate into automation workflows.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Mahir Sutar
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Instagram Scraper โ Crawlee + Playwright
Search Instagram by hashtag or keyword, collect matching accounts, and extract their full profile info including bio, followers, website, email, and more.
๐ Project Structure
instagram-scraper/โโโ src/โ โโโ main.js โ Entry point (run this)โ โโโ config.js โ โ๏ธ Edit hashtags, keywords & settings hereโ โโโ routes.js โ Page handlers (hashtag / search / profile)โ โโโ parser.js โ Profile data extractorโ โโโ cookieLoader.js โ Reads cookies.jsonโ โโโ exporter.js โ Saves JSON + CSV outputโโโ cookies.json โ โ๏ธ Paste your Instagram cookies hereโโโ cookies.example.json โ Format referenceโโโ output/ โ Created automaticallyโ โโโ results.jsonโ โโโ results.csvโ โโโ summary.txtโโโ package.json
๐ Quick Start
1. Install dependencies
npm installnpx playwright install chromium
2. Configure what to scrape
Edit src/config.js:
hashtags: ['#photography', '#travel'], // hashtags to searchkeywords: ['digital art', 'AI tools'], // keywords to searchmaxAccountsPerSource: 50, // accounts to collect per source
3. Add your cookies (recommended)
Instagram blocks unauthenticated scrapers aggressively. Using your account's cookies dramatically improves results.
How to get cookies (Chrome):
- Install the EditThisCookie extension
- Log in to Instagram in Chrome
- Click EditThisCookie โ Export (copies JSON to clipboard)
- Paste into
cookies.json
Or use the Cookie-Editor extension โ export as JSON and paste into cookies.json.
The minimum cookies needed are: sessionid, csrftoken, ds_user_id
4. Run
$npm start
๐ Output
Results are saved to the output/ folder:
| File | Description |
|---|---|
results.json | Full data, all fields |
results.csv | Spreadsheet-friendly |
summary.txt | Count per source |
Fields collected per account
| Field | Description |
|---|---|
username | Instagram handle |
fullName | Display name |
bio | Full biography text |
website | Bio website link |
email | Email extracted from bio |
phone | Phone from bio/business profile |
followersCount | Follower count |
followingCount | Following count |
postsCount | Number of posts |
category | Business category (if set) |
isVerified | Blue tick |
isPrivate | Private account flag |
externalUrl | Bio link |
profileUrl | Direct Instagram URL |
source | Which hashtag/keyword found this account |
scrapedAt | Timestamp |
โ๏ธ Configuration Options (src/config.js)
| Setting | Default | Description |
|---|---|---|
hashtags | ['#photography'] | Hashtags to scrape |
keywords | ['digital art'] | Keywords to search |
maxAccountsPerSource | 50 | Accounts per hashtag/keyword |
maxPostsToScan | 30 | Posts to check per hashtag page |
maxRequests | 500 | Hard cap on total requests |
maxConcurrency | 2 | Parallel browser tabs |
headless | true | Run without visible browser |
delayMs | 2000 | Base delay between requests (ms) |
โ ๏ธ Tips & Troubleshooting
- Always use cookies โ Instagram requires login for most data
- Keep concurrency low (1โ2) to avoid rate limiting
- Check
output/debug-hashtag-*.pngif a hashtag returns no results โ it shows what the browser saw - Crawlee stores intermediate data in
storage/โ delete it withnpm run cleanbetween runs - Instagram frequently updates its page structure; the parser uses multiple fallback strategies
๐งช Test a single profile
You can quickly test the profile parser by adding a profile URL directly:
// In src/main.js, add to startUrls:{url: 'https://www.instagram.com/natgeo/',label: 'PROFILE',userData: { source: 'manual-test' },}
๐ Legal
This tool is for personal research and educational use only. Scraping Instagram may violate their Terms of Service. Use responsibly and respect rate limits.