A minimal Python reCAPTCHA v3 solver: it finds the sitekey and action on the page and gets a high-score v3 token from the official CapMonster Cloud reCAPTCHA v3 solver Python SDK. No browser is required. Use it for forms and APIs you own or are allowed to automate that check reCAPTCHA v3 scores.
- Downloads the page with
requestsand extracts the sitekey fromapi.js?render=...orgrecaptcha.execute(...). - Reads the
actionname the page uses (for exampleloginorsubmit) and detects reCAPTCHA Enterprise. - Requests a token with
RecaptchaV3ProxylessRequest,minScoreandpageAction. - Prints the token and, if you pass
--post-url, sends it to your endpoint.
By default it runs on the public demo page lessons.zennolab.com.
- Python 3.9+
- A CapMonster Cloud API key (see Get an API key)
git clone https://github.com/CapMonsterCloud/python-requests-recaptcha-v3-solver.git
cd python-requests-recaptcha-v3-solver
pip install -r requirements.txt
export CAPMONSTER_API_KEY=your_key # Windows: set CAPMONSTER_API_KEY=your_key
python examples/solve_recaptcha_v3.py
python examples/solve_recaptcha_v3.py --url https://your-site.example/login --min-score 0.7 \
--post-url https://your-site.example/api/loginTests (offline):
pytest -q- v3 has no widget. There is nothing to click and usually no
data-sitekey.extract_v3_params()reads the key from therender=parameter ofapi.jsor from the first argument ofgrecaptcha.execute(). - The action must match. The site's backend compares the
actioninside the token with what it expects. The script takes the action from the page code and lets you override it with--actionwhen it is built dynamically. - Score is a request, not a guarantee.
minScore(0.1-0.9, clamped byclamp_score()) asks for a token with at least that score. Match the threshold the target site enforces (Google's default is 0.5); very high values such as 0.9 increase the number of failed attempts. - Enterprise switch. If the page loads
enterprise.jsor callsgrecaptcha.enterprise, the request is sent withisEnterprise=True.
- The token is sent to the site's backend (usually in a
g-recaptcha-responsefield or an API header); there is no widget to fill. - A v3 token is single-use and lives about 2 minutes. Request a new token for every submission and send it right away.
- The
actionand the page URL must match what the site expects, otherwise the backend rejects the token even if the score is high.
| Symptom | Cause and fix |
|---|---|
ValueError: reCAPTCHA v3 sitekey not found |
The script is loaded from a bundle. Search the JS files for execute( and pass the page that contains it, or read the key in DevTools. |
Backend returns action-mismatch or similar |
The action differs from the one in the token. Pass the exact value with --action. |
| Token works once, then the site asks again | v3 tokens are single-use and live about 2 minutes. Request a new token for every submission. |
| Low score reported by the site | Raise --min-score towards the site's threshold and keep the same User-Agent and cookies when submitting. If the solution contains a userAgent, use it when you submit the token. |
[ERROR_ZERO_BALANCE] / [ERROR_KEY_DOES_NOT_EXIST] |
Top up the balance or check the API key. |
This example needs a CapMonster Cloud account and API key. Register and get the key on the reCAPTCHA v3 solver page. There you will also find pricing and the API description. New users can ask support for a $0.10 test balance after registering.
Use this code only with websites you own or are explicitly permitted to automate. Follow their terms of service and applicable laws, and keep your API key secret.
- Python SDK: CapMonster Cloud Python SDK
- reCAPTCHA v3 solving with CapMonster Cloud: capmonster.cloud/en/recaptcha-v3
reCAPTCHA is a trademark of Google LLC. CapMonster Cloud is not affiliated with or endorsed by Google.