Version 2.0.0 - Selenium-based browser automation for Snapchat Web
SnapBot uses Selenium to automate Snapchat Web, providing a programmatic way to interact with Snapchat through a real browser session.
Rather than trying to reverse-engineer Snapchat's private APIs, this tool automates the official Snapchat Web interface (web.snapchat.com) where official support exists.
- ✅ Official Support - Uses Snapchat's official web interface
- ✅ Reliable - No fragile API reverse-engineering
- ✅ Real Browser - Handles 2FA, reCAPTCHA, and other security features
- ✅ Sustainable - Works as long as Snapchat Web exists
- ✅ Self-Contained - Auto-downloads portable Chromium (no manual install needed)
pip install -r requirements.txtDependencies:
typer>=0.9.0- CLI frameworkrich>=13.0.0- Terminal formattingselenium>=4.0.0- Browser automationwebdriver-manager>=4.0.0- Automatic ChromeDriver management
Note: Chrome/Chromium is NOT required to be pre-installed! The script will automatically download a portable version (~150 MB one-time download) on first run.
python snapbot.py loginThis opens a Chrome browser where you log in manually. Once logged in, press Enter to verify the session.
python snapbot.py browserOpens Snapchat Web in a persistent browser window. Close the browser to exit.
python snapbot.py versionShows version and Selenium availability status.
Opens a browser and guides you through manual login.
python snapbot.py login # Interactive
python snapbot.py login -h # Show helpOptions:
-s, --save- Save username for future sessions-h, --headless- Run browser in headless mode (experimental)
Opens Snapchat Web in a browser window for manual interaction.
python snapbot.py browser
python snapbot.py browser -h # Headless modeView and modify bot settings.
python snapbot.py config --show # Display current settings
python snapbot.py config -h true # Enable headless mode
python snapbot.py config -d true # Enable debug modepython snapbot.py versionShows SnapBot version, Selenium status, and whether portable Chromium is installed.
python snapbot.py update-chromium # Update if installed
python snapbot.py update-chromium -f # Force re-downloadUpdates the portable Chromium to the latest stable version. This automatically:
- Fetches the latest Chrome from Google's official API (currently 143.x)
- Downloads matching ChromeDriver
- Replaces the old installation
Deletes credentials and configuration files.
python snapbot.py clear-cache- Browser initialization with ChromeDriver
- Manual login via Snapchat Web
- Session persistence
- Configuration management
- Credentials storage (secure)
- Automated message sending via XPath selectors
- Friend list extraction
- Status updates
- Snap capture and sending
- Story management
SnapBot stores configuration in snapchat_config.json:
{
"version": "2.0.0",
"headless": false,
"timeout": 30,
"debug": false
}Credentials are stored separately in snapchat_credentials.json with file permissions 0o600 (read/write by owner only).
Uses Chrome with the following optimizations:
- Disables automation detection flags
- Spoofs user agent as legitimate client
- Handles sandbox restrictions
- Automatic ChromeDriver installation via webdriver-manager
- Waits for user to complete manual login
- Verifies successful authentication by checking for UI elements
- Maintains persistent browser session for automation
- Credentials stored with
chmod 0o600(owner only) - No plain text passwords in logs
- Respects 2FA and security challenges
Error: "chromedriver not found"
pip install webdriver-manager # Auto-installs correct ChromeDriverError: "ImportError: No module named 'selenium'"
pip install selenium>=4.0.0 webdriver-manager>=4.0.0- Check if Chrome is installed (
google-chrome,chromium, orchrome.exe) - Disable headless mode (not fully tested)
- Run with debug:
python snapbot.py config -d true
If Snapchat requires 2FA:
- Complete it manually in the browser
- Press Enter when the verification is done
- Script will detect successful login
| Feature | REST API (v1) | Selenium (v2) |
|---|---|---|
| Public API Available | ❌ No | ✅ Yes (Web) |
| Official Support | ❌ No | ✅ Yes |
| 2FA/Security | ❌ No | ✅ Yes |
| Browser Control | ❌ No | ✅ Yes |
| Reliability | ❌ Very Low | ✅ High |
If Selenium doesn't work for your use case:
- Requires Snapchat Business Account
- Limited to marketing/advertising
- Official Docs
- Create custom AR lenses
- Limited to lens/filter features
- Lens Studio
- Similar to Selenium
- Smaller footprint
- Better debugging tools
MIT
This tool is for educational purposes and personal automation only. Use responsibly and in accordance with Snapchat's Terms of Service.