Skip to content

Extract comments from Instagram posts (Reels, Feed) and merge them into a single text file. Perfect for research, sentiment analysis, and social media data processing.

License

Notifications You must be signed in to change notification settings

HilmiAlawi/IG-Comment-Extractor

Repository files navigation

⚡ Support the Code

Status Badge



Powering open-source intelligence... Need more energy to sustain the mission.



Saweria Donate Button



Access link → saweria.co/mipostify

📥 IG Comment Extractor & Merger

IG Comment Extractor is a simple Python-based tool to extract comments from Instagram posts (Reels, Feed) and merge them into a single file. Perfect for social media research, sentiment analysis, and other data needs.


🚀 Key Features

  • 🔗 Extract comments from multiple Instagram URLs
  • 🗂️ Automatically save comments into feeds/ and reels/ folders
  • 📄 Merge all comments into a single text file
  • 🎨 Interactive terminal interface using colorama and tqdm

📁 Project Structure

.
├── 2file.py            # Main script to extract Instagram comments
├── cookie.py           # Contains session/cookie data from Instagram
├── gabung.py           # Script to merge all extracted comments
├── requirements.txt    # Python dependencies
├── output_comments/
│   ├── feeds/          # Comments from feed posts
│   └── reels/          # Comments from reels
└── output_file/        # Final merged comment files

⚙️ Installation

  1. Clone the repository
git clone https://github.com/HilmiAlawi/IG-Comment-Extractor.git
cd IG-Comment-Extractor
  1. Install dependencies
pip install -r requirements.txt
  1. Prepare the cookie.py file

Fill in your Instagram session cookie data:

sessionid = "YOUR_SESSION_ID"
ds_user_id = "YOUR_USER_ID"
csrftoken = "YOUR_CSRF_TOKEN"
mid = "YOUR_MID"

▶️ How to Use

1. Extract Instagram Comments

python 2file.py
  • Paste one or more Instagram post URLs (feed/reel)
  • Press Enter after each URL
  • Type done when finished

Comments will be saved automatically in output_comments/feeds or output_comments/reels.


2. Merge All Comments

python gabung.py
  • Enter the desired output file name
  • The merged file will be saved in output_file/

❗ Important Notes

  • You must be logged in to Instagram in a browser to get your cookie.
  • Make sure the cookie is still valid and active.
  • This tool is not officially affiliated with Instagram. Use responsibly.

🧠 Use Cases

  • 📊 Social media sentiment analysis
  • 🧪 Academic research or thesis
  • 💼 Digital marketing and brand monitoring

📜 License

This project is licensed under the MIT License.
© 2025 Hilmi Alawi


📍 Tasikmalaya
🎥 Photo & Video • 📢 Event Organizer • 📲 Digital Marketing • 📱 Social Media Handling

███╗   ███╗██╗██████╗  ██████╗ ███████╗████████╗██╗███████╗██╗   ██╗
████╗ ████║██║██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██║██╔════╝╚██╗ ██╔╝
██╔████╔██║██║██████╔╝██║   ██║███████╗   ██║   ██║█████╗   ╚████╔╝ 
██║╚██╔╝██║██║██╔═══╝ ██║   ██║╚════██║   ██║   ██║██╔══╝    ╚██╔╝  
██║ ╚═╝ ██║██║██║     ╚██████╔╝███████║   ██║   ██║██║        ██║   
╚═╝     ╚═╝╚═╝╚═╝      ╚═════╝ ╚══════╝   ╚═╝   ╚═╝╚═╝        ╚═╝   

If you find this tool useful, don't forget to ⭐ star the repo on GitHub!

About

Extract comments from Instagram posts (Reels, Feed) and merge them into a single text file. Perfect for research, sentiment analysis, and social media data processing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages