๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
Sign inDemoInstall
Socket

capmonster-python

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capmonster-python

capmonster.cloud library/package for Python

4.0.0
Source
PyPI
Maintainers
1

๐Ÿค– Capmonster Python

PyPI - Python Version GitHub code size in bytes GitHub last commit GitHub Release GitHub Repo stars

A modern, strongly typed, async-friendly Python SDK for solving CAPTCHA challenges using Capmonster.Cloud.

Supports reCAPTCHA v2 & v3, Cloudflare Turnstile, GeeTest (v3 & v4) and much more.

โœจ Features

  • โœ… Fully typed Pydantic v2 models
  • ๐Ÿ” Both sync and async API support
  • ๐Ÿ” Proxy and User-Agent configuration
  • ๐Ÿ“ฆ Supports the most common CAPTCHA types
  • ๐Ÿ“š Intuitive API with powerful task building

๐Ÿ”ง Installation

pip install capmonster_python

[!IMPORTANT]
You're viewing the documentation for Capmonster Python v4, which includes breaking changes. If you prefer the old syntax used in versions prior to 4.x, you can continue using it by installing the legacy version:
pip install capmonster_python==3.2

๐Ÿš€ Quick Start

Async Example

import asyncio
from capmonster_python import CapmonsterClient, RecaptchaV3Task


async def main():
    client = CapmonsterClient(api_key="YOUR_API_KEY")

    task = RecaptchaV3Task(
        websiteURL="https://example.com",
        websiteKey="SITE_KEY_HERE",
        minScore=0.5,
        pageAction="verify"
    )

    task_id = await client.create_task_async(task)
    result = await client.join_task_result_async(task_id)
    print(result)


asyncio.run(main())

Sync Example

from capmonster_python import CapmonsterClient, RecaptchaV2Task

client = CapmonsterClient(api_key="<YOUR_API_KEY>")

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

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

๐Ÿง  Supported CAPTCHA Types

Capmonster Python v4 supports a wide range of CAPTCHA formats โ€” from mainstream challenges like reCAPTCHA and Turnstile to enterprise-grade shields like Imperva and DataDome. Each task supports full Pydantic validation โœ… and both sync and async clients ๐Ÿ”„ unless noted.

๐Ÿ”– CategoryCAPTCHA TypeClass NameProxy RequiredNotes
๐Ÿงฉ reCAPTCHAreCAPTCHA v2RecaptchaV2TaskOptionalVisible / Invisible supported โœ… ๐Ÿ”„
reCAPTCHA v2 EnterpriseRecaptchaV2EnterpriseTaskOptionalenterprisePayload & apiDomain โœ… ๐Ÿ”„
reCAPTCHA v3RecaptchaV3TaskโŒ NoScore-based, proxyless โœ… ๐Ÿ”„
๐Ÿ›ก๏ธ CloudflareTurnstile (token)TurnstileTaskโŒ NoLightweight, async-ready โœ… ๐Ÿ”„
Turnstile (cf_clearance)TurnstileCloudFlareTaskโœ… YesFull HTML + proxy required โœ… ๐Ÿ”„
๐Ÿ“ธ Image-basedImage-to-Text OCRImageToTextTaskโŒ NoBase64 image + module control โœ… ๐Ÿ”„
Complex Image (Recaptcha-like)ComplexImageRecaptchaTaskโŒ NoGrid-based, metadata aware โœ… ๐Ÿ”„
Complex Image Recognition (AI)ComplexImageRecognitionTaskโŒ NoSupports tasks like Shein, OOCL โœ… ๐Ÿ”„
๐Ÿง  Human BehaviorGeeTest v3GeeTestV3TaskOptionalChallenge + gt key + freshness โœ… ๐Ÿ”„
GeeTest v4GeeTestV4TaskOptionalinitParameters supported โœ… ๐Ÿ”„
๐Ÿ›ก๏ธ Enterprise ProtectionDataDomeDataDomeTaskโœ… RecommendedCookie & page context needed โœ… ๐Ÿ”„
ImpervaImpervaTaskโœ… RecommendedIncapsula + Reese84 logic โœ… ๐Ÿ”„
๐Ÿฆ Platform-SpecificBinance LoginBinanceTaskโœ… YesvalidateId for login flow โœ… ๐Ÿ”„
TemuTemuTaskโŒ NoCookie-injected behavioral solver โœ… ๐Ÿ”„
TenDITenDITaskโœ… YesCustom captchaAppId field โœ… ๐Ÿ”„
๐Ÿงช MiscellaneousProsopoProsopoTaskOptionalUsed in zk or crypto UIs โœ… ๐Ÿ”„
BasiliskBasiliskTaskโŒ NoMinimalist site-key puzzle โœ… ๐Ÿ”„

๐Ÿงฉ Advanced Usage

  • Callback URLs are supported during task creation.
  • Includes auto-retry loop for polling results (up to 120s)

๐Ÿ’ฌ Community & Support

Need help or have a question?

[!NOTE]
Community support is intended only for questions and issues related to this project. Custom usage scenarios, integrations, or application-specific logic are outside the scope of support.

๐Ÿ“„ License

This project is licensed under the MIT License.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts