Metadata-Version: 2.1
Name: capsolver
Version: 1.0.0
Summary: capsolver python libary
Home-page: https://github.com/capsolver/capsolver-python
Author: capsolver
Author-email: capsolver.com@gmail.com
Project-URL: Bug Tracker, https://github.com/capsovler/capsovler-python/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.rst
Requires-Dist: requests (>=2.26.0)

# Capsolver
Capsolver official python library


## Supported CAPTCHA types:
- reCAPTCHA v2
- reCAPTCHA v3
- reCAPTCHA Enterprise
- hCaptcha
- hCaptcha Enterprise
- FunCAPTCHA
- AWS WAF CAPTCHA
- Text-based CAPTCHA


## Installation

You don't need this source code unless you want to modify the package. If you just
want to use the package, just run:

```sh
pip install --upgrade capsolver
```

Install from source with:

```sh
python setup.py install
```

## Usage

```bash
export CAPSOLVER_API_KEY='...'
```

Or set `capsolver.api_key` to its value:

```python
from pathlib import Path
import os
import base64
import capsolver

# tokenTask
print("api host",capsolver.api_base)
print("api key",capsolver.api_key)
# capsolver.api_key = "..."
solution = capsolver.TokenTask.solve(
             type = "RecaptchaV2TaskProxyLess",
             websiteKey= "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
             websiteURL= "https://www.google.com/recaptcha/api2/demo",
             enterprisePayload = {
                    "s":"123"
                }
             )
print(solution)

# RecognitionTask
img_path = os.path.join(Path(__file__).resolve().parent,"queue-it.jpg")
with open(img_path,'rb') as f:
    solution = capsolver.RecognitionTask.solve(
        type="ImageToTextTask",
        module="queueit",
        body = base64.b64encode(f.read()).decode("utf8")
    )
    print(solution)

# get current balance
balance = capsolver.Balance.get()
# print the current balance
print(balance)
```


