The Open-Source Alternative for Instagram to WhatsApp Automation
Automatically forward Instagram posts, stories, and reels to WhatsApp, Telegram, and more
Why InstaBridge? Free, open-source, personal use focused - unlike $50-500/month commercial tools designed for businesses
This project uses UNOFFICIAL APIs that violate Instagram and WhatsApp Terms of Service.
| Risk | Impact |
|---|---|
| π« Account Bans | Possible permanent loss of accounts (risk varies by use case) |
| βΈοΈ Rate Limits | Temporary restrictions on API access |
| π Account Locks | Verification challenges and login issues |
| βοΈ Legal Risk | Potential ToS violation consequences |
Risk by use case: For the intended use (downloading your own stories/content, ~once per day, no social manipulation), risk is lower: instagrapi is LOWβMEDIUM; Playwright is VERY LOW when used with a normal browser profile. See Risk by use case.
π‘οΈ Safety recommendations:
- β Prefer throwaway/test accounts; primary accounts are an informed choice
- β This is for learning and personal automation
- β Not for commercial or production use
- β Do not use for growth automation, spam, or scraping others
InstaBridge is a free, open-source personal automation tool that:
- πΈ Monitors your Instagram for new posts and stories
- π€ Automatically downloads media content
- π¬ Forwards content to specified WhatsApp contacts
- ποΈ Filters content by type (posts, stories, close friends)
- π Provides insights (who doesn't follow back, unfollow tracking)
- β° Runs on a schedule or on-demand
- Content Creators: Share Instagram posts with a WhatsApp community group
- Personal Sharing: Auto-forward stories to family members
- Backup: Keep a local copy of your Instagram content
- Analytics: Track follower/following relationships
- Learning: Understand browser automation and unofficial APIs
βββββββββββββββββββ
β Instagram β
β (instagrapi) ββββ
βββββββββββββββββββ β
β ββββββββββββββββββββ
ββββ InstaBridge β
β β Core Engine β
βββββββββββββββββββ β β - State Mgmt β
β WhatsApp Web β β β - Scheduling β
β (Playwright) ββββ€ β - Multi-platformβ
βββββββββββββββββββ β β - Deduplication β
β ββββββββββββββββββββ
βββββββββββββββββββ β β
β Telegram ββββ ββββββββββ΄ββββββββββ
β (Coming Soon) β β β
βββββββββββββββββββ βββββΌβββββ βββββββΌββββββ
β Web UI β β Analytics β
β (Flask)β β Engine β
ββββββββββ βββββββββββββ
Extensible Design: Ready for Telegram, Discord, and more platforms
See ARCHITECTURE.md for detailed design decisions.
| Feature | Commercial Tools | InstaBridge |
|---|---|---|
| Cost | $50-500/month | Free Forever |
| Target | Business/Marketing | Personal Use |
| Open Source | β Closed | β Open |
| Learning | β Black box | β Educational |
| Extensibility | β Locked | β Add platforms |
| Privacy | β Self-hosted |
- β Instagram post/story monitoring
- β Multi-recipient support with per-recipient filtering
- β Smart deduplication (never send duplicates)
- β Close friends story detection
- β Carousel/album support
- β Custom message prefixes
- β Daily scheduled runs (customizable time & timezone)
- β Weekly unfollow notifications
- β One-time scheduled runs
- β Settings auto-reload without restart
- β "Not following back" analysis with filtering
- β Unfollow detection and alerts
- β Follower statistics and trends
- β Warm cache system for performance
- β Web UI for configuration (localhost:5000)
- β Per-recipient content preferences
- β JSON-based settings (easy to edit)
- β Session persistence (scan QR once)
| Platform | Status | Notes |
|---|---|---|
| macOS | β Fully Supported | Native file picker via AppleScript |
| Linux | β Supported | Tested on Ubuntu 22.04+ |
| Windows | DOM file input (no native picker) |
Minimum Requirements:
- Python 3.13+
- 2GB RAM
- 500MB disk space
- Internet connection
Tested Configurations:
- macOS 13+ (Ventura, Sonoma)
- Ubuntu 22.04+ / Debian 12+
- Windows 10/11 (WSL2 recommended)
- Python 3.13+
- Instagram account (test/throwaway recommended)
- WhatsApp account
# Clone the repository
git clone https://github.com/barisegesevgili/InstaBridge.git
cd InstaBridge
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install Playwright browsers
python -m playwright install chromium
# Create configuration
cp .env.example .env
# Edit .env with your credentialsπ RECOMMENDED: Secure Credential Storage (v1.0.2+)
InstaBridge now supports system keychain for secure password storage:
# Install keyring for secure storage
pip install keyring
# Run interactive setup wizard
python -m src.credentials
# Passwords stored encrypted in:
# - macOS: Keychain Access
# - Linux: libsecret/gnome-keyring
# - Windows: Credential ManagerBenefits:
- β Passwords encrypted by OS (never in plain text)
- β
No
.envfile with passwords - β Protected by system authentication
- β Set once, use forever
Alternative: Manual .env setup (less secure)
If you prefer not to use keychain, edit .env:
# Instagram credentials (use throwaway account!)
IG_USERNAME=your_test_account
IG_PASSWORD=your_secure_password
# WhatsApp content recipient
WA_CONTENT_CONTACT_NAME=Friend Name
WA_CONTENT_PHONE=491701234567 # International format, digits only
# WhatsApp report recipient (for unfollow alerts)
WA_REPORT_CONTACT_NAME=Notes # Your own "Notes" chat
WA_REPORT_PHONE=
# Optional: Custom message prefix
MESSAGE_PREFIX=New from Instagram:π See Keychain Setup Guide for detailed instructions
π‘ Pro Tip: Use WA_CONTENT_PHONE (international format) instead of contact name for 10x more reliability.
# Run once (you'll scan QR code for WhatsApp Web)
python -m src.main
# Expected output:
# β Instagram login OK
# β WhatsApp Web ready (scan QR if first time)
# β Found 1 new post
# β Sent to Friend Name# Dry run (simulate without sending)
python -m src.main --dry-run
# One-time run
python -m src.main
```bash
# One-time run
python -m src.main
# Resend last batch (testing)
python -m src.main --resend-last
# Force resend (ignore deduplication)
python -m src.main --force
# Limit files for testing
python -m src.main --resend-last --max-files 2# Daily at 19:00 Berlin time (keeps running)
python -m src.scheduler
# Weekly unfollow checker (Sunday 22:00 Berlin)
python -m src.unfollow_scheduler
# Different weekday
python -m src.unfollow_scheduler --weekday monday
# One-time scheduled run
python -m src.run_at --time 14:50 --tz Europe/Berlin# Start web interface
python -m src.webapp
# Open browser to http://127.0.0.1:5000Features:
- ποΈ Settings management (recipients, schedule)
- π "Not following back" reports with filters
- π Warm cache for performance
- π Next run preview
# List accounts not following you back
python -m src.unfollow
# Check for new unfollows (sends WhatsApp alert)
python -m src.unfollow --check-unfollows --notifyCreate settings.json to manage multiple recipients:
{
"schedule": {
"enabled": true,
"tz": "Europe/Berlin",
"time_hhmm": "19:00"
},
"recipients": [
{
"id": "friend1",
"display_name": "Best Friend",
"wa_phone": "491701234567",
"enabled": true,
"send_posts": true,
"send_stories": true,
"send_close_friends_stories": false
},
{
"id": "family",
"display_name": "Family Group",
"wa_contact_name": "Family Chat",
"enabled": true,
"send_posts": true,
"send_stories": false,
"send_close_friends_stories": false
}
]
}Or use the Web UI at http://127.0.0.1:5000/settings to manage visually.
ig_session.json- Instagram session (auto-managed)wa_profile/- WhatsApp Web profile (persistent login)state.json- Deduplication statefollow_cache.json- Follower/following cacheuser_cache.json- User stats cache
v1.0.1+ includes comprehensive rate limiting to minimize ban risk:
- Automatic delays: 2-5 seconds + random jitter between all Instagram requests
- Hourly limits: Max 60 requests per hour (configurable)
- Human-like timing: Random variations to avoid detection patterns
- Download throttling: 0.5-1.5s delays between file downloads
- Analytics delays: 0.7-1.0s between user stats requests
Three safety levels:
CONSERVATIVE: 3-7s delays, 40 req/hour (safest for new accounts)MODERATE: 2-5s delays, 60 req/hour (default, balanced)AGGRESSIVE: 1-3s delays, 80 req/hour (higher risk, testing only)
π See Safe Usage Guide for detailed recommendations.
macOS:
- β Native file picker automation via AppleScript
β οΈ Requires Accessibility permissions: System Settings > Privacy & Security > Accessibility > Terminal/iTerm- β Best performance and reliability
Linux:
- β DOM-based file picker (fully functional)
- β No special permissions required
β οΈ Ensure Chromium dependencies:sudo apt install -y libglib2.0-0 libnss3 libx11-6- β Tested on Ubuntu 22.04+, Debian 12+
Windows:
- β DOM-based file picker (functional)
β οΈ WSL2 recommended for best experienceβ οΈ Native Windows: May needplaywright install chromium --with-depsβ οΈ Path separators: Use forward slashes or escape backslashes
"Login failed" or "Challenge required"
- Complete Instagram verification in the mobile app
- Delete
ig_session.jsonand try again - Wait 15-30 minutes between attempts
"Rate limited" errors
- Stop all automation for 1-2 hours
- Reduce request frequency
- Use a less active Instagram account
QR code not appearing
- Delete
wa_profile/folder - Restart the script
- Check Playwright browser window
Wrong contact opened
- Use phone number instead of name (
WA_CONTENT_PHONE) - Ensure international format (e.g., 491701234567)
Upload fails / wrong input selected
- Known issue: WhatsApp Web DOM changes frequently
- Try closing and reopening the script
- Check logs for specific errors
See TROUBLESHOOTING.md for more solutions.
# Install dev dependencies
pip install pytest pytest-cov
# Run all tests
pytest
# Run with coverage
pytest --cov=src --cov-report=html
# Run specific test file
pytest tests/test_ig.py -v# Format code
black src/ tests/
# Type checking
mypy src/
# Linting
ruff check src/InstaToWhatsapp/
βββ src/ # Source code
β βββ ig.py # Instagram client
β βββ wa.py # WhatsApp automation
β βββ main.py # Core orchestration
β βββ settings.py # Configuration management
β βββ state.py # State persistence
β βββ insights.py # Analytics engine
β βββ scheduler.py # Daily scheduler
β βββ unfollow.py # Unfollow tracking
β βββ webapp.py # Web UI
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ .env.example # Configuration template
βββ requirements.txt # Python dependencies
βββ README.md # This file
- WhatsApp automation
- Multi-recipient support
- Analytics & insights
- Telegram support
- Discord webhooks
- Docker deployment
- Enhanced UI
- Multi-platform dashboard
- Plugin architecture
- Cloud deployment options
See ROADMAP.md for details.
We welcome contributions! InstaBridge is ideal for learning:
- Browser automation (Playwright)
- Unofficial API usage (instagrapi)
- State management patterns
- Flask web apps
- Scheduling systems
Ways to contribute:
- π Report bugs via Issues
- π‘ Suggest features (Telegram, Discord, etc.)
- π Improve documentation
- π§ͺ Add tests
- π§ Fix bugs or add features
- π Add new platform integrations
See CONTRIBUTING.md for guidelines.
| Document | Description |
|---|---|
| KEYCHAIN_SETUP.md | π Secure password storage (RECOMMENDED) |
| RISK_BY_USE_CASE.md | π Risk by use case (instagrapi vs Playwright, intended use) |
| SAFE_USAGE_GUIDE.md | |
| SECURITY_BEST_PRACTICES.md | Security guidelines & credential safety |
| ARCHITECTURE.md | Design decisions & system overview |
| SETUP.md | Detailed setup guide |
| TROUBLESHOOTING.md | Common issues & solutions |
| ROADMAP.md | Future plans & wishlist |
| CHANGELOG.md | Version history |
- Multi-recipient support
- Per-recipient filtering
- Web UI for configuration
- Unfollow detection
- Comprehensive documentation
- Docker support
- Windows compatibility testing
- Enhanced error recovery
- Performance optimizations
- Plugin architecture
- Discord/Telegram support
- Cloud deployment guides
- Official API support (business accounts)
See ROADMAP.md for details.
- Code Quality: Clean, typed Python
- Test Coverage: (Coming soon)
- Documentation: Comprehensive guides
- Community: Open to contributions
InstaBridge is the open-source alternative to:
- Zapier Instagram+WhatsApp integrations ($20-100/month)
- Interakt (CRM tool for businesses)
- Bardeen.ai (paid automation)
- Mark360.ai (enterprise solution)
Built for personal use, learning, and the open-source community.
Technology Stack:
- instagrapi - Instagram API
- Playwright - Browser automation
- Flask - Web interface
Inspired By:
- SuperClaude Framework - Project structure
MIT License with important disclaimers - see LICENSE for details.
Remember: This is an educational project. Use responsibly and at your own risk.
- π Bug Reports: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Documentation: docs/
- π Show Support: Star the repo if you find it useful!
π InstaBridge - Bridge Your Social Media Platforms
Free Forever β’ Open Source β’ Extensible β’ Privacy-First
β Star this repo | π Report Bug | π‘ Request Platform
Made with β€οΈ for the open-source community