Skip to main content

TigerCaptcha API client for Python

Project description

tigercaptcha-python

Python client for the TigerCaptcha solving API.

Full API reference: https://docs.tigercaptcha.com

Installation

pip install tigercaptcha

Or from source:

pip install .

Quick start

from tigercaptcha import TigerCaptcha

solver = TigerCaptcha("tc_live_your_api_key")

result = solver.facebook_image("captcha.jpg")
print(result["code"])      # -> "AB12CD"
print(result["taskId"])

Solving

By image

Pass a file path, a base64 string, or raw bytes:

result = solver.facebook_image("captcha.jpg")
result = solver.facebook_image(open("captcha.jpg", "rb").read())
result = solver.facebook_image("iVBORw0KGgoAAAANSUhEUg...")

By URL

The worker fetches a public image URL directly:

result = solver.facebook_url("https://www.facebook.com/captcha/tfbimage/?bd=...")

Balance

solver.balance()      # -> 12.35
solver.account()      # full account details (plan, limits, subscription)

Webhooks

Provide a callback_url and the result is POSTed to it when solved. In this mode the call returns immediately with the taskId instead of polling.

result = solver.facebook_image("captcha.jpg", callback_url="https://your-app.com/tiger-callback")
print(result["taskId"])

Configuration

solver = TigerCaptcha(
    "tc_live_your_api_key",
    server="https://api.tigercaptcha.com",
    polling_interval=2,
    default_timeout=120,
)

Per call:

result = solver.facebook_image("captcha.jpg", timeout=60, polling_interval=1)

Low-level methods

task_id = solver.create_task(type="FacebookCaptchaImage", body="<base64>")
result = solver.get_result(task_id)      # None while processing, dict when ready
result = solver.wait_result(task_id, timeout=120, polling_interval=2)

Errors

from tigercaptcha import TigerCaptcha, SolverException, ValidationException, TimeoutException, ApiException, NetworkException

try:
    result = solver.facebook_image("captcha.jpg")
except TimeoutException:
    pass
except ApiException as error:
    print(error)
except SolverException as error:
    print(error)

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

tigercaptcha-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

tigercaptcha-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file tigercaptcha-1.0.0.tar.gz.

File metadata

  • Download URL: tigercaptcha-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for tigercaptcha-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a50d0572e505c60d873ab264f463fe3f699213bac4ad0e4bccfdd672f9eab0a7
MD5 09bd6c596f1ca7d070b896a278bd397d
BLAKE2b-256 360cf7eb60fc701a2fa6fb84770dc8744b29185d2aa0bb0759639e18c3e798fb

See more details on using hashes here.

File details

Details for the file tigercaptcha-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tigercaptcha-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.0

File hashes

Hashes for tigercaptcha-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d0d5403df76b411b189bd8f2378a6d20c49f7238df897c4c5c5eada10b51077
MD5 e9352db5073685a6bee536b96ceffa00
BLAKE2b-256 73b3bd88298a152921c9be0ae716fabe4aad5b7523c83416354ff7165eb9be79

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