Skip to main content

Py2captcha

Client library to solve captchas with 2captcha.com support.

Getting Started

Install as a standard Python package using:

pip install py2captcha

Usage

    from py2captcha import TwoCaptchaClient, GoogleReCaptchaV2Task
    
    # 2captcha.com authentication key
    key = "Your key goes here"

    # Website data
    google_key = "Google recaptcha key"  # sitekey
    url = "http://site.com/captchaurl"
    
    # Create client
    client = TwoCaptchaClient(client_key=key)

    # Requesting 2captcha.com queue status for reCAPTCHA V2
    status = client.get_queue_stats()

    print("reCAPTCHA V2 queue status:")
    print("Total workers: %d" % status.workers_total)
    print("Free workers: %d" % status.free_workers)
    print("Load factor: %d%%" % status.load)
    print("Average solve speed: %d seconds" % status.speed)
    print("Price per 1000 CAPTCHAS: %f USD" % status.bid)

    # Create Recaptcha Task
    task = GoogleReCaptchaV2Task(googlekey=google_key, pageurl=url)
    job = client.create_task(task)

    # Wait until captcha is solved
    # For async runs just call job.check_is_ready() until it returns true
    job.join()

    # Result
    token = job.get_solution_response()

    # Cost (Always 2.9/1000)
    cost = job.get_solution_cost()

    # Base 5 solution time
    time = job.get_solution_time()

    print("Token: %s" % token)
    print("Cost: %f USD" % cost)
    print("Solve time: %d seconds" % time)

Supported CAPTCHA types

  • reCAPTCHA V2

Metadata

Release files for py2captcha 0.1.1

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

Source distribution (sdist)

Source distribution for py2captcha 0.1.1
File Size Uploaded Provenance Actions
py2captcha-0.1.1.tar.gz 4.7 kB Without provenance Details for py2captcha-0.1.1.tar.gz

Release files / py2captcha-0.1.1.tar.gz

Download URL py2captcha-0.1.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
93d80278f142e8d07fe2d561f19c8320d0d48031d0c457b23c5a1f5b66a34906
BLAKE2b-256 checksum
How to use checksums
83b1068b0f4f7d6d0f28fd0947d8a73414e78b1f0b6ea9e868f871bcc7217b18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.1

Security for py2captcha 0.1.1

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.1 This release

1 release file 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