Metadata-Version: 2.4
Name: tigercaptcha
Version: 1.0.0
Summary: TigerCaptcha API client for Python
Home-page: https://github.com/Inception09/tigercaptcha-python
Author: Tiger Captcha
License: MIT
Project-URL: Homepage, https://tigercaptcha.com
Project-URL: Documentation, https://docs.tigercaptcha.com
Project-URL: Source, https://github.com/Inception09/tigercaptcha-python
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.20
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# tigercaptcha-python

Python client for the [TigerCaptcha](https://tigercaptcha.com) solving API.

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

## Installation

```bash
pip install tigercaptcha
```

Or from source:

```bash
pip install .
```

## Quick start

```python
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`:

```python
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:

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

## Balance

```python
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.

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

## Configuration

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

Per call:

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

## Low-level methods

```python
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

```python
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)
```
