Instagram Scraper
Pricing
from $0.01 / 1,000 results
Instagram Scraper
Extract comprehensive data from Instagram including profiles, posts, hashtags, comments, and engagement metrics. Features automatic chunking for large scrapes without login, optional authentication for full access, and robust extraction of photos, videos, captions, likes, and user interactions.
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer

John Adeolu
Actor stats
0
Bookmarked
9
Total users
5
Monthly active users
20 days ago
Last modified
Categories
Share
A professional Apify Actor that extracts comprehensive data from Instagram, including profiles, posts, followers, comments, hashtags, and engagement metrics.
Features
- ๐ค Profile Scraping: Extract profile information including bio, followers, following, posts count, verification status
- ๐ธ Post Extraction: Scrape posts with images, captions, likes, comments, and dates
- ๐ท๏ธ Hashtag Scraping: Extract posts from specific hashtags
- ๐ฌ Comments Extraction: Optional detailed comments with author information
- ๐ Engagement Metrics: Extract likes, comments count, and other engagement data
- ๐ Pagination Support: Automatically scrolls and loads more posts
- ๐ High Performance: Efficient scraping with proper error handling and retries
- ๐ Proxy Support: Built-in Apify Proxy support for reliable scraping
Input
| Field | Type | Required | Description |
|---|---|---|---|
username | String | No* | Instagram username to scrape (without @) |
hashtag | String | No* | Hashtag to scrape (without #) |
postUrl | String | No* | Direct URL to a specific Instagram post |
maxPosts | Number | No | Maximum number of posts to extract (default: 50, max: 1000) |
includeComments | Boolean | No | Whether to include comments for each post (default: false) |
maxComments | Number | No | Maximum number of comments per post if includeComments is true (default: 10, max: 100) |
includeLikes | Boolean | No | Whether to include likes count for each post (default: true) |
username_login | String | No | Optional: Your Instagram username for login. Without login, you'll get 1-12 posts. With login, up to 1000 posts accessible. |
password_login | String | No | Optional: Your Instagram password for login. Only needed if you want to scrape more posts. Can proceed without login. |
*At least one of username, hashtag, or postUrl must be provided
Example Input
{"username": "instagram","maxPosts": 100,"includeComments": true,"maxComments": 20,"includeLikes": true}
{"hashtag": "photography","maxPosts": 50}
{"postUrl": "https://www.instagram.com/p/ABC123xyz/"}
Output
The actor saves results to the Apify Dataset. Output format depends on the input:
Profile Data
{"username": "instagram","fullName": "Instagram","bio": "Bringing you closer to the people and things you love.","profilePicture": "https://instagram.com/...","followers": 1000000,"following": 100,"postsCount": 5000,"isVerified": true,"isPrivate": false,"profileUrl": "https://www.instagram.com/instagram/","timestamp": "2024-01-10T12:00:00.000Z"}
Post Data
{"postId": "ABC123xyz","postUrl": "https://www.instagram.com/p/ABC123xyz/","username": "instagram","mediaUrl": "https://instagram.com/...","caption": "Beautiful sunset ๐ ","likes": 50000,"commentsCount": 1000,"date": "2024-01-10T10:00:00.000Z","type": "photo","comments": [{"author": "user123","authorUrl": "https://www.instagram.com/user123/","text": "Amazing!","likes": null}],"timestamp": "2024-01-10T12:00:00.000Z"}
Hashtag Post Data
{"postId": "DEF456abc","postUrl": "https://www.instagram.com/p/DEF456abc/","hashtag": "photography","mediaUrl": "https://instagram.com/...","caption": "Great shot!","likes": 1000,"commentsCount": 50,"date": "2024-01-09T15:00:00.000Z","type": "photo","timestamp": "2024-01-10T12:00:00.000Z"}
Usage
Local Development
- Install dependencies:
$npm install
- Run the actor:
$npm start
Apify Platform
- Create a new actor on Apify
- Upload the actor files
- Configure input parameters
- Run the actor
Using Apify CLI
apify create instagram-scrapercd instagram-scraper# Copy files to the actor directoryapify pushapify call --memory=4096
Output Dataset
Results are saved to the Apify Dataset with different schemas depending on the input:
Profile Schema
- username: Instagram username
- fullName: Full display name
- bio: Profile bio
- profilePicture: Profile picture URL
- followers: Number of followers
- following: Number of accounts following
- postsCount: Total number of posts
- isVerified: Whether account is verified
- isPrivate: Whether account is private
- profileUrl: Profile URL
- timestamp: ISO timestamp of extraction
Post Schema
- postId: Unique post identifier
- postUrl: Direct URL to the post
- username: Post author username (if scraping profile)
- mediaUrl: URL to the post media (image/video)
- caption: Post caption text
- likes: Number of likes (if includeLikes is true)
- commentsCount: Number of comments
- date: Post date/time
- type: Post type (photo or video)
- hashtag: Hashtag (if scraping hashtag)
- comments: Array of comment objects (if includeComments is true)
- timestamp: ISO timestamp of extraction
Best Practices
-
Rate Limiting: Instagram may implement rate limiting for high-volume requests. Consider using Apify Proxy and adding delays.
-
Max Posts: Start with smaller values (50-100) to test before scaling up to avoid timeouts.
-
Comments: Enabling comments extraction significantly increases scraping time. Use only when necessary.
-
Private Accounts: Private accounts cannot be scraped without authentication. The actor will detect private accounts.
-
Login: Some features (like hashtag scraping) may require login for full access. The actor works without login but may have limitations.
-
Error Handling: The actor includes comprehensive error handling. Check the actor logs for any issues.
Limitations
- Instagram may require login for some features (hashtag scraping, private profiles)
- Instagram may implement rate limiting or CAPTCHA challenges for high-volume requests
- The actor respects Instagram's structure and may need updates if Instagram changes their UI
- Comments extraction requires additional page interactions and may slow down scraping
- Maximum 1000 posts per run (configurable via maxPosts)
- Private profiles cannot be scraped without authentication
Troubleshooting
No results found
- Verify the username/hashtag/postUrl is correct
- Check if the account is private (private accounts require login)
- Try increasing wait times if pages load slowly
Missing data fields
- Some posts may not have all fields (e.g., likes, comments)
- Instagram structure may vary by region or account type
- Check actor logs for extraction warnings
Scraping too slow
- Reduce maxPosts
- Disable includeComments if not needed
- Check your internet connection and Apify platform resources
- Consider using Apify Proxy for better performance
Login required
- Some features require Instagram login
- Hashtag scraping may show login prompts
- Consider implementing authentication for full access
Changelog
Version 1.0.0
- Initial release
- Profile scraping
- Post extraction
- Hashtag scraping
- Comments extraction support
- Engagement metrics extraction
License
ISC
Support
For issues, questions, or contributions, please visit the actor's page on Apify Store.