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 git+https://github.com/Inception09/tigercaptcha-python.git

Quick start

from tigercaptcha import TigerCaptcha

solver = TigerCaptcha("tc_live_your_api_key")

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

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.1.tar.gz (4.8 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.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tigercaptcha-1.0.1.tar.gz
  • Upload date:
  • Size: 4.8 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.1.tar.gz
Algorithm Hash digest
SHA256 31f044ab76d0ca04c68eb40f5c844a394a4284b1c6d88b1dfc7cba68ab993e75
MD5 d21880320c5f93340da6a3e6e2cd6da7
BLAKE2b-256 6007e46d7751de440b75d912f15fbd9020828a3fee12a377e3dde522378f4742

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tigercaptcha-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d28a57134db46482168dc0d9fa101c04fdfe46a022087413da62b465dcacb78b
MD5 8558f9306ac5f47c278a3ffc0fd75bed
BLAKE2b-256 a93e6c3800f79a41c8b1f6f39895555acd712f37db616c7d9a146608cd4de353

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