solve_captcha
Solve a captcha in token mode and receive a solution token for reCAPTCHA, Cloudflare, or Turnstile challenges, ready to submit via form POST or API call.
Instructions
Solve a captcha in token mode — no browser required.
CapSolver will create a task on its server, solve the captcha challenge, and return the solution token. Use this when you only need the token to submit to a target website (e.g. via form POST or API call).
Args: captcha_type: One of "reCaptchaV2", "reCaptchaV3", "cloudflare". website_url: The full URL of the page where the captcha appears. website_key: The site key / public key / data-sitekey of the captcha widget. version: reCAPTCHA version hint ("v2" or "v3"). Usually auto-detected. page_action: reCAPTCHA v3 action name (e.g. "login", "submit"). min_score: reCAPTCHA v3 minimum score threshold (0.0–1.0). invisible: Whether the reCAPTCHA widget uses invisible mode. enterprise: Whether to use the Enterprise API variant. s_token: Enterprise s_token for stoken-based verification. cdata: Cloudflare Turnstile custom data parameter. proxy: Proxy in "user:pass@host:port" or "host:port" format. user_agent: Custom User-Agent string to use during solving. timeout: Maximum seconds to wait for a solution (default: 120). polling_interval: Seconds between status polls (default: 5).
Returns: {"success": True, "solution": {...}} on success. {"success": False, "error": "...", "error_id": ..., "error_code": "...", "http_status": ...} on failure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cdata | No | ||
| proxy | No | ||
| s_token | No | ||
| timeout | No | ||
| version | No | ||
| invisible | No | ||
| min_score | No | ||
| enterprise | No | ||
| user_agent | No | ||
| page_action | No | ||
| website_key | Yes | ||
| website_url | Yes | ||
| captcha_type | Yes | ||
| polling_interval | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||