Skip to main content

Python SDK for Captchaly.com

Project description

Test

Captchaly Python SDK

Official Python SDK for Captchaly.com.

Features

  • Support both sync and async usage.
  • Fully typed.
  • Automatic retry.

Requirements

This SDK is tested with Python 3.14. It may work with earlier versions, but it is not guaranteed.

Installation

pip install captchaly

Authentication

Provide your API key in either of these ways:

  1. Pass it to the client constructor
from captchaly import CaptchalyClient

CaptchalyClient("your_api_key")
  1. Set the environment variable CAPTCHALY_APIKEY and the client will read it automatically.

Quick Start

Synchronous usage

from captchaly import CaptchalyClient

url = "demo.captchaly.com"
sitekey = "6Le0FEMtAAAAAK9IgmSqaJfPb3E-9fI9xMp1nDfk"

with CaptchalyClient("your_api_key") as client:
	account = client.account()
	print(account.email, account.balance)

	recaptcha = client.recaptcha_v2(url, sitekey)
	print(recaptcha.token)

Asynchronous usage

In async code, use async keywords (await, async with, async for, ...) and call the .aio(...) variant of each method.

import asyncio
from captchaly import CaptchalyClient

url = "demo.captchaly.com"
sitekey = "0x4AAAAAAA4nzhwwpeesSPI2"

async def main():
	async with CaptchalyClient("your_api_key") as client:
		account = await client.account.aio()
		print(account.email, account.balance)

		turnstile = await client.turnstile.aio(url, sitekey)
		print(turnstile.token)

TODO / Roadmap

  • Playwright integration
  • Puppeteer integration

Contributing

This repository does not normally accept merge requests. You are welcome to open issues and requests for new features.

License

MIT License. See LICENSE for details.

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

captchaly-1.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

captchaly-1.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file captchaly-1.1.0.tar.gz.

File metadata

  • Download URL: captchaly-1.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for captchaly-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1f7a92ce1278c9828d2d28ba55843a45ab86e161ed28a9525766a0fb9646102a
MD5 dc8100ee52192758925a99523215f923
BLAKE2b-256 e763fd09606f115df13f1b726d69010a31659159fc45e96bf4f1d75199a2dff5

See more details on using hashes here.

File details

Details for the file captchaly-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: captchaly-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for captchaly-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dcd3b84216d1fcc4d20174b58ac8ffd6e29f92dd94b271e227842e46b762585
MD5 1b85321b3dd731ba08f3c975de906b0b
BLAKE2b-256 168cb85a138c0079b92c809af2ecdd83976fc3f8c3e7307958c55266e4a507b5

See more details on using hashes here.

Supported by

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