Skip to main content

NopeCHA Python Library

Project description

NopeCHA Python Library

The NopeCHA Python library provides convenient access to the NopeCHA API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses.

Supported CAPTCHA types:

  • reCAPTCHA v2
  • reCAPTCHA v3
  • reCAPTCHA Enterprise
  • hCaptcha
  • hCaptcha Enterprise
  • FunCAPTCHA
  • AWS WAF CAPTCHA
  • Text-based CAPTCHA

Documentation

See the NopeCHA API docs.

Installation

You don't need this source code unless you want to modify the package. If you just want to use the package, just run:

pip install --upgrade nopecha

Install from source with:

python setup.py install

Usage

The library needs to be configured with your account's secret key which is available on the website. Either set it as the NOPECHA_API_KEY environment variable before using the library:

export NOPECHA_API_KEY='...'

Or set nopecha.api_key to its value:

import nopecha
nopecha.api_key = "..."

# solve a recognition challenge
clicks = nopecha.Recognition.solve(
    type='hcaptcha',
    task='Please click each image containing a cat-shaped cookie.',
    image_urls=[f"https://nopecha.com/image/demo/hcaptcha/{i}.png" for i in range(9)],
)

# print the grids to click
print(clicks)

# solve a token
token = nopecha.Token.solve(
    type='hcaptcha',
    sitekey='ab803303-ac41-41aa-9be1-7b4e01b91e2c',
    url='https://nopecha.com/demo/hcaptcha',
)

# print the token
print(token)

# get the current balance
balance = nopecha.Balance.get()

# print the current balance
print(balance)

Requirements

  • Python 3.7.1+

In general, we want to support the versions of Python that our customers are using. If you run into problems with any version issues, please let us know at support@nopecha.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nopecha-1.0.3.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

nopecha-1.0.3-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page