Skip to main content

Capmonster Python

PyPI - Python Version GitHub Release GitHub last commit GitHub Repo stars

A modern, strongly-typed Python SDK for CapMonster Cloud — solve reCAPTCHA, Turnstile, GeeTest, and 20+ other CAPTCHA types with both sync and async support.

Installation

pip install capmonster_python

Quick Start

from capmonster_python import CapmonsterClient, RecaptchaV2Task

client = CapmonsterClient(api_key="YOUR_API_KEY")

task = RecaptchaV2Task(
    websiteURL="https://example.com",
    websiteKey="SITE_KEY_HERE"
)

result = client.solve(task)
print(result)  # {"gRecaptchaResponse": "03AGdBq24..."}

Async

import asyncio
from capmonster_python import CapmonsterClient, RecaptchaV3Task

async def main():
    async with CapmonsterClient(api_key="YOUR_API_KEY") as client:
        task = RecaptchaV3Task(
            websiteURL="https://example.com",
            websiteKey="SITE_KEY_HERE",
            minScore=0.5,
            pageAction="verify"
        )
        result = await client.solve_async(task)
        print(result)

asyncio.run(main())

With Proxy

from capmonster_python import CapmonsterClient, RecaptchaV2Task, ProxyPayload

client = CapmonsterClient(api_key="YOUR_API_KEY")

task = RecaptchaV2Task(
    websiteURL="https://example.com",
    websiteKey="SITE_KEY_HERE",
    proxy=ProxyPayload(
        proxyType="http",
        proxyAddress="1.2.3.4",
        proxyPort=8080,
        proxyLogin="user",
        proxyPassword="pass"
    )
)

result = client.solve(task)

Client API

CapmonsterClient(api_key, timeout=30.0, max_retries=120, retry_delay=2.0)
Method Description
solve(task) Create task and poll until solved
create_task(task) Create a task, returns task_id
join_task_result(task_id) Poll until result is ready
get_task_result(task_id) Single poll (no waiting)
solve_detailed(task) Like solve, but returns a TaskResult with solution and cost
join_task_result_detailed(task_id) / get_task_result_detailed(task_id) Same, for polling
get_balance() Get account balance
get_user_agent() Get current valid User-Agent string
report_incorrect_image(task_id) Report bad image captcha solution
report_incorrect_token(task_id) Report bad token captcha solution

All methods have async variants with the _async suffix (e.g. solve_async, get_balance_async).

Both sync and async context managers are supported for proper connection cleanup.

Supported CAPTCHA Types

reCAPTCHA

CAPTCHA Type Class Proxy
reCAPTCHA v2 RecaptchaV2Task Optional
reCAPTCHA v2 Enterprise RecaptchaV2EnterpriseTask Optional
reCAPTCHA v3 RecaptchaV3Task No
reCAPTCHA v3 Enterprise RecaptchaV3EnterpriseTask No
reCAPTCHA Click RecaptchaClickTask (deprecated, use ComplexImageRecaptchaTask) Optional

Cloudflare

CAPTCHA Type Class Proxy
Turnstile TurnstileTask No
Turnstile Challenge (token / cf_clearance) TurnstileCloudFlareTask Optional / Required
Turnstile Waiting Room TurnstileWaitingRoomTask Required

Image-Based

CAPTCHA Type Class Proxy
Image-to-Text OCR ImageToTextTask No
Complex Image (reCAPTCHA click/grid) ComplexImageRecaptchaTask No
Complex Image Recognition ComplexImageRecognitionTask No

Behavioral / Interactive

CAPTCHA Type Class Proxy
GeeTest v3 GeeTestV3Task Optional
GeeTest v4 GeeTestV4Task Optional
FunCaptcha (Arkose Labs) FunCaptchaTask Required
Hunt HuntTask Required
Alibaba AlibabaTask Optional
Friendly Captcha FriendlyTask Optional
ARCaptcha ARCaptchaTask No

Enterprise Protection

CAPTCHA Type Class Proxy
DataDome DataDomeTask Required
Imperva (Incapsula) ImpervaTask Required
Amazon WAF AmazonTask Optional
TSPD TSPDTask Optional

Platform-Specific

CAPTCHA Type Class Proxy
Binance BinanceTask Required
Temu TemuTask (deprecated) No
TenDI TenDITask Optional
FengkongCloud FengkongCloudTask No
HeyTap HeyTapTask No
Proton ProtonTask Required

Other

CAPTCHA Type Class Proxy
Altcha AltchaTask No
Basilisk BasiliskTask No
Castle CastleTask (deprecated) No
MTCaptcha MTCaptchaTask Optional
Prosopo ProsopoTask Optional
Yidun YidunTask Optional

Don't see your captcha type? Use VanillaTaskPayload to build custom task payloads without waiting for an SDK update.

Advanced Usage

Callback URLs

result = client.solve(task, callback_url="https://yoursite.com/callback")

Report Incorrect Solutions

task_id = client.create_task(task)
result = client.join_task_result(task_id)

# If the token was rejected by the target site:
client.report_incorrect_token(task_id)

Fresh Token Generation

Use nocache=True on reCAPTCHA tasks to prevent cached token reuse:

task = RecaptchaV2Task(
    websiteURL="https://example.com",
    websiteKey="SITE_KEY_HERE",
    nocache=True
)

Documentation

Full API reference available at alperensert.github.io/capmonster_python.

Support

License

MIT License

Metadata

Release files for capmonster-python 5.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 capmonster-python 5.1.0
File Size Uploaded Provenance Actions
capmonster_python-5.1.0.tar.gz 27.3 kB With provenance Details for capmonster_python-5.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for capmonster-python 5.1.0
File Interpreter ABI Platform Actions
capmonster_python-5.1.0-py3-none-any.whl Python 3 none any Details for capmonster_python-5.1.0-py3-none-any.whl

Total release size: 72.0 kB

Release files / capmonster_python-5.1.0.tar.gz

Download URL capmonster_python-5.1.0.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5ef776edeba44e9bff30f77374518b51bbe13826079c8f54820c824f9c2219f0
BLAKE2b-256 checksum
How to use checksums
13b2aa5d9140f18c8f0ad60f302d559c116390eed360e12a13a40b1d16083185
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / capmonster_python-5.1.0-py3-none-any.whl

Download URL capmonster_python-5.1.0-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4dcda39d2d4ed9d369385e85d37fe03205acc1dbcbd75d3d005366bf9583d60a
BLAKE2b-256 checksum
How to use checksums
597a75429aa73cd4ad99916edda72261a808d795de1b297cc61664995936985b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for capmonster-python 5.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for capmonster_python-5.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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

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