Clean your Instagram followers in one pass.
Detect bots, mass-followers, and ghost accounts. Remove them automatically.
No API keys. No paid services. No manual scrolling for hours.
You have 8,000 followers. Maybe 300 are bots, mass-followers, or empty accounts with 5,000 following and 3 followers. Instagram doesn't give you a "remove bots" button. You can:
- Remove manually β 8 hours of clicking, scrolling, crying
- Pay $50/month for some sketchy SaaS that wants your password
- Use InstaPurge β Free, open-source, runs on your machine, done in 45 minutes
- Logs in to your Instagram via browser automation (Playwright)
- Fetches your full follower list using network interception β it catches the JSON that Instagram's own web app loads
- Scans every follower with 50 concurrent API requests β checks follower/following ratios, post counts, privacy status, profile pictures
- Removes bots in one pass through your followers dialog β finds them, clicks Remove, confirms, moves on
- Saves progress β if Instagram rate-limits you, resume tomorrow without re-scanning or re-removing
- β‘ Fast β 8,000 followers scanned in ~10 minutes, removed in ~30 minutes
- π Secure β Runs entirely on your machine, zero data sent to third parties
- π§ Smart detection β Flags accounts with high following + low followers, no posts, no profile pic, suspicious usernames
- π Resumable β Rate-limited? Save progress and continue later from where you stopped
- π₯οΈ Clean UI β Rich terminal interface with progress bars, tables, and a settings menu
- π« Rate-limit aware β Detects Instagram action blocks and pauses gracefully
- π Free & open source β No paywalls, no subscriptions, no account access sold to advertisers
git clone https://github.com/Saqlvation/instapurge.git
cd instapurge
pip install -r requirements.txt
playwright install chromiumWindows users: Run the commands in PowerShell or CMD. If
playwrightisn't found after pip install, usepython -m playwright install chromium.
Copy the example config and fill in your Instagram credentials:
# Edit config.json with your credentialspython instapurge.pyYou'll see a menu:
ββββββββββββ Menu ββββββββββββ
β β
β 1. Dry Run (scan only) β
β 2. Live Run (scan + removeβ
β 3. Settings β
β 4. Clear Cache & Session β
β 5. Exit β
β β
ββββββββββββββββββββββββββββββ
Always start with Dry Run (Option 1) to preview what would be removed.
| Phase | What Happens | Time |
|---|---|---|
| Login | Playwright opens Chrome, logs you in, steals session cookies | ~10s |
| Fetch | Opens your followers dialog, intercepts Instagram's API responses as you scroll | 5β10 min |
| Scan | Fires 50 concurrent httpx requests to Instagram's web_profile_info endpoint for stats |
~5 min |
| Remove | One pass through the followers dialog β removes flagged accounts as they appear | 20β40 min |
Total for 8,000 followers: ~45 minutes.
Edit config.json:
{
"username": "your_username",
"password": "your_password",
"following_threshold": 500,
"min_follower_ratio": 0.1,
"headless": false,
"dry_run": true,
"max_removals_per_session": 50,
"delay_min": 3.0,
"delay_max": 6.0
}| Setting | Description | Default |
|---|---|---|
username / password |
Your Instagram login | (required) |
following_threshold |
Flag accounts following more than this number | 500 |
min_follower_ratio |
Flag if followers / following is below this |
0.1 |
max_removals_per_session |
Stop after removing this many (prevents rate limits) | 50 |
delay_min / delay_max |
Random delay between removals, in seconds | 3.0 / 6.0 |
headless |
Run browser without visible window | false |
dry_run |
Preview mode β scan but don't remove | true |
Tip: If you have 8000+ followers and 200+ bots, start with max_removals_per_session: 30 and delay: 4-7s. Run once per day until clean.
An account is flagged when it hits 2 or more of these:
- π΄ Following > threshold (default 500) β mass-follower behavior
- π΄ Follower ratio < 0.1 β follows 1000 people, followed by 50
- π΄ No profile picture β default silhouette
- π΄ Private + 0 posts β dead or bot account
- π΄ Suspicious username β random strings, excessive numbers
Add your own screenshots here β terminal menu, scan progress, flagged results table.
ββ Flagged Accounts (47 total) ββ
β Username β Following β Followers β Reason β
βββββββββββββββΌββββββββββββΌββββββββββββΌββββββββββββββββββββββββ€
β @bot_123456 β 5421 β 3 β following>500, ratio β
β @spam_acc β 3200 β 12 β following>500, ratio β
β @fake_user β 890 β 0 β following>500, 0-foll β
βββββββββββββββ΄ββββββββββββ΄ββββββββββββ΄ββββββββββββββββββββββββ
Instagram limits bulk actions to prevent spam. If you remove too many too fast, you'll see:
"Action Blocked. Please try again later."
InstaPurge handles this automatically:
- Detects the block and stops immediately
- Saves which accounts were already removed to
progress.json - Tells you to wait 24 hours
- On next run, skips already-removed accounts
To avoid rate limits:
- Keep
max_removals_per_sessionat 30β50 - Keep
delay_min/delay_maxat 3β7 seconds - Don't run multiple Instagram automations at the same time
- Don't log in and out repeatedly
| Problem | Solution |
|---|---|
ModuleNotFoundError: No module named 'playwright' |
Run pip install -r requirements.txt then playwright install chromium |
| Login fails / stuck on login page | Check error_debug.png in the folder. Instagram may require 2FA or a security check. Complete it manually in the browser window, then the script continues. |
| Only finds a few followers | Delete followers_cache.json and re-run. Instagram sometimes serves partial lists. |
| "Rate limited" / "Action Blocked" | Wait 24 hours. Your progress is saved in progress.json. |
| Browser window doesn't open | Run playwright install chromium. If on Linux, you may need xvfb. |
division by zero error |
Fixed in latest version β pull the latest code. |
| Removal says "not found in list" | The user may have already unfollowed you, or the dialog hasn't scrolled far enough. The script retries automatically. |
| InstaPurge | Paid SaaS (e.g. HypeAuditor) | Manual Removal | |
|---|---|---|---|
| Cost | Free | $30β100/mo | Free |
| Privacy | Your machine only | Their servers | Your machine |
| Speed (8K followers) | ~45 min | ~30 min | 8+ hours |
| Open source | β | β | N/A |
| Rate limit handling | β Auto-save & resume | β Often ignored | N/A |
| No password sharing | β | β | β |
| Works offline | β (after login) | β | β |
instapurge/
βββ instapurge.py # Main script
βββ config.example.json # Example configuration
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ LICENSE # MIT License
βββ .gitignore # Ignores config.json, caches, reports
βββ session.json # Auto-generated: login session
βββ followers_cache.json # Auto-generated: your follower list
βββ progress.json # Auto-generated: removal progress
βββ report_*.json # Auto-generated: scan reports
PRs welcome. Especially:
- Better bot detection heuristics
- GUI version (Tkinter / Electron)
- Support for Threads, TikTok, Twitter
- Multi-account support
- Docker container
- Fork the repo
- Create a branch:
git checkout -b feature/amazing-thing - Commit:
git commit -m 'Add amazing thing' - Push:
git push origin feature/amazing-thing - Open a Pull Request
This tool is for cleaning your own Instagram account. Use it responsibly. Instagram's Terms of Service prohibit automated actions β while this tool mimics human behavior with delays and randomization, there is always a risk of temporary action blocks. The authors are not responsible for any account restrictions.
Do not use this to harass, spam, or target other users.
MIT Β© Saqlvation β see LICENSE for details.
If InstaPurge saved you hours of clicking, give it a β and tell a friend.