Metadata-Version: 2.4
Name: captchakings
Version: 1.1.0
Summary: AI-powered CAPTCHA solver SDK. Solve reCAPTCHA, hCaptcha, Turnstile, and 40+ types.
Home-page: https://github.com/CaptchaKings/captchakings-python
Author: CaptchaKings
Author-email: support@captchakings.com
Project-URL: Documentation, https://captchakings.com/docs
Project-URL: Bug Tracker, https://github.com/CaptchaKings/captchakings-python/issues
Project-URL: Homepage, https://captchakings.com
Keywords: captcha,solver,recaptcha,hcaptcha,turnstile,funcaptcha,geetest,amazon-waf,datadome,ocr,captcha-solver,anti-captcha,2captcha,capsolver,automation,web-scraping,captchakings
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# CaptchaKings Python SDK

[![PyPI version](https://badge.fury.io/py/captchakings.svg)](https://pypi.org/project/captchakings/)
[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://pepy.tech/badge/captchakings)](https://pepy.tech/project/captchakings)

**The fastest AI-powered CAPTCHA solver API.** Solve reCAPTCHA, hCaptcha, Turnstile, FunCaptcha, GeeTest, Amazon WAF, and 40+ more captcha types with a simple Python SDK.

> 🎉 **Get 1000 free credits** when you [sign up](https://captchakings.com/register)!

---

## ⚡ Quick Start

```bash
pip install captchakings
```

```python
from captchakings import CaptchaKings

solver = CaptchaKings(api_key="YOUR_API_KEY")

# Solve text/image captcha
result = solver.solve_image("captcha.png")
print(result.text)  # "xK9mP2"

# Solve reCAPTCHA v2
token = solver.recaptcha_v2(
    sitekey="6Le-wvkSAAAAAPBMRTvw...",
    url="https://example.com"
)
print(token)
```

**That's it. 3 lines of code.** 🚀

---

## 📦 Installation

```bash
pip install captchakings
```

Or install from source:
```bash
git clone https://github.com/CaptchaKings/captchakings-python.git
cd captchakings-python
pip install -e .
```

---

## 🎯 Supported Captcha Types

| Type | Method | Avg Speed |
|------|--------|-----------|
| **Text/Image** | `solve_image()` | < 1s |
| **reCAPTCHA v2** | `recaptcha_v2()` | < 15s |
| **reCAPTCHA v3** | `recaptcha_v3()` | < 10s |
| **hCaptcha** | `hcaptcha()` | < 20s |
| **Cloudflare Turnstile** | `turnstile()` | < 10s |
| **FunCaptcha** | `funcaptcha()` | < 15s |
| **GeeTest v3/v4** | `geetest()` | < 10s |
| **Amazon WAF** | `amazon_waf()` | < 20s |
| **DataDome** | `datadome()` | < 15s |
| **MTCaptcha** | `solve_mtcaptcha()` | < 3s |
| **Slider** | `slider()` | < 5s |
| **Rotate** | `rotate()` | < 5s |

---

## 📖 Examples

### Text/Image Captcha
```python
from captchakings import CaptchaKings

solver = CaptchaKings(api_key="YOUR_API_KEY")

# From file
result = solver.solve_image("captcha.png")
print(f"Text: {result.text}, Confidence: {result.confidence}")

# From URL
result = solver.solve_image_url("https://example.com/captcha.jpg")
print(result.text)

# From base64
import base64
with open("captcha.png", "rb") as f:
    b64 = base64.b64encode(f.read()).decode()
result = solver.solve_image_base64(b64)
print(result.text)
```

### reCAPTCHA v2
```python
token = solver.recaptcha_v2(
    sitekey="6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-",
    url="https://example.com/login",
    invisible=False  # Set True for invisible reCAPTCHA
)
print(f"Token: {token}")
```

### reCAPTCHA v3
```python
token = solver.recaptcha_v3(
    sitekey="6LdKlZEpAAAAAAOQjzC2v_d36tWxCl6dWsozdSy9",
    url="https://example.com",
    action="login",
    min_score=0.7
)
```

### hCaptcha
```python
token = solver.hcaptcha(
    sitekey="a5f74b19-9e45-40e0-b45d-47ff91b7a6c2",
    url="https://example.com"
)
```

### Cloudflare Turnstile
```python
token = solver.turnstile(
    sitekey="0x4AAAAAAABS7vwvV6VFfMcD",
    url="https://example.com"
)
```

### FunCaptcha (Arkose Labs)
```python
token = solver.funcaptcha(
    public_key="DE0B0BB7-1EE4-4D70-1853-31B835D4506B",
    url="https://example.com",
    service_url="https://client-api.arkoselabs.com"
)
```

### GeeTest v4
```python
result = solver.geetest(
    captcha_id="e392e1d7fd421dc63325744d5a2b9c73",
    url="https://example.com"
)
```

### MTCaptcha (image → text)
```python
# From file
result = solver.solve_mtcaptcha("mtcaptcha.jpg")
print(result.text, result.confidence)

# From base64 (e.g. extracted from the page)
result = solver.solve_mtcaptcha(image_base64="data:image/jpeg;base64,/9j/4AAQ...")
print(result.text)
```

### Amazon WAF
```python
token = solver.amazon_waf(
    sitekey="AQIDAHjcYu/GjX+QlghicBg...",
    url="https://www.amazon.com",
    iv="CgAHazEKBQgA...",
    context="qoJh+bGhBQ..."
)
```

---

## 🔧 Advanced Configuration

```python
solver = CaptchaKings(
    api_key="YOUR_API_KEY",
    timeout=120,        # Max wait time (seconds)
    polling_interval=3, # Check interval (seconds)
    max_retries=3,      # Retry on failure
    debug=False         # Enable debug logging
)
```

### Check Balance
```python
balance = solver.get_balance()
print(f"Credits remaining: {balance}")
```

### Error Handling
```python
from captchakings import CaptchaKings, CaptchaError

try:
    result = solver.solve_image("captcha.png")
    print(result.text)
except CaptchaError as e:
    print(f"Error: {e.message}, Code: {e.code}")
```

### Async Support
```python
import asyncio
from captchakings import AsyncCaptchaKings

async def main():
    solver = AsyncCaptchaKings(api_key="YOUR_API_KEY")
    result = await solver.solve_image("captcha.png")
    print(result.text)

asyncio.run(main())
```

---

## 🆚 Why CaptchaKings?

| Feature | CaptchaKings | 2Captcha | Anti-Captcha |
|---------|:-----------:|:--------:|:------------:|
| **Speed** | ⚡ < 1s | 🐌 5-15s | 🐌 5-15s |
| **Accuracy** | 99.9% | 95% | 95% |
| **AI-Powered** | ✅ Yes | ❌ Human | ❌ Human |
| **Price (text)** | $0.50/1K | $2.99/1K | $2.00/1K |
| **40+ Types** | ✅ | ❌ | ❌ |
| **Free Trial** | ✅ 1000 credits | ❌ | ❌ |

---

## 💰 Pricing

| Plan | Price | Credits |
|------|-------|---------|
| **Free Trial** | $0 | 1,000 |
| **Starter** | $1 | 3,333 |
| **Pro** | $5 | 20,000 |
| **Business** | $20 | 100,000 |
| **Enterprise** | Custom | Unlimited |

👉 [View full pricing](https://captchakings.com/#pricing)

---

## 🔗 Links

- 🌐 **Website**: [captchakings.com](https://captchakings.com)
- 📖 **API Docs**: [captchakings.com/docs](https://captchakings.com/docs)
- 🐛 **Issues**: [GitHub Issues](https://github.com/CaptchaKings/captchakings-python/issues)
- 💬 **Support**: support@captchakings.com
- 🧩 **Chrome Extension**: [Chrome Web Store](https://captchakings.com/downloads)

---

## 📄 License

MIT License - see [LICENSE](LICENSE) for details.

---

<p align="center">
  <b>⭐ Star this repo if CaptchaKings helped your project! ⭐</b>
</p>
