capsolver-python

raw JSON →
1.0.7 verified Mon Apr 27 auth: no python

Official Python SDK for Capsolver, a service for solving CAPTCHAs (ReCaptcha, hCaptcha, Geetest, etc.) automatically. Current version 1.0.7, requires Python >=3.6.8, maintained by Capsolver team.

pip install capsolver
error ImportError: cannot import name 'CapSolver' from 'capsolver'
cause Older version (<1.0.0) did not export CapSolver at top level.
fix
Upgrade capsolver: pip install -U capsolver
error capsolver.exceptions.CapSolverError: ERROR_KEY_DOES_NOT_EXIST
cause Invalid or missing API key.
fix
Verify your API key and set it via CAPSOLVER_API_KEY environment variable or pass it explicitly.
error capsolver.exceptions.CapSolverError: ERROR_TASK_NOT_SUPPORTED
cause Task type string is incorrect or not supported by your plan.
fix
Check Capsolver documentation for correct task type (e.g., ReCaptchaV2TaskProxyless).
gotcha API keys are required for all requests. The library does not validate the key until the first API call, so catch exceptions.
fix Always handle capsolver.exceptions.CapSolverError in your code.
deprecated The 'capsolver.capsolver' module is deprecated. Use the top-level 'capsolver' package directly.
fix Change 'from capsolver.capsolver import CapSolver' to 'from capsolver import CapSolver'.
gotcha Task names are case-sensitive and version-specific. Mistyping a task type (e.g., 'ReCaptchaV2Task' vs 'ReCaptchaV2TaskProxyless') will raise an API error.
fix Refer to Capsolver API docs for exact task type strings.
breaking In v1.0.0, the constructor changed from 'capsolver(api_key)' to 'CapSolver(api_key=api_key)', with keyword argument enforcement.
fix Use 'CapSolver(api_key=...)' with explicit keyword.

Instantiate CapSolver with your API key and solve a ReCaptcha v2 (proxyless).

from capsolver import CapSolver
import os

api_key = os.environ.get('CAPSOLVER_API_KEY', 'YOUR_API_KEY')
solver = CapSolver(api_key=api_key)

# Solve ReCaptcha v2
result = solver.solve(
    type="ReCaptchaV2TaskProxyless",
    websiteURL="https://example.com",
    websiteKey="6Lc..."
)
print(result)