Skip to main content

SurSolver for Python — captcha solver API client

Solve reCAPTCHA v3, Cloudflare Turnstile, Cloudflare Challenge, GeeTest, DataDome, AWS WAF, Akamai, Kasada and image captchas from Python with the official SurSolver client. One call submits the captcha and returns the token or cookie. Works with plain Python and asyncio.

pip install sursolver

Quick start

from sursolver import SurSolver, TaskType

API_KEY = "YOUR_API_KEY"
USER_AGENT = (
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
    "(KHTML, like Gecko) Chrome/155.0.0.0 Safari/537.36"
)

client = SurSolver(API_KEY)

result = client.solve({
    "type": TaskType.TurnstileTokenProxyLess,
    "websiteURL": "https://example.com/login",
    "websiteKey": "0x4AAAAAAA...",
    "userAgent": USER_AGENT,
})
print(result.solution["token"])

Send the same userAgent with the request that uses the result. Tokens and cookies are single-use, so use them right away. The examples below reuse client and USER_AGENT.

Examples

Solve reCAPTCHA v3 in Python

result = client.solve({
    "type": TaskType.ReCaptchaV3TokenProxyLess,
    "websiteURL": "https://example.com/login",
    "websiteKey": "6Le-wvkS...",
    "pageAction": "login",
    "userAgent": USER_AGENT,
})
print(result.solution["gRecaptchaResponse"])

For reCAPTCHA v3 Enterprise use TaskType.ReCaptchaV3EnterpriseTokenProxyLess.

Solve Cloudflare Turnstile

result = client.solve({
    "type": TaskType.TurnstileTokenProxyLess,
    "websiteURL": "https://example.com/signup",
    "websiteKey": "0x4AAAAAAA...",
    "userAgent": USER_AGENT,
})
# Submit result.solution["token"] as the cf-turnstile-response form field.

Bypass the Cloudflare Challenge page (cf_clearance)

result = client.solve({
    "type": TaskType.CloudflareChallengeCookie,
    "websiteURL": "https://example.com/protected",
    "proxy": "http://user:password@203.0.113.10:8000",
    "userAgent": USER_AGENT,
})
print(result.solution["cf_clearance"])

Replay the cookie through the same proxy and with the same userAgent.

Solve GeeTest v4

result = client.solve({
    "type": TaskType.GeeTestTokenProxyLess,
    "websiteURL": "https://example.com/login",
    "captchaId": "e392e1d7fd421dc63325744d5a2b9c73",
    "userAgent": USER_AGENT,
})
print(result.solution["lot_number"], result.solution["pass_token"])

GeeTest v3: send gt and a fresh challenge instead of captchaId.

Solve the DataDome slider

result = client.solve({
    "type": TaskType.DataDomeSliderCookie,
    "websiteURL": "https://example.com/",
    "captchaUrl": "https://geo.captcha-delivery.com/captcha/?initialCid=...",
    "proxy": "http://user:password@203.0.113.10:8000",
    "userAgent": USER_AGENT,
})
print(result.solution["datadome"])

Get an AWS WAF token (silent challenge)

result = client.solve({
    "type": TaskType.AwsChallengeCookie,
    "websiteURL": "https://example.com/",
    "scriptUrl": "https://example.token.awswaf.com/example/challenge.js",
    "userAgent": USER_AGENT,
})
print(result.solution["aws-waf-token"])

The visual AWS WAF CAPTCHA is TaskType.AwsCaptchaCookie and needs your proxy.

Solve an image captcha (image to text)

import base64
from pathlib import Path

result = client.solve({
    "type": TaskType.ImageToTextTask,
    "module": "1",
    "body": base64.b64encode(Path("captcha.png").read_bytes()).decode(),
})
print(result.solution["answer"])

asyncio

import asyncio
from sursolver import AsyncSurSolver, TaskType

async def main() -> None:
    async with AsyncSurSolver(API_KEY) as client:
        result = await client.solve({
            "type": TaskType.TurnstileTokenProxyLess,
            "websiteURL": "https://example.com/login",
            "websiteKey": "0x4AAAAAAA...",
            "userAgent": USER_AGENT,
        })
        print(result.solution["token"])

asyncio.run(main())

Supported captchas

Captcha task.type Guide
reCAPTCHA v3 ReCaptchaV3TokenProxyLess recaptcha-v3
reCAPTCHA v3 Enterprise ReCaptchaV3EnterpriseTokenProxyLess recaptcha-v3-enterprise
Cloudflare Turnstile TurnstileTokenProxyLess turnstile
Cloudflare Challenge CloudflareChallengeCookie cloudflare-challenge
GeeTest v3 / v4 GeeTestTokenProxyLess geetest
DataDome DataDomeSliderCookie datadome
AWS WAF Challenge AwsChallengeCookie aws-challenge
AWS WAF CAPTCHA AwsCaptchaCookie aws-captcha
Akamai (_abck) AkamaiCookieProxyLess akamai
Akamai SBSD AkamaiSbsdCookie akamai-sbsd
Akamai BMP (Android) AkamaiBmpTask akamai-bmp
Kasada KasadaTokenProxyLess kasada
Shape ShapeCookieProxyLess shape
Imperva (reese84 / utmvc) ImpervaCookie, ImpervaUtmvcCookie imperva
Vercel Security Checkpoint VercelCookie vercel
FriendlyCaptcha FriendlyCaptchaTokenProxyLess friendlycaptcha
MTCaptcha MtCaptchaTokenProxyLess mtcaptcha
Prosopo ProsopoTokenProxyLess prosopo
CaptchaFox CaptchaFoxToken captchafox
Altcha AltchaTokenProxyLess altcha
Lemin LeminTokenProxyLess lemin
Castle (Android) CastleAndroidToken castle-android
Image to Text ImageToTextTask image-to-text

Each guide lists the fields to send and where to find them on the page. The live list is client.list_task_types(); prices are client.list_services().

Errors

from sursolver import NoSlotAvailableError, TaskFailedError

try:
    result = client.solve(task)
except NoSlotAvailableError:
    ...  # all your threads are busy: try again in a moment
except TaskFailedError:
    ...  # this captcha could not be solved; its charge is refunded

Other errors: AuthenticationError (wrong API key), InvalidTaskError (a field is missing or wrong), InsufficientBalanceError (top up), SolveTimeoutError (no result in time).

License

MIT

Metadata

Release files for sursolver 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sursolver 0.1.0
File Size Uploaded Provenance Actions
sursolver-0.1.0.tar.gz 14.5 kB Without provenance Details for sursolver-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sursolver 0.1.0
File Interpreter ABI Platform Actions
sursolver-0.1.0-py3-none-any.whl Python 3 none any Details for sursolver-0.1.0-py3-none-any.whl

Total release size: 33.5 kB

Release files / sursolver-0.1.0.tar.gz

Download URL sursolver-0.1.0.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ea1f8634fb1a8b37fa9b7e3504bd0f6a7f603ee17ec3c05799c45000b6847802
BLAKE2b-256 checksum
How to use checksums
4db79a56b19d76a57ce6b5dd2b4822e731e6ee987b233a044e229f21e4b51759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Release files / sursolver-0.1.0-py3-none-any.whl

Download URL sursolver-0.1.0-py3-none-any.whl
Size 19.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f0fa7a4825618572a62fd616b53660e09e585e33af0882f691393852604f403
BLAKE2b-256 checksum
How to use checksums
2e08377b942cb44bfc3eeef764761d2b596ff6570ca1a95231417be0fa26df40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.2

Security for sursolver 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page