Metadata-Version: 2.4
Name: muaraicaptcha
Version: 1.1.0
Summary: Official Python SDK for the MuaraiCaptcha solving API
Author: MuaraiCaptcha
License: MIT
Project-URL: Homepage, https://muaraicaptcha.com
Project-URL: Documentation, https://github.com/Muarai/MuaraiCaptcha/tree/main/docs
Project-URL: Source, https://github.com/Muarai/MuaraiCaptcha
Keywords: captcha,recaptcha,hcaptcha,turnstile,funcaptcha,solver,muaraicaptcha
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<div align="center">

# MuaraiCaptcha — Python SDK

Official Python client for the [MuaraiCaptcha](https://muaraicaptcha.com) solving API.

[![PyPI](https://img.shields.io/badge/pip-muaraicaptcha-2563eb?style=flat-square)](https://pypi.org/project/muaraicaptcha/)
[![Python](https://img.shields.io/badge/python-3.8%2B-blue?style=flat-square)](https://www.python.org)
[![License](https://img.shields.io/badge/license-MIT-black?style=flat-square)](../../LICENSE)

</div>

Zero dependencies — pure standard library.

## Install

```bash
pip install muaraicaptcha
```

Or from this repo:

```bash
pip install ./sdk/python-SDK
```

## Quick start

```python
from muaraicaptcha import MuaraiCaptcha

client = MuaraiCaptcha("YOUR_API_KEY")

# One-shot: create the task and poll until solved.
solution = client.solve({
    "type": "TurnstileTaskProxyless",
    "websiteURL": "https://example.com",
    "websiteKey": "0x4AAAAAAA...",
})
print(solution["token"])
```

## API

```python
client = MuaraiCaptcha(client_key, base_url="https://api.muaraicaptcha.com", timeout=30.0)

client.get_balance() -> float
client.create_task(task: dict) -> int            # returns taskId
client.get_task_result(task_id: int) -> dict|None # solution when ready, None while processing
client.report_incorrect(task_id: int) -> None     # auto-refund a bad solve
client.solve(task: dict, poll_interval=5.0, timeout=180.0) -> dict  # create + poll
```

### Manual create + poll

```python
task_id = client.create_task({
    "type": "RecaptchaV2TaskProxyless",
    "websiteURL": "https://example.com/login",
    "websiteKey": "6Lc_a...",
})

import time
while True:
    solution = client.get_task_result(task_id)
    if solution:
        print(solution["gRecaptchaResponse"])
        break
    time.sleep(5)
```

## Error handling

```python
from muaraicaptcha import ApiError, SolveTimeoutError

try:
    solution = client.solve({...})
except ApiError as e:
    print(e.code, e.description)   # e.g. ERROR_ZERO_BALANCE
except SolveTimeoutError:
    print("gave up waiting")
```

## Documentation

- [Task types & parameters](../../docs/task-types.md)
- [Error codes](../../docs/error-codes.md)
- [Full API reference](../../docs/api-reference.md)

## License

MIT © MuaraiCaptcha
