unfriendr is a Python-based Instagram automation bot designed to help you unfollow accounts you no longer interact with. If your feed has become a cluttered mess from mindless following, this tool will help you curate it back to something meaningful.
I built this as a fun way to learn web automation and also to solve a personal problem—keeping my Instagram feed relevant and engaging.
- Automatically identifies accounts you follow but don’t engage with.
- Unfollows accounts in a safe, controlled manner (default: 25 per run, adjustable to 50 after a week).
- Allows exceptions for accounts you never want to unfollow.
- Uses Selenium and Firefox for web automation.
You need an archive of your following/followers list from Instagram:
- Visit the Instagram Accounts Center
- Request a download of your following & followers data
- Once you receive the archive, extract the
.html
files to the/data
directory in your cloned repo
git clone https://github.com/yourusername/unfriendr.git
cd unfriendr
Edit /config.py
to:
- Add your Instagram credentials (username & password)
- Define any exceptions (accounts you never want to unfollow)
- Adjust the unfollow limit if needed
Ensure you have Python installed, then install the required packages:
pip install selenium
You also need Firefox installed.
python unfriendr.py
- The first run will take longer as it builds a list of unfollowers.
- The script will start unfollowing accounts based on the configured settings.
- To stay within Instagram’s automation guidelines, the default unfollow limit is 25 per run. After a week, you can increase it to 50.
- Use this tool responsibly. Overuse of automation may lead to action blocks.
- Python - The core programming language
- Selenium - For browser automation
- Firefox - Used as the browser for execution
This project is for educational purposes only. Use at your own risk.
Happy cleaning! ✨