Skip to main content

CaptchaSolv Python SDK

Official Python library for CaptchaSolv.com - Fast and reliable captcha solving API.

PyPI version Python License: MIT

Supported Captcha Types

  • ReCaptcha V3
  • Cloudflare Turnstile
  • GeeTest V4
  • Akamai Bot Manager
  • Kasada
  • DataDome
  • AWS WAF

Installation

pip install captchasolv

For async support:

pip install captchasolv[async]

Quick Start

from captchasolv import CaptchaSolv

solver = CaptchaSolv("YOUR_API_KEY")

result = solver.turnstile(
    website_url="https://example.com",
    website_key="0x4AAAAAAABS7vwvV6VFfMcD"
)

print(result.solution.token)

Async Usage

import asyncio
from captchasolv import AsyncCaptchaSolv

async def main():
    async with AsyncCaptchaSolv("YOUR_API_KEY") as solver:
        result = await solver.turnstile(
            website_url="https://example.com",
            website_key="0x4AAAAAAABS7vwvV6VFfMcD"
        )
        print(result.solution.token)

asyncio.run(main())

Examples

ReCaptcha V3

result = solver.recaptcha_v3(
    website_url="https://example.com",
    website_key="6Le-wvkSAAAAAPBMRTvw0Q4Muexq1bi0DJwx_mJ-",
    page_action="login"
)

Cloudflare Turnstile

result = solver.turnstile(
    website_url="https://example.com",
    website_key="0x4AAAAAAABS7vwvV6VFfMcD"
)

Akamai

result = solver.akamai(
    website_url="https://example.com",
    akamai_script="https://example.com/path/to/akamai/script.js",  # or use website_key
    data={
        "_abck": "current_abck_cookie_value",
        "bm_sz": "current_bm_sz_cookie_value"
    }
)
print(result.solution.token)       # Cookie string: "_abck=...; bm_sz=..."
print(result.solution.user_agent)  # User-Agent to use in requests

Kasada

result = solver.kasada(
    website_url="https://example.com",
    pjs="https://example.com/149e9513-01fa-4fb0-aad4-566afd725d1b/2d206a39-8ed7-437e-a3be-862e0f06eea3/p.js",
    v="optional_version"  # optional
)

# Returns dict with Kasada headers (x-kpsdk-cd, x-kpsdk-ct, x-kpsdk-st, etc.)
print(result.solution.headers)  # {'x-kpsdk-cd': '...', 'x-kpsdk-ct': '...', ...}
print(result.solution.user_agent)

# Use headers in your request
headers = {"User-Agent": result.solution.user_agent}
headers.update(result.solution.headers)

DataDome

result = solver.datadome(
    website_url="https://example.com",
    captcha_url="https://geo.captcha-delivery.com/captcha/?..."
)
print(result.solution.cookies)

AWS WAF

result = solver.aws_waf(
    website_url="https://example.com",
    aws_key="AQIDAHjcYu/GjX+QlghicBg..."
)

GeeTest V4

result = solver.geetest_v4(
    website_url="https://example.com",
    website_key="647f5ed2ed8acb4be36784e01556bb71"
)

Using Proxies

All convenience methods support an optional proxy parameter:

# Turnstile with proxy
result = solver.turnstile(
    website_url="https://example.com",
    website_key="0x4AAAAAAABS7vwvV6VFfMcD",
    proxy="http://user:pass@proxy.example.com:8080"
)

# Akamai with proxy
result = solver.akamai(
    website_url="https://example.com",
    akamai_script="https://example.com/script.js",
    proxy="socks5://user:pass@proxy.example.com:1080"
)

# Kasada with proxy
result = solver.kasada(
    website_url="https://example.com",
    pjs="https://example.com/ips.js",
    proxy="http://proxy.example.com:8080"
)

Supported Proxy Formats

http://host:port
http://user:pass@host:port
https://user:pass@host:port
socks4://host:port
socks5://user:pass@host:port

Generic Solve Method

For advanced usage or custom task types:

from captchasolv import CaptchaSolv, TaskType

solver = CaptchaSolv("YOUR_API_KEY")

result = solver.solve(
    task_type=TaskType.TURNSTILE,
    website_url="https://example.com",
    website_key="0x4AAAAAAABS7vwvV6VFfMcD",
    user_agent="Mozilla/5.0 ...",
)

Async/Polling Mode

For long-running tasks, you can create a task and poll separately:

task_id = solver.create_task(
    task_type=TaskType.TURNSTILE,
    website_url="https://example.com",
    website_key="0x4AAAAAAABS7vwvV6VFfMcD"
)

result = solver.wait_for_result(task_id, timeout=120)
print(result.solution.token)

Check Balance

balance = solver.get_balance()
print(f"Balance: ${balance}")

Error Handling

from captchasolv import (
    CaptchaSolv,
    CaptchaSolvError,
    InvalidKeyError,
    LimitExceededError,
    CaptchaUnsolvableError,
)

try:
    result = solver.turnstile(...)
except InvalidKeyError:
    print("Invalid API key")
except LimitExceededError:
    print("Balance exhausted or rate limit reached")
except CaptchaUnsolvableError:
    print("Failed to solve captcha, retry")
except CaptchaSolvError as e:
    print(f"Error {e.error_code}: {e.error_description}")

Configuration

solver = CaptchaSolv(
    api_key="YOUR_API_KEY",
    base_url="https://v1.captchasolv.com",
    timeout=130.0,
    poll_interval=3.0,
)

Response Object

result = solver.recaptcha_v2(...)

print(result.status)
print(result.solution.token)
print(result.solution.user_agent)
print(result.solution.cookies)
print(result.cost)
print(result.solve_count)

License

MIT

Metadata

Release files for captchasolv 1.0.3

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

Source distribution (sdist)

Source distribution for captchasolv 1.0.3
File Size Uploaded Provenance Actions
captchasolv-1.0.3.tar.gz 11.2 kB Without provenance Details for captchasolv-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 24.8 kB

Release files / captchasolv-1.0.3.tar.gz

Download URL captchasolv-1.0.3.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9448d93bc3ceb1810a9767fc3c371ceacc1da86aab57311c07f4079b766d7396
BLAKE2b-256 checksum
How to use checksums
2ec288862a15424476852a3e599f5b7b61cd481cbc95f7f09018ee22585e2eb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / captchasolv-1.0.3-py3-none-any.whl

Download URL captchasolv-1.0.3-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efc1d9213118f6eb949eb9bc27b942f526dc54d39d582fb8a36cb2b438279034
BLAKE2b-256 checksum
How to use checksums
59aaff15e06d13949fd52d84837d21feadb05e29f9243b2ac6c88b9b31c466bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for captchasolv 1.0.3

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.

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