A professional Instagram Direct Message automation system built with TypeScript, Node.js, and Playwright. This system can read leads from Google Sheets and automatically send personalized direct messages to them on Instagram.
- Instagram Authentication: Secure login with session management
- Browser Automation: Stealth browser automation with Playwright
- Message Personalization: Dynamic templates with variable substitution
- Rate Limiting: Ethical delays and human behavior simulation
- Google Sheets Integration: Read leads and track DM status
- Discord Notifications: Real-time monitoring and alerts
- Error Handling: Comprehensive logging and retry mechanisms
- Node.js 18+
- Instagram account credentials
- Google Sheets API (for full functionality)
- Discord webhook (for notifications)
-
Clone the repository
git clone git@github.com:outrunn/Instagram-DM-Automation.git cd Instagram-DM-Automation -
Install dependencies
npm install
-
Install Playwright browsers
npx playwright install chromium
-
Set up environment variables
cp env.example .env
Edit
.envwith your credentials:INSTAGRAM_USERNAME=your_instagram_username INSTAGRAM_PASSWORD=your_instagram_password DISCORD_WEBHOOK_URL=your_discord_webhook_url SHEET_ID=your_google_sheet_id
-
Share Google sheet with google service account
-
Add service account crediantials key which should be a .json file downloaded from Google cloud.
npm run devnpm run send-test your_alt_account_username "Hello! This is a test message."npm run statsConfigure personalized message templates with variables:
{username}- Instagram username{name}- Display name{profession}- Professional field{bio_highlight}- Bio highlight
Configure rate limiting and behavior:
- Daily message limits
- Delay between messages
- Time restrictions
- Human behavior simulation