Tavily Key Generator - Rebuilt Edition
This is the fully rebuilt edition of the Tavily registration tool.
The old unstable script flow has been replaced with a single unified pipeline:
- Real local browser automation
- Local Turnstile solver
- Email API based verification-code retrieval
- Real Tavily API validation immediately after a key is extracted
The goal of this rebuild is simple: make the Tavily / Auth0 / Cloudflare registration flow usable, repeatable, concurrent, and suitable for unattended background execution.
Features
- Single launcher entry, no long command-line arguments required
- Automatically creates and reuses
venv - Automatically installs Python dependencies and browser dependencies
- Supports Cloudflare custom-domain mail API
- Supports DuckMail API
- Supports multiple domains with runtime selection
- Supports concurrent registration
- Runs the browser in headless mode by default
- Verifies each extracted API key with a real Tavily API call
- Optionally uploads verified keys to your own key pool server
- Startup scripts for Windows, macOS, and Linux
Screenshots
Launcher
Concurrent Registration and Real API Validation
Proxy Dashboard
Quick Start
1. Clone the repository
git clone https://github.com/skernelx/tavily-key-generator.git
cd tavily-key-generator
2. Configure the environment
cp .env.example .env
Edit .env and fill in your mail provider settings and optional upload settings.
3. Run the launcher
macOS / Linux:
python3 run.py
or:
./start_auto.sh
Windows:
start_auto.bat
What Happens on Startup
When you run the launcher, it will automatically:
- Create or reuse
venv - Upgrade
pip,setuptools, andwheel - Install packages from
requirements.txt - Download Camoufox if needed
- Install Playwright Chromium if needed
- Read
.env - Check the configured mail provider
- Let you choose a domain if multiple domains are configured
- Ask for the registration count
- Ask for the concurrency level
- Ask whether to upload keys automatically
- Start the local solver
- Handle email verification and password setup
- Recover from random password-page challenge failures
- Extract the API key
- Verify the API key with a real Tavily API call
- Save the result to
accounts.txt - Upload the verified key if upload is enabled
Runtime Flow
run.py
-> load .env
-> choose domain
-> input count / concurrency
-> choose upload or not
-> create mailbox
-> open Tavily signup page
-> solve Turnstile locally
-> receive email code
-> set password
-> recover random password-page challenge
-> enter Tavily dashboard
-> extract API key
-> verify API key with real API call
-> save / upload
Configuration
See .env.example for the full configuration template.
Cloudflare Mail API
EMAIL_PROVIDER=cloudflare
EMAIL_API_URL=https://your-mail-api.example.com
EMAIL_API_TOKEN=replace-with-your-token
EMAIL_DOMAIN=example.com
EMAIL_DOMAINS=example.com,example.org
Notes:
- Use
EMAIL_DOMAINfor a single domain - Use
EMAIL_DOMAINSfor multiple domains - The launcher will let you choose the active domain at runtime
DuckMail API
EMAIL_PROVIDER=duckmail
DUCKMAIL_API_URL=https://api.duckmail.sbs
DUCKMAIL_API_KEY=
DUCKMAIL_DOMAIN=
DUCKMAIL_DOMAINS=
Notes:
- You can configure either one domain or multiple domains
- If you have a private DuckMail domain and API key, just put them in
.env - Public DuckMail domains may work for mailbox creation and email retrieval, but may still be blocked by Tavily risk control
Upload to Your Own Server
SERVER_URL=https://your-server.example.com
SERVER_ADMIN_PASSWORD=replace-with-your-admin-password
DEFAULT_UPLOAD=true
Notes:
DEFAULT_UPLOAD=truemeans the launcher defaults to upload enabled- The actual upload decision still depends on the runtime choice you make when the launcher starts
Runtime Options
DEFAULT_COUNT=1
DEFAULT_CONCURRENCY=2
DEFAULT_DELAY=10
REGISTER_HEADLESS=true
EMAIL_CODE_TIMEOUT=90
API_KEY_TIMEOUT=20
EMAIL_POLL_INTERVAL=3
SOLVER_PORT=5073
SOLVER_THREADS=1
Notes:
REGISTER_HEADLESS=truekeeps the browser in the background- The actual solver thread count becomes
max(SOLVER_THREADS, selected concurrency) - In normal use, you do not need to pass extra command-line arguments
Output
Successful registrations are saved to:
accounts.txt
Format:
email,password,api_key
email,password,api_key
Real-World Validation
The current rebuilt flow has already been validated in real runs:
- Full registration works with the Cloudflare mail flow
- Email verification codes can be fetched automatically
- Extracted API keys are validated with real Tavily API requests
- Concurrent registration has been tested
- Random password-page challenge recovery has been added and verified in real runs
In the most recent regression runs, the password page twice reproduced the "submitted but did not redirect immediately" challenge case, and the new recovery logic successfully pulled the flow through both times.
Known Limitations
DuckMail Public Domains
The current status of public DuckMail domains is:
- Mailbox creation works
- 6-digit verification-code retrieval works
- Tavily may still block the flow on the password page
Common page message:
Suspicious activity detected
If you want reliable full registration, prefer:
- Cloudflare custom-domain mail
- DuckMail private domain + API key
First Run on a New Machine
On a new machine, it is better to run one account first before enabling concurrency.
The first run may need to download browser dependencies, and system/network/proxy conditions can differ across machines.
System-Level Prerequisites
The launcher can bootstrap project dependencies and browser dependencies automatically, but it does not install Python itself.
At minimum, the target machine should already have:
- Python 3
venvsupport- A usable network environment for installing dependencies
Project Structure
.
├── run.py # Recommended entry point
├── tavily_core.py # Unified registration entry, forwards to browser flow
├── tavily_browser_solver.py # Main browser registration logic
├── api_solver.py # Local Turnstile solver
├── mail_provider.py # Mail provider abstraction
├── config.py # .env / environment loading
├── start_auto.sh # macOS / Linux launcher
├── start_auto.bat # Windows launcher
├── proxy/ # Optional Tavily key-pool proxy service
├── README.md # Chinese README
└── README_EN.md # English README
Module Notes
Some files are not primary entry points, but they are still part of the working runtime:
-
tavily_core.pyA compatibility layer that forwards the unified entry to the browser-based registration flow. -
browser_configs.pyBrowser configuration helper forapi_solver.py. -
db_results.pyResult-storage helper forapi_solver.py. -
proxy/An optional standalone module for turning multiple Tavily keys into a pooled proxy service.
Runtime artifacts that should not be committed:
.envvenv/__pycache__/accounts.txtproxy/data/
Optional Proxy Service
If you want to pool registered keys behind a single endpoint, use proxy/.
Start it with:
cd proxy
docker compose up -d
See proxy/README.md for details.
Recommended Usage
If your goal is simply to batch-register and collect keys, the shortest path is:
- Configure
.env - Run
python3 run.py - Choose the mail domain
- Enter the registration count
- Enter the concurrency level
- Read the results from
accounts.txt
If you also need centralized distribution, enable server upload or connect the generated keys to proxy/.
Disclaimer
This project is provided for automation testing, research, and personal learning purposes only.
You are responsible for evaluating the target service's terms, risk controls, and account-usage implications.


