Instagram Comment Scraper

Instagram Comment Scraper

by deepanshusharm

A fast and reliable Instagram comment scraper that extracts comments and replies from Instagram posts and reels. Built for speed with parallel process...

1 runs
1 users
Try This Actor

Opens on Apify.com

About Instagram Comment Scraper

A fast and reliable Instagram comment scraper that extracts comments and replies from Instagram posts and reels. Built for speed with parallel processing and designed to handle large-scale comment extraction efficiently.

What does this actor do?

Instagram Comment Scraper is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

Instagram Comment Scraper A fast and reliable Instagram comment scraper that extracts comments and replies from Instagram posts and reels. Built for speed with parallel processing and designed to handle large-scale comment extraction efficiently. ## 🚀 Features - Fast Scraping: Parallel processing with 20 concurrent workers for rapid comment extraction - Flexible Options: Scrape parent comments only or include all replies - Smart Limiting: Control total output with configurable comment limits - Rich Data: Includes usernames, profile pictures, timestamps, like counts, and more - Cookie Authentication: Simple browser cookie-based login (no password needed) - Multiple Posts: Process multiple Instagram posts in a single run ## 📋 Input ### Required Parameters | Parameter | Type | Description | |-----------|------|-------------| | cookies | array | Instagram session cookies from your browser (must include sessionid) | | post_urls | array | List of Instagram post/reel URLs to scrape | ### Optional Parameters | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | comment_limit | integer | 0 | Maximum comments per post (0 = unlimited). Counts total including replies. | | include_replies | boolean | true | Include comment replies or parent comments only | ### Example Input json { "cookies": [ { "name": "sessionid", "value": "61854802805%3AWqlSMdeVKE7hbp%3A12%3AAYhi...", "domain": ".instagram.com" }, { "name": "csrftoken", "value": "gNxSok0dLs17TXtgZc0ylsCuObChSEsv", "domain": ".instagram.com" } ], "post_urls": [ "https://www.instagram.com/p/ABC123XYZ/", "https://www.instagram.com/reels/DEF456UVW/" ], "comment_limit": 100, "include_replies": true } ## 📤 Output Each comment is saved as a separate item in the dataset with the following structure: json { "comment_id": "18075851018258413", "username": "john_doe", "user_id": "123456789", "profile_pic_url": "https://instagram.com/.../profile.jpg", "text": "Amazing content! 🔥", "created_at": "2024-12-18 11:24:58", "timestamp": 1734522298, "like_count": 15, "is_reply": false, "reply_count": 3, "media_id": "3788472140946025433" } ### Reply Comments Replies include an additional field: - parent_comment_id: ID of the parent comment this is replying to ### Field Descriptions | Field | Type | Description | |-------|------|-------------| | comment_id | string | Unique Instagram comment ID | | username | string | Username of the commenter | | user_id | string | Instagram user ID | | profile_pic_url | string | URL to user's profile picture | | text | string | Comment text content | | created_at | string | Human-readable timestamp (YYYY-MM-DD HH:MM:SS) | | timestamp | integer | Unix timestamp | | like_count | integer | Number of likes on the comment | | is_reply | boolean | Whether this is a reply to another comment | | reply_count | integer | Number of replies (parent comments only) | | parent_comment_id | string | Parent comment ID (replies only) | | media_id | string | Instagram post/reel ID | ## 🍪 How to Get Instagram Cookies ### Method 1: Browser Extension (Recommended) 1. Install a cookie extension: - Chrome/Edge: Cookie-Editor - Firefox: Cookie-Editor 2. Export cookies: - Log into Instagram in your browser - Open the cookie extension - Click "Export" and select "JSON" format - Copy the entire JSON array 3. Paste into input: - Paste the cookies array into the cookies field in the actor input ### Method 2: Manual Export 1. Open Instagram and log in 2. Open browser DevTools (F12) 3. Go to Application/Storage → Cookies → https://instagram.com 4. Find sessionid cookie and copy its value 5. Create a minimal cookies array: json { "cookies": [ { "name": "sessionid", "value": "YOUR_SESSION_ID_HERE", "domain": ".instagram.com" } ] } ⚠️ Important: The sessionid cookie is required. Without it, authentication will fail. ## ⚙️ How It Works ### Comment Limit Behavior The comment_limit parameter controls the total number of comments returned per post: #### With include_replies: true - Fetches parent comments and their replies - Returns up to comment_limit total comments (parent + replies combined) - Example: comment_limit: 50 might return 35 parent comments + 15 replies = 50 total #### With include_replies: false - Fetches only parent comments - Returns up to comment_limit parent comments - Example: comment_limit: 50 returns exactly 50 parent comments, no replies #### With comment_limit: 0 - Scrapes ALL comments (no limit) - Fetches everything available on the post ### Performance - Parent Comments: ~15-20 comments per second - Replies: 20 concurrent workers for parallel extraction - Typical Performance: 1,000 comments in 1-2 minutes ## 🔧 Use Cases - Social Media Analytics: Track engagement and sentiment on posts - Competitor Research: Analyze comments on competitor content - Influencer Marketing: Gather audience feedback data - Customer Service: Monitor brand mentions and questions - Research: Collect data for academic or market research ## ⚠️ Limitations & Notes - Cookie Expiration: Session cookies expire after some time (usually days/weeks). You'll need to refresh them periodically. - Rate Limiting: Built-in delays to avoid Instagram's rate limits. Don't modify these. - Private Posts: Your logged-in account must have access to private posts. - Disabled Comments: Posts with disabled comments will return empty results. - Large Posts: Posts with 10,000+ comments may take several minutes to complete. ## 🐛 Troubleshooting ### "sessionid not found in cookies" - Make sure you exported cookies correctly - Verify the sessionid cookie is present in the array ### "Login failed" - Your cookies may have expired - export fresh cookies - Make sure you're logged into Instagram in your browser ### "Failed to extract media ID" - Check that the URL is correct and accessible - Ensure the post exists and hasn't been deleted ### Slow Performance - Large posts with many comments naturally take longer - Reduce comment_limit for faster results - Set include_replies: false to skip reply fetching ## 🤝 Support For bugs, feature requests, or questions: - Open an issue on the actor's page - Contact Apify support - Check the Apify documentation ## 📜 License This actor is provided as-is for use on the Apify platform. ## ⚖️ Legal & Ethics - Terms of Service: Use of this actor should comply with Instagram's Terms of Service - Rate Limiting: The actor includes built-in delays to be respectful of Instagram's servers - Data Privacy: Be mindful of user privacy when collecting and using comment data - Responsible Use: Use this tool ethically and legally

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Instagram Comment Scraper now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
deepanshusharm
Pricing
Paid
Total Runs
1
Active Users
1
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support