Instagram Comments Scraper
Pricing
$19.99/month + usage
Instagram Comments Scraper
Instagram Comments Scraper extracts comments from any public Instagram post. Capture usernames, text, timestamps, likes, and replies in structured format. Ideal for sentiment analysis, research, audience insights, and automated workflows needing clean comment data.
Pricing
$19.99/month + usage
Rating
0.0
(0)
Developer

API Empire
Actor stats
0
Bookmarked
3
Total users
2
Monthly active users
3 days ago
Last modified
Categories
Share
A powerful Apify Actor that scrapes comments from Instagram posts, reels, and IGTV videos. Supports multiple input formats including post URLs, shortcodes, and usernames with automatic latest post detection.
๐ Why Choose This Actor?
- Multiple Input Formats: Accept post URLs, shortcodes, or usernames (automatically fetches latest post)
- Smart Proxy Strategy: Collects first 15 comments without proxy, then switches to residential proxy for remaining data
- Flexible Sorting: Sort comments by popularity (most liked) or time (newest first)
- Bulk Processing: Process multiple posts in a single run
- Robust Error Handling: Automatic retries and proxy fallback mechanisms
- Detailed Logging: Real-time progress updates throughout the scraping process
โจ Key Features
- โ Scrape comments from Instagram posts, reels, and IGTV videos
- โ Support for usernames (automatically fetches latest post)
- โ Customizable comment limit (1-10,000 per post)
- โ
Two sort orders:
popular(most liked) ortime(newest first) - โ Automatic proxy fallback: no proxy โ datacenter โ residential
- โ Session management with automatic credential refresh
- โ Pagination support for large comment threads
- โ Bulk URL processing with rate limiting
๐ฅ Input
Input Schema
{"startUrls": ["https://www.instagram.com/p/DN8-GjPkgjS/","DN8-GjPkgjS","iamsrk"],"sortOrder": "popular","maxComments": 200,"proxyConfiguration": {"useApifyProxy": false}}
Input Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| startUrls | Array | โ Yes | - | List of Instagram post URLs, shortcodes, or usernames. Supports multiple formats: โข Full URLs: https://www.instagram.com/p/SHORTCODE/โข Shortcodes: DN8-GjPkgjSโข Usernames: iamsrk (fetches latest post automatically) |
| sortOrder | String | โ No | "popular" | How to sort comments: โข "popular" - Most liked comments firstโข "time" - Newest comments first |
| maxComments | Integer | โ No | 10 | Maximum number of comments to scrape per post (1-10,000) |
| proxyConfiguration | Object | โ No | {"useApifyProxy": false} | Proxy settings. By default, no proxy is used. The actor uses a smart strategy: โข First 15 comments: No proxy โข Remaining comments: Residential proxy (if configured) |
Input Examples
Example 1: Multiple Post URLs
{"startUrls": ["https://www.instagram.com/p/DN8-GjPkgjS/","https://www.instagram.com/p/ABC123xyz/"],"maxComments": 100,"sortOrder": "popular"}
Example 2: Shortcodes
{"startUrls": ["DN8-GjPkgjS","ABC123xyz"],"maxComments": 50}
Example 3: Usernames (Latest Post)
{"startUrls": ["iamsrk","mrbeast","cristiano"],"maxComments": 200,"sortOrder": "time"}
Example 4: Mixed Input
{"startUrls": ["https://www.instagram.com/p/DN8-GjPkgjS/","ABC123xyz","iamsrk"],"maxComments": 500,"sortOrder": "popular"}
๐ค Output
Comments are saved to the dataset with the following structure:
Output Schema
{"id": "1234567890","text": "Amazing post! ๐ฅ","timestamp": "2024-01-15T10:30:00Z","ownerUsername": "commenter_username","ownerProfilePicUrl": "https://instagram.com/...","postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"}
Output Fields
| Field | Type | Description |
|---|---|---|
| id | String | Unique comment ID (Instagram PK) |
| text | String | Comment text content |
| timestamp | String | ISO 8601 formatted timestamp (e.g., 2024-01-15T10:30:00Z) |
| ownerUsername | String | Username of the comment author |
| ownerProfilePicUrl | String | URL to the commenter's profile picture |
| postUrl | String | Original Instagram post URL |
Output Example
[{"id": "1234567890","text": "This is amazing! ๐ฅ","timestamp": "2024-01-15T10:30:00Z","ownerUsername": "fan_account","ownerProfilePicUrl": "https://scontent.cdninstagram.com/v/...","postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"},{"id": "9876543210","text": "Love this! โค๏ธ","timestamp": "2024-01-15T10:25:00Z","ownerUsername": "another_user","ownerProfilePicUrl": "https://scontent.cdninstagram.com/v/...","postUrl": "https://www.instagram.com/p/DN8-GjPkgjS/"}]
๐ฏ How to Use the Actor
Step 1: Open the Actor
- Go to the Apify Console
- Navigate to the Instagram Comments Scraper actor
- Click Start to create a new run
Step 2: Configure Input
-
Enter Post URLs, Shortcodes, or Usernames:
- For post URLs:
https://www.instagram.com/p/SHORTCODE/ - For shortcodes:
DN8-GjPkgjS - For usernames:
iamsrk(will fetch latest post automatically)
- For post URLs:
-
Set Maximum Comments:
- Enter the number of comments to scrape per post (1-10,000)
- Default:
10
-
Choose Sort Order:
popular- Most liked comments first (default)time- Newest comments first
-
Configure Proxy (Optional):
- By default, no proxy is used
- The actor automatically uses residential proxy after collecting first 15 comments
- Enable Apify Proxy if you need consistent proxy usage
Step 3: Run the Actor
- Click Start to begin scraping
- Monitor progress in the Log tab
- View results in the Dataset tab when complete
Step 4: Export Results
- Go to the Dataset tab
- Click Export to download results as:
- JSON
- CSV
- Excel
- XML
๐ง Proxy Strategy
The actor uses an intelligent proxy strategy to optimize performance and costs:
-
Initial Requests (First 15 Comments): No proxy used
- Faster and free
- Works for most public posts
-
Remaining Comments: Residential proxy (if configured)
- Automatically switches after collecting 15 comments
- Ensures reliable data collection for larger comment threads
- Handles rate limits and blocks
-
Automatic Fallback:
- If a request fails, the actor automatically retries
- Switches to residential proxy if needed
- Refreshes session credentials on 401 errors
๐ก Best Use Cases
- Social Media Monitoring: Track comments on brand posts or competitor content
- Sentiment Analysis: Collect comments for NLP and sentiment analysis
- Engagement Research: Analyze comment patterns and user engagement
- Content Moderation: Monitor comments for moderation purposes
- Market Research: Gather user feedback and opinions from Instagram posts
- Influencer Analytics: Analyze comment engagement on influencer posts
โ Frequently Asked Questions
Can I scrape comments from private accounts?
No, this actor only works with public Instagram posts. Private accounts require authentication and are not supported.
What happens if I provide a username?
The actor will:
- Fetch the user's profile page
- Extract the URL of their latest post
- Scrape comments from that post
How many comments can I scrape per post?
You can scrape up to 10,000 comments per post. Set maxComments to your desired limit.
Does the actor handle rate limiting?
Yes! The actor includes:
- Automatic retries with exponential backoff
- Proxy fallback mechanisms
- Session credential refresh on authentication errors
- Rate limiting delays between requests
Can I scrape comments from reels and IGTV?
Yes! The actor supports:
- Regular posts:
https://www.instagram.com/p/SHORTCODE/ - Reels:
https://www.instagram.com/reel/SHORTCODE/ - IGTV:
https://www.instagram.com/tv/SHORTCODE/
What if a post has no comments?
The actor will log a warning and continue to the next post. No data will be saved for posts without comments.
How long does scraping take?
Scraping time depends on:
- Number of posts to process
- Number of comments per post
- Network speed and proxy latency
Typically, 100 comments take 1-2 minutes per post.
โ ๏ธ Important Notes
- Rate Limiting: Instagram may rate limit requests. The actor includes automatic retries and delays.
- Public Posts Only: Only public Instagram posts can be scraped.
- Legal Compliance: Ensure you comply with Instagram's Terms of Service and applicable data protection laws.
- Data Usage: Use scraped data responsibly and in accordance with privacy regulations.
๐ Troubleshooting
No comments collected
Possible causes:
- Post is private or deleted
- Post has no comments
- Instagram blocked the request
Solutions:
- Verify the post URL is correct and public
- Enable proxy configuration
- Check the actor logs for detailed error messages
"Failed to get document ID" error
Possible causes:
- Instagram changed their API structure
- Request was blocked
Solutions:
- Enable residential proxy
- Try again after a few minutes
- Check if the post URL is valid
"Session expired (401)" error
Solution: The actor automatically refreshes session credentials. If the error persists, enable proxy configuration.
๐ Support
For issues, questions, or feature requests, please contact support or open an issue in the actor repository.
Version: 0.1
Last Updated: 2024