Solve CAPTCHAs programmatically using the 2Captcha human-powered service.
Source and feedback: https://github.com/adinvadim/2captcha-cli
This skill sends CAPTCHA images, page URLs, sitekeys, challenge IDs, and task metadata to 2Captcha for processing by the 2Captcha service and its human solvers. Use it only for authorized automation, and do not submit sensitive, regulated, internal, or third-party user data unless you have approval.
# Install this agent skill with skills.sh
npx skills add adinvadim/2captcha-cli
# Or install with ClawHub/OpenClaw
openclaw skills install 2captcha
# Install the CLI after reviewing the source
git clone https://github.com/adinvadim/2captcha-cli.git
cd 2captcha-cli
python3 solve-captcha --version
mkdir -p ~/.local/bin
ln -sf "$PWD/solve-captcha" ~/.local/bin/solve-captcha
# Verify
solve-captcha --version
# Save your 2Captcha API key
mkdir -p ~/.config/2captcha
echo "YOUR_API_KEY" > ~/.config/2captcha/api-key
# Or use environment variable
export TWOCAPTCHA_API_KEY="your-key"
Get your API key at https://2captcha.com/enterpage
The CLI reads credentials only from the --api-key flag, TWOCAPTCHA_API_KEY, ~/.config/2captcha/api-key, or ~/.2captcha-api-key.
solve-captcha balance
# From file
solve-captcha image /path/to/captcha.png
# From URL
solve-captcha image "https://site.com/captcha.jpg"
# With options
solve-captcha image captcha.png --numeric 1 --math
solve-captcha image captcha.png --comment "Enter red letters only"
solve-captcha recaptcha2 --sitekey "6Le-wvk..." --url "https://example.com"
solve-captcha recaptcha3 --sitekey "KEY" --url "URL" --action "submit" --min-score 0.7
solve-captcha hcaptcha --sitekey "KEY" --url "URL"
solve-captcha turnstile --sitekey "0x4AAA..." --url "URL"
solve-captcha funcaptcha --public-key "KEY" --url "URL"
# v3
solve-captcha geetest --gt "GT" --challenge "CHALLENGE" --url "URL"
# v4
solve-captcha geetest4 --captcha-id "ID" --url "URL"
solve-captcha text "What color is the sky?" --lang en
Look for:
data-sitekey attribute in HTMLk= parameter in reCAPTCHA iframe URLgoogle.com/recaptcha/api2/anchorLook for:
data-sitekey in hCaptcha divhcaptcha.comLook for:
data-sitekey in Turnstile widgetcf-turnstile class elementsg-recaptcha-response or callback// After getting token from solve-captcha
document.getElementById('g-recaptcha-response').value = token;
// Or call callback if defined
___grecaptcha_cfg.clients[0].callback(token);
Common errors:
ERROR_ZERO_BALANCE - Top up accountERROR_NO_SLOT_AVAILABLE - Retry in few secondsERROR_CAPTCHA_UNSOLVABLE - Bad image or impossible captchaERROR_WRONG_CAPTCHA_ID - Invalid task ID共 2 个版本