A powerful Flask-based web application for automating Instagram cold outreach campaigns with advanced follow-up sequences, Google Sheets integration, and comprehensive tracking capabilities.
- Multi-Message Campaigns: Create sophisticated follow-up sequences with multiple messages
- Smart Tracking: Monitor message delivery, read status, and replies
- Google Sheets Integration: Import contacts and sync tracking data with Google Sheets
- Variable Substitution: Personalize messages with dynamic variables from your contact data
- Rate Limiting: Built-in protection to maintain account health
- Campaign Management: Create, edit, duplicate, and manage multiple outreach campaigns
- Real-time Dashboard: Monitor campaign progress with live updates
- Google Drive Integration: Browse and select contact lists directly from Google Drive
- Tracking Status Columns: Automatically update Google Sheets with message statuses
- 2FA Support: Handle two-factor authentication for Instagram accounts
- Session Management: Persistent login sessions to avoid repeated authentication
- Pause/Resume: Control campaign execution without losing progress
- Bulk Operations: Process hundreds of contacts efficiently
- Python 3.7+
- Instagram account(s) for sending messages
- Google Cloud Service Account (for Google Sheets integration)
- Modern web browser
git clone https://github.com/yourusername/instagram-outreach.git
cd instagram-outreachpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCopy the example environment file and configure your credentials:
cp .env.example .envEdit .env with your settings:
# Instagram Credentials
INSTAGRAM_USERNAME=your_username
INSTAGRAM_PASSWORD=your_password
# Rate Limiting
DM_PER_HOUR=40
DM_PER_DAY=150
DELAY_BETWEEN_DMS=180 # seconds
# Dashboard
DASHBOARD_PORT=8000- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable Google Sheets API and Google Drive API
- Create a Service Account and download the credentials JSON
- Save the file as
google_credentials.jsonin the project root
Share your Google Sheets with the service account email (found in google_credentials.json)
python app.pyOpen http://localhost:8000 in your browser
Navigate to the main dashboard to:
- Upload CSV/Excel files with Instagram usernames
- Connect to Google Sheets
- Track message statuses (sent, seen, replied)
- Export tracking results
Go to the Outreach page to:
- Run single-message campaigns
- Execute multi-message follow-up sequences
- Monitor real-time progress
- Pause/resume campaigns
Access the Campaigns section to:
- Create new campaign templates
- Define follow-up sequences
- Set rate limits per campaign
- Use variables for personalization
Your contact files (CSV, Excel, or Google Sheets) must include:
- An "instagram" column with usernames or profile URLs
- Additional columns for personalization variables (optional)
Example CSV structure:
instagram,name,company,city
@john_doe,John,Acme Inc,New York
https://instagram.com/jane_smith,Jane,Tech Corp,San Francisco
- Navigate to Campaigns → New Campaign
- Set campaign name and description
- Add messages to your sequence
- Configure delays between messages
- Set rate limits
Include variables in your messages using double curly braces:
Hey {{name}}, I noticed you're based in {{city}}...
The system will automatically map these to your contact data columns.
GET /- Main dashboardGET /outreach- Outreach campaign pageGET /campaigns- Campaign managementPOST /track- Track message statusesPOST /start_outreach- Start campaignPOST /pause_outreach- Pause campaignPOST /resume_outreach- Resume campaignPOST /stop_outreach- Stop campaignGET /api/campaigns- List all campaignsPOST /api/campaigns- Create campaignPUT /api/campaigns/<id>- Update campaignDELETE /api/campaigns/<id>- Delete campaign
instagram-outreach/
├── app.py # Main Flask application
├── instagram_client.py # Instagram API wrapper
├── campaign_manager.py # Campaign CRUD operations
├── campaign_tracking.py # Tracking status management
├── variable_substitution.py # Variable replacement logic
├── google_drive_client.py # Google Drive/Sheets integration
├── templates/
│ ├── dashboard.html # Main tracking dashboard
│ ├── outreach.html # Outreach campaign UI
│ ├── campaigns.html # Campaign list view
│ └── campaign_editor.html # Campaign editor
├── static/ # CSS and JavaScript files
├── campaigns/ # Campaign JSON storage
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
└── README.md # This file
Instagram actively monitors for automated behavior. Follow these guidelines to protect your account from restrictions, action blocks, or permanent bans.
- Start with conservative limits (10-20 DMs per hour)
- Gradually increase based on account age and activity
- Use longer delays between messages for new accounts
- Warm up new accounts slowly over 2-3 weeks
- Mix automated outreach with manual activity
- Monitor for action blocks or restrictions
- Prevents Instagram from linking multiple accounts to the same IP
- Reduces risk of all accounts being banned simultaneously
- Masks your location and makes activity appear more natural
- Essential for running multiple accounts safely
1. Residential Proxies (STRONGLY RECOMMENDED)
- Use high-quality residential proxies from reputable providers
- Avoid datacenter proxies - Instagram detects and flags them
- Providers: Bright Data, Smartproxy, Soax, Proxy-Seller
2. One Account Per IP
- NEVER use the same IP for multiple Instagram accounts
- Each account should have a dedicated proxy/IP address
- Keep IP consistent per account (don't rotate IPs for same account)
3. Configuration
- Configure proxy in your Instagram client settings
- Test proxy connection before running campaigns
- Monitor proxy health and rotate if needed
- Use proxies from the same country as your account's registered location
- Browse feed for 5-10 minutes
- Like 10-20 posts manually
- Follow 5-10 accounts
- Comment on 2-3 posts
- View 5-10 stories
- Continue manual activity
- Gradually increase by 3-5 DMs every 2-3 days
- Never go from 0 to high volume instantly
If running large campaigns across multiple accounts:
1. Account Separation
- Use different proxies for each account
- Different email addresses
- Different phone numbers for verification
- Don't follow same accounts across profiles
2. Stagger Activity
- Don't run all accounts simultaneously
- Randomize start times
- Different daily volumes per account
1. Daily Checks
- Monitor for action blocks or warnings
- Check email for Instagram notifications
- Verify messages are being delivered
- Track reply rates (low rates may indicate shadow ban)
2. If You Get Action Blocked
- STOP all automation immediately
- Wait 24-48 hours before any activity
- Resume at 50% previous volume
- Increase manual activity
- Consider it a warning - adjust strategy
- Always personalize messages with recipient data (name, company, etc.)
- Avoid generic, spam-like content
- Keep messages conversational and authentic
- Test different message variations
For a 3-month-old account:
DM_PER_HOUR=15
DM_PER_DAY=50
DELAY_BETWEEN_DMS=180 # 3 minutesCan increase with time and experiment
Login Failed
- Verify Instagram credentials in
.env - Check for 2FA requirements
- Try deleting session files and re-authenticating
Google Sheets Not Loading
- Ensure
google_credentials.jsonis present - Verify the sheet is shared with service account
- Check API quotas in Google Cloud Console
Messages Not Sending
- Check rate limits haven't been exceeded
- Verify Instagram account isn't restricted
- Ensure target usernames are valid
Tracking Not Updating
- Confirm Google Sheets has write permissions
- Check for protected status values
- Verify column names match expected format
- Never commit credentials to version control
- Use environment variables for sensitive data
- Regularly rotate Instagram passwords
- Limit Google Service Account permissions
- Use HTTPS in production environments
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see LICENSE file for details.
This tool is for educational and legitimate business outreach purposes only. Users are responsible for:
- Complying with Instagram's Terms of Service
- Respecting privacy and anti-spam regulations
- Using the tool ethically and responsibly
Misuse may result in account restrictions or legal consequences.
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing documentation
- Review closed issues for solutions
- Built with Flask, Instagrapi, and Google APIs
- Inspired by ethical outreach automation needs
- Community contributions and feedback