reghelp-client


Namereghelp-client JSON
Version 1.2.3 PyPI version JSON
download
home_pageNone
SummaryСовременная асинхронная Python библиотека для работы с REGHelp Key API
upload_time2025-07-22 05:24:44
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2025 REGHelp Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords reghelp api client async push email telegram integrity recaptcha turnstile voip
VCS
bugtrack_url
requirements httpx pydantic typing-extensions
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # REGHelp Python Client / REGHelp Python Client (Русская версия ниже)

![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)
![Version](https://img.shields.io/badge/version-1.2.3-green.svg)
![License](https://img.shields.io/badge/license-MIT-blue.svg)

---

## 📑 Table of contents / Содержание

1. [Features](#-features)
2. [Installation](#-installation)
3. [Quick start](#-quick-start)
4. [What's new](#-whats-new-in-123)
5. [Environment variables](#-environment-variables)
6. [Testing](#-testing)
7. [Contributing](#-contributing)
8. [FAQ](#-faq)
9. [Changelog](#-changelog)

---

## 🇬🇧 English

Modern asynchronous Python library for interacting with the REGHelp Key API. It supports all services: Push tokens, Email, Integrity, Turnstile, VoIP Push and Recaptcha Mobile.

### 🚀 Features

* **Asynchronous first** – full `async`/`await` support powered by `httpx`.
* **Type-safe** – strict typing with Pydantic data models.
* **Retries with exponential back-off** built-in.
* **Smart rate-limit handling** (50 requests per second).
* **Async context-manager** for automatic resource management.
* **Webhook support** out of the box.
* **Comprehensive error handling** with dedicated exception classes.

### 🆕 What's new in 1.2.3

* **Improved error handling for TASK_NOT_FOUND** – when task ID is known, returns TaskNotFoundError with specific ID; when unknown, returns generic RegHelpError instead of confusing "unknown" message.

### What was new in 1.2.2

* **Fixed TaskNotFoundError** – now shows real task ID instead of "unknown" when task is not found.
* **Improved error handling** – better error reporting for status methods with correct task context.

### What was new in 1.2.1

* **Increased proxy configuration limits** – proxy address can now be up to 255 characters, login up to 128 characters, and password up to 256 characters.
* **Enhanced ProxyConfig validation** – improved support for longer domain names and authentication credentials.

### What was new in 1.2.0

* **Standard Integrity tokens** – request them via `get_integrity_token(..., token_type="std")`.
* **IntegrityTokenType enum** for type-safe token type selection.
* Public exports for `AppDevice`, `IntegrityStatusResponse`, `VoipStatusResponse`, `IntegrityTokenType` directly from package root.
* `get_integrity_token()` now uses keyword-only parameters for new options while remaining backward compatible.

### 📦 Installation

```bash
pip install reghelp-client
```

For development:

```bash
pip install "reghelp-client[dev]"
```

### 🔧 Quick start

```python
import asyncio
from reghelp_client import RegHelpClient, AppDevice, EmailType

async def main():
    async with RegHelpClient("your_api_key") as client:
        # Check balance
        balance = await client.get_balance()
        print(f"Balance: {balance.balance} {balance.currency}")
        
        # Get Telegram iOS push token
        task = await client.get_push_token(
            app_name="tgiOS",
            app_device=AppDevice.IOS
        )
        print(f"Push token: {task.token}")
        
        # Wait for result
        result = await client.wait_for_result(task.id, "push")
        print(f"Push token: {result.token}")

if __name__ == "__main__":
    asyncio.run(main())
```

---

# RU Русская версия

Современная асинхронная Python библиотека для работы с REGHelp Key API. Поддерживает все сервисы: Push tokens, Email, Integrity, Turnstile, VoIP Push, Recaptcha Mobile.

## 🚀 Возможности

- **Асинхронность**: Полная поддержка async/await
- **Типизация**: Полная типизация с Pydantic моделями
- **Retry логика**: Автоматические повторы с exponential backoff
- **Rate limiting**: Умная обработка rate limits (50 rps)
- **Context manager**: Поддержка async context manager
- **Webhook support**: Поддержка webhook уведомлений
- **Comprehensive error handling**: Детальная обработка всех ошибок API

### 🆕 Что нового в 1.2.3

* **Улучшена обработка ошибки TASK_NOT_FOUND** — когда ID задачи известен, возвращается TaskNotFoundError с конкретным ID; когда неизвестен, возвращается общая RegHelpError вместо запутывающего сообщения "unknown".

### Что было нового в 1.2.2

* **Исправлена ошибка TaskNotFoundError** — теперь показывает реальный ID задачи вместо "unknown" когда задача не найдена.
* **Улучшена обработка ошибок** — лучшая отчетность об ошибках для методов статуса с правильным контекстом задачи.

### Что было нового в 1.2.1

* **Увеличенные лимиты для прокси конфигурации** — адрес прокси теперь может содержать до 255 символов, логин до 128 символов, а пароль до 256 символов.
* **Улучшенная валидация ProxyConfig** — расширенная поддержка длинных доменных имен и данных аутентификации.

### Что было нового в 1.2.0

* **Стандартные Integrity-токены** — используйте параметр `token_type="std"` в методе `get_integrity_token()`.
* Новый перечислитель **IntegrityTokenType** для строгой типизации.
* Экспорт `AppDevice`, `IntegrityStatusResponse`, `VoipStatusResponse`, `IntegrityTokenType` из корневого пакета.
* Сигнатура `get_integrity_token()` использует keyword-only параметры для новых опций, сохраняя совместимость с существующим кодом.

## 📦 Установка

```bash
pip install reghelp-client
```

Или для разработки:

```bash
pip install reghelp-client[dev]
```

## 🔧 Быстрый старт

```python
import asyncio
from reghelp_client import RegHelpClient, AppDevice, EmailType

async def main():
    async with RegHelpClient("your_api_key") as client:
        # Проверить баланс
        balance = await client.get_balance()
        print(f"Баланс: {balance.balance} {balance.currency}")
        
        # Получить push токен для Telegram iOS
        task = await client.get_push_token(
            app_name="tgiOS",
            app_device=AppDevice.IOS
        )
        print(f"Задача создана: {task.id}")
        
        # Ждать результат
        result = await client.wait_for_result(task.id, "push")
        print(f"Push токен: {result.token}")

if __name__ == "__main__":
    asyncio.run(main())
```

## 📚 Документация API

### Инициализация клиента

```python
from reghelp_client import RegHelpClient

# Базовое использование
client = RegHelpClient("your_api_key")

# С кастомными настройками
client = RegHelpClient(
    api_key="your_api_key",
    base_url="https://api.reghelp.net",
    timeout=30.0,
    max_retries=3,
    retry_delay=1.0
)

# Использование как context manager (рекомендуется)
async with RegHelpClient("your_api_key") as client:
    # Ваш код здесь
    pass
```

### 📱 Push Tokens

#### Получение push токена

```python
from reghelp_client import AppDevice

# Для Telegram iOS
task = await client.get_push_token(
    app_name="tgiOS",
    app_device=AppDevice.IOS,
    app_version="10.9.2",
    app_build="25345",
    ref="my_ref_tag"
)

# Для Telegram Android
task = await client.get_push_token(
    app_name="tg",
    app_device=AppDevice.ANDROID
)

# Проверить статус
status = await client.get_push_status(task.id)
if status.status == "done":
    print(f"Токен: {status.token}")
```

#### Поддерживаемые приложения

| Platform | app_name | Bundle ID |
|----------|----------|-----------|
| Android | `tg` | `org.telegram.messenger` |
| Android | `tg_beta` | `org.telegram.messenger.beta` |
| Android | `tg_web` | `org.telegram.messenger.web` |
| Android | `tg_x` | `org.thunderdog.challegram` |
| iOS | `tgiOS` | `ph.telegra.Telegraph` |

#### Отметка неуспешного токена

```python
from reghelp_client import PushStatusType

# Если токен оказался неработающим
await client.set_push_status(
    task_id="task_id",
    phone_number="+15551234567",
    status=PushStatusType.NOSMS
)
```

### 📧 Email Service

```python
from reghelp_client import EmailType

# Получить временный email
email_task = await client.get_email(
    app_name="tg",
    app_device=AppDevice.IOS,
    phone="+15551234567",
    email_type=EmailType.ICLOUD
)

print(f"Email: {email_task.email}")

# Ждать код подтверждения
email_status = await client.wait_for_result(email_task.id, "email")
print(f"Код: {email_status.code}")
```

### 🔒 Integrity Service

```python
import base64

# Генерируем nonce
nonce = base64.urlsafe_b64encode(b"your_nonce_data").decode()

# Получить integrity токен
integrity_task = await client.get_integrity_token(
    app_name="tg",
    app_device=AppDevice.ANDROID,
    nonce=nonce
)

# Ждать результат
result = await client.wait_for_result(integrity_task.id, "integrity")
print(f"Integrity токен: {result.token}")
```

### 🤖 Recaptcha Mobile

```python
from reghelp_client import ProxyConfig, ProxyType

# Настройка прокси (поддерживает длинные значения)
proxy = ProxyConfig(
    type=ProxyType.HTTP,
    address="very-long-proxy-domain-name.example.com",  # до 255 символов
    port=8080,
    login="very_long_username_up_to_128_chars",  # до 128 символов
    password="very_long_password_up_to_256_characters"  # до 256 символов
)

# Решить recaptcha
recaptcha_task = await client.get_recaptcha_mobile_token(
    app_name="org.telegram.messenger",
    app_device=AppDevice.ANDROID,
    app_key="6Lc-recaptcha-site-key",
    app_action="login",
    proxy=proxy
)

# Ждать результат
result = await client.wait_for_result(recaptcha_task.id, "recaptcha")
print(f"Recaptcha токен: {result.token}")
```

### 🔐 Turnstile

```python
# Решить Cloudflare Turnstile
turnstile_task = await client.get_turnstile_token(
    url="https://example.com/page",
    site_key="0x4AAAA...",
    action="login",
    proxy="http://proxy.example.com:8080"  # опционально
)

# Ждать результат
result = await client.wait_for_result(turnstile_task.id, "turnstile")
print(f"Turnstile токен: {result.token}")
```

### 📞 VoIP Push

```python
# Получить VoIP push токен
voip_task = await client.get_voip_token(
    app_name="tgiOS",
    ref="voip_ref"
)

# Ждать результат
result = await client.wait_for_result(voip_task.id, "voip")
print(f"VoIP токен: {result.token}")
```

### 🔄 Автоматическое ожидание результата

```python
# Автоматически ждать выполнения задачи
result = await client.wait_for_result(
    task_id="task_id",
    service="push",  # push, email, integrity, recaptcha, turnstile, voip
    timeout=180.0,   # максимальное время ожидания
    poll_interval=2.0  # интервал между проверками
)
```

### 🪝 Webhook поддержка

```python
# Создать задачу с webhook
task = await client.get_push_token(
    app_name="tgiOS",
    app_device=AppDevice.IOS,
    webhook="https://yourapp.com/webhook"
)

# Когда задача завершится, на указанный URL придет POST запрос
# с JSON данными аналогичными ответу get_status
```

## 🚨 Обработка ошибок

```python
from reghelp_client import (
    RegHelpError,
    RateLimitError,
    UnauthorizedError,
    TaskNotFoundError,
    NetworkError
)

try:
    task = await client.get_push_token("tgiOS", AppDevice.IOS)
except RateLimitError:
    print("Превышен лимит запросов (50/сек)")
except UnauthorizedError:
    print("Неверный API ключ")
except TaskNotFoundError as e:
    print(f"Задача не найдена: {e.task_id}")
except NetworkError as e:
    print(f"Сетевая ошибка: {e}")
except RegHelpError as e:
    print(f"API ошибка: {e}")
```

## ⚙️ Конфигурация

### Логирование

```python
import logging

# Включить debug логи
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("reghelp_client")
```

### Кастомный HTTP клиент

```python
import httpx

# Использовать свой HTTP клиент
custom_client = httpx.AsyncClient(
    timeout=60.0,
    verify=False  # отключить SSL проверку (не рекомендуется)
)

client = RegHelpClient(
    api_key="your_api_key",
    http_client=custom_client
)
```

## 🧪 Примеры для разных случаев

### Массовое получение токенов

```python
import asyncio

async def get_multiple_tokens():
    async with RegHelpClient("your_api_key") as client:
        # Создать несколько задач параллельно
        tasks = await asyncio.gather(*[
            client.get_push_token("tgiOS", AppDevice.IOS)
            for _ in range(5)
        ])
        
        # Ждать все результаты
        results = await asyncio.gather(*[
            client.wait_for_result(task.id, "push")
            for task in tasks
        ])
        
        for i, result in enumerate(results):
            print(f"Токен {i+1}: {result.token}")
```

### Работа с балансом

```python
async def manage_balance():
    async with RegHelpClient("your_api_key") as client:
        balance = await client.get_balance()
        
        if balance.balance < 10:
            print("Низкий баланс! Пополните аккаунт")
            return
            
        print(f"Текущий баланс: {balance.balance} {balance.currency}")
```

### Обработка длительных операций

```python
async def long_running_task():
    async with RegHelpClient("your_api_key") as client:
        task = await client.get_push_token("tgiOS", AppDevice.IOS)
        
        # Проверять статус с кастомным интервалом
        while True:
            status = await client.get_push_status(task.id)
            
            if status.status == "done":
                print(f"Готово! Токен: {status.token}")
                break
            elif status.status == "error":
                print(f"Ошибка: {status.message}")
                break
                
            print(f"Статус: {status.status}")
            await asyncio.sleep(5)  # проверять каждые 5 секунд
```

## 📋 Требования

- Python 3.8+
- httpx >= 0.27.0
- pydantic >= 2.0.0

## 📄 Лицензия

MIT License. См. [LICENSE](LICENSE) для деталей.

## 🤝 Поддержка

- Документация: https://reghelp.net/api-docs
- Поддержка: support@reghelp.net
- Issues: https://github.com/REGHELPNET/reghelp_client/issues

---

## 🌐 Environment variables / Переменные окружения

| Variable | Description | Example |
|----------|-------------|---------|
| `REGHELP_API_KEY` | Your personal API key | `demo_123abc` |
| `REGHELP_BASE_URL` | Override base URL if you host a private mirror | `https://api.reghelp.net` |
| `REGHELP_TIMEOUT` | Default request timeout in seconds | `30` |
| `REGHELP_MAX_RETRIES` | Max automatic retries on network errors | `3` |

> 💡 *Tip:* you can create a `.env` file and load it with [python-dotenv](https://github.com/theskumar/python-dotenv).

---

## 🧪 Testing / Тестирование

```bash
# clone repo and install dev extras
git clone https://github.com/REGHELPNET/reghelp_client.git
cd reghelp_client
pip install -e ".[dev]"

# unit tests + coverage
pytest -v --cov=reghelp_client --cov-report=term-missing
```

Additional commands:

* **Formatting** – `black reghelp_client/ tests/`
* **Linting** – `ruff check reghelp_client/ tests/ examples/`
* **Type checking** – `mypy reghelp_client/`

---

## 🛠️ Contributing / Вклад

1. Fork the repository and create your branch: `git checkout -b feat/my-feature`  
2. Install dev dependencies: `pip install -e ".[dev]"`  
3. Run `pre-commit install` to enable hooks.  
4. Ensure tests & linters pass: `pytest && ruff check . && mypy .`  
5. Submit a pull-request with a clear description of your changes.

We follow **Conventional Commits** for commit messages and the **Black** code style.

---

## ❓ FAQ / Часто задаваемые вопросы

<details>
<summary>How do I increase the request timeout?</summary>

```python
client = RegHelpClient("api_key", timeout=60.0)
```

</details>

<details>
<summary>Does the client support synchronous code?</summary>

No, the library is asynchronous-first. You can run it in synchronous code with `asyncio.run()`.

</details>

<details>
<summary>What is the difference between `Integrity` and `SafetyNet`?</summary>

`Integrity` refers to Google Play Integrity API while SafetyNet is deprecated. REGHelp supports the new Integrity API.

</details>

---

## 🗒️ Changelog

See [CHANGELOG.md](CHANGELOG.md) for a complete release history. 

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "reghelp-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "REGHelp Team <support@reghelp.net>",
    "keywords": "reghelp, api, client, async, push, email, telegram, integrity, recaptcha, turnstile, voip",
    "author": null,
    "author_email": "REGHelp Team <support@reghelp.net>",
    "download_url": "https://files.pythonhosted.org/packages/3d/c3/803f8ec1d026fce5c75120c41205233e7b7f2877a36c1b1fc4e7cc4f1e4a/reghelp_client-1.2.3.tar.gz",
    "platform": null,
    "description": "# REGHelp Python Client / REGHelp Python Client (\u0420\u0443\u0441\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0438\u0436\u0435)\n\n![Python](https://img.shields.io/badge/python-3.8%2B-blue.svg)\n![Version](https://img.shields.io/badge/version-1.2.3-green.svg)\n![License](https://img.shields.io/badge/license-MIT-blue.svg)\n\n---\n\n## \ud83d\udcd1 Table of contents / \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\n\n1. [Features](#-features)\n2. [Installation](#-installation)\n3. [Quick start](#-quick-start)\n4. [What's new](#-whats-new-in-123)\n5. [Environment variables](#-environment-variables)\n6. [Testing](#-testing)\n7. [Contributing](#-contributing)\n8. [FAQ](#-faq)\n9. [Changelog](#-changelog)\n\n---\n\n## \ud83c\uddec\ud83c\udde7 English\n\nModern asynchronous Python library for interacting with the REGHelp Key API. It supports all services: Push tokens, Email, Integrity, Turnstile, VoIP Push and Recaptcha Mobile.\n\n### \ud83d\ude80 Features\n\n* **Asynchronous first** \u2013 full `async`/`await` support powered by `httpx`.\n* **Type-safe** \u2013 strict typing with Pydantic data models.\n* **Retries with exponential back-off** built-in.\n* **Smart rate-limit handling** (50 requests per second).\n* **Async context-manager** for automatic resource management.\n* **Webhook support** out of the box.\n* **Comprehensive error handling** with dedicated exception classes.\n\n### \ud83c\udd95 What's new in 1.2.3\n\n* **Improved error handling for TASK_NOT_FOUND** \u2013 when task ID is known, returns TaskNotFoundError with specific ID; when unknown, returns generic RegHelpError instead of confusing \"unknown\" message.\n\n### What was new in 1.2.2\n\n* **Fixed TaskNotFoundError** \u2013 now shows real task ID instead of \"unknown\" when task is not found.\n* **Improved error handling** \u2013 better error reporting for status methods with correct task context.\n\n### What was new in 1.2.1\n\n* **Increased proxy configuration limits** \u2013 proxy address can now be up to 255 characters, login up to 128 characters, and password up to 256 characters.\n* **Enhanced ProxyConfig validation** \u2013 improved support for longer domain names and authentication credentials.\n\n### What was new in 1.2.0\n\n* **Standard Integrity tokens** \u2013 request them via `get_integrity_token(..., token_type=\"std\")`.\n* **IntegrityTokenType enum** for type-safe token type selection.\n* Public exports for `AppDevice`, `IntegrityStatusResponse`, `VoipStatusResponse`, `IntegrityTokenType` directly from package root.\n* `get_integrity_token()` now uses keyword-only parameters for new options while remaining backward compatible.\n\n### \ud83d\udce6 Installation\n\n```bash\npip install reghelp-client\n```\n\nFor development:\n\n```bash\npip install \"reghelp-client[dev]\"\n```\n\n### \ud83d\udd27 Quick start\n\n```python\nimport asyncio\nfrom reghelp_client import RegHelpClient, AppDevice, EmailType\n\nasync def main():\n    async with RegHelpClient(\"your_api_key\") as client:\n        # Check balance\n        balance = await client.get_balance()\n        print(f\"Balance: {balance.balance} {balance.currency}\")\n        \n        # Get Telegram iOS push token\n        task = await client.get_push_token(\n            app_name=\"tgiOS\",\n            app_device=AppDevice.IOS\n        )\n        print(f\"Push token: {task.token}\")\n        \n        # Wait for result\n        result = await client.wait_for_result(task.id, \"push\")\n        print(f\"Push token: {result.token}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n---\n\n# RU \u0420\u0443\u0441\u0441\u043a\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f\n\n\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 REGHelp Key API. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b: Push tokens, Email, Integrity, Turnstile, VoIP Push, Recaptcha Mobile.\n\n## \ud83d\ude80 \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\n\n- **\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c**: \u041f\u043e\u043b\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 async/await\n- **\u0422\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f**: \u041f\u043e\u043b\u043d\u0430\u044f \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044f \u0441 Pydantic \u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438\n- **Retry \u043b\u043e\u0433\u0438\u043a\u0430**: \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044b \u0441 exponential backoff\n- **Rate limiting**: \u0423\u043c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 rate limits (50 rps)\n- **Context manager**: \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 async context manager\n- **Webhook support**: \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 webhook \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439\n- **Comprehensive error handling**: \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u0435\u0445 \u043e\u0448\u0438\u0431\u043e\u043a API\n\n### \ud83c\udd95 \u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 1.2.3\n\n* **\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 TASK_NOT_FOUND** \u2014 \u043a\u043e\u0433\u0434\u0430 ID \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f TaskNotFoundError \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c ID; \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043e\u0431\u0449\u0430\u044f RegHelpError \u0432\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \"unknown\".\n\n### \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 1.2.2\n\n* **\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 TaskNotFoundError** \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 ID \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u043c\u0435\u0441\u0442\u043e \"unknown\" \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430.\n* **\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a** \u2014 \u043b\u0443\u0447\u0448\u0430\u044f \u043e\u0442\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0437\u0430\u0434\u0430\u0447\u0438.\n\n### \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 1.2.1\n\n* **\u0423\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u043d\u044b\u0435 \u043b\u0438\u043c\u0438\u0442\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u043a\u0441\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438** \u2014 \u0430\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u043a\u0441\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u043e 255 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043b\u043e\u0433\u0438\u043d \u0434\u043e 128 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0430 \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043e 256 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.\n* **\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f ProxyConfig** \u2014 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u0445 \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u043d \u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.\n\n### \u0427\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0432 1.2.0\n\n* **\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 Integrity-\u0442\u043e\u043a\u0435\u043d\u044b** \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 `token_type=\"std\"` \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 `get_integrity_token()`.\n* \u041d\u043e\u0432\u044b\u0439 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c **IntegrityTokenType** \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438.\n* \u042d\u043a\u0441\u043f\u043e\u0440\u0442 `AppDevice`, `IntegrityStatusResponse`, `VoipStatusResponse`, `IntegrityTokenType` \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430.\n* \u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 `get_integrity_token()` \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 keyword-only \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u043e\u043f\u0446\u0438\u0439, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0441 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c.\n\n## \ud83d\udce6 \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430\n\n```bash\npip install reghelp-client\n```\n\n\u0418\u043b\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438:\n\n```bash\npip install reghelp-client[dev]\n```\n\n## \ud83d\udd27 \u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442\n\n```python\nimport asyncio\nfrom reghelp_client import RegHelpClient, AppDevice, EmailType\n\nasync def main():\n    async with RegHelpClient(\"your_api_key\") as client:\n        # \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\n        balance = await client.get_balance()\n        print(f\"\u0411\u0430\u043b\u0430\u043d\u0441: {balance.balance} {balance.currency}\")\n        \n        # \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c push \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f Telegram iOS\n        task = await client.get_push_token(\n            app_name=\"tgiOS\",\n            app_device=AppDevice.IOS\n        )\n        print(f\"\u0417\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430: {task.id}\")\n        \n        # \u0416\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\n        result = await client.wait_for_result(task.id, \"push\")\n        print(f\"Push \u0442\u043e\u043a\u0435\u043d: {result.token}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## \ud83d\udcda \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f API\n\n### \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430\n\n```python\nfrom reghelp_client import RegHelpClient\n\n# \u0411\u0430\u0437\u043e\u0432\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\nclient = RegHelpClient(\"your_api_key\")\n\n# \u0421 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438\nclient = RegHelpClient(\n    api_key=\"your_api_key\",\n    base_url=\"https://api.reghelp.net\",\n    timeout=30.0,\n    max_retries=3,\n    retry_delay=1.0\n)\n\n# \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043a context manager (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f)\nasync with RegHelpClient(\"your_api_key\") as client:\n    # \u0412\u0430\u0448 \u043a\u043e\u0434 \u0437\u0434\u0435\u0441\u044c\n    pass\n```\n\n### \ud83d\udcf1 Push Tokens\n\n#### \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 push \u0442\u043e\u043a\u0435\u043d\u0430\n\n```python\nfrom reghelp_client import AppDevice\n\n# \u0414\u043b\u044f Telegram iOS\ntask = await client.get_push_token(\n    app_name=\"tgiOS\",\n    app_device=AppDevice.IOS,\n    app_version=\"10.9.2\",\n    app_build=\"25345\",\n    ref=\"my_ref_tag\"\n)\n\n# \u0414\u043b\u044f Telegram Android\ntask = await client.get_push_token(\n    app_name=\"tg\",\n    app_device=AppDevice.ANDROID\n)\n\n# \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441\nstatus = await client.get_push_status(task.id)\nif status.status == \"done\":\n    print(f\"\u0422\u043e\u043a\u0435\u043d: {status.token}\")\n```\n\n#### \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\n\n| Platform | app_name | Bundle ID |\n|----------|----------|-----------|\n| Android | `tg` | `org.telegram.messenger` |\n| Android | `tg_beta` | `org.telegram.messenger.beta` |\n| Android | `tg_web` | `org.telegram.messenger.web` |\n| Android | `tg_x` | `org.thunderdog.challegram` |\n| iOS | `tgiOS` | `ph.telegra.Telegraph` |\n\n#### \u041e\u0442\u043c\u0435\u0442\u043a\u0430 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u0430\n\n```python\nfrom reghelp_client import PushStatusType\n\n# \u0415\u0441\u043b\u0438 \u0442\u043e\u043a\u0435\u043d \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u043c\nawait client.set_push_status(\n    task_id=\"task_id\",\n    phone_number=\"+15551234567\",\n    status=PushStatusType.NOSMS\n)\n```\n\n### \ud83d\udce7 Email Service\n\n```python\nfrom reghelp_client import EmailType\n\n# \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 email\nemail_task = await client.get_email(\n    app_name=\"tg\",\n    app_device=AppDevice.IOS,\n    phone=\"+15551234567\",\n    email_type=EmailType.ICLOUD\n)\n\nprint(f\"Email: {email_task.email}\")\n\n# \u0416\u0434\u0430\u0442\u044c \u043a\u043e\u0434 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f\nemail_status = await client.wait_for_result(email_task.id, \"email\")\nprint(f\"\u041a\u043e\u0434: {email_status.code}\")\n```\n\n### \ud83d\udd12 Integrity Service\n\n```python\nimport base64\n\n# \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c nonce\nnonce = base64.urlsafe_b64encode(b\"your_nonce_data\").decode()\n\n# \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c integrity \u0442\u043e\u043a\u0435\u043d\nintegrity_task = await client.get_integrity_token(\n    app_name=\"tg\",\n    app_device=AppDevice.ANDROID,\n    nonce=nonce\n)\n\n# \u0416\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nresult = await client.wait_for_result(integrity_task.id, \"integrity\")\nprint(f\"Integrity \u0442\u043e\u043a\u0435\u043d: {result.token}\")\n```\n\n### \ud83e\udd16 Recaptcha Mobile\n\n```python\nfrom reghelp_client import ProxyConfig, ProxyType\n\n# \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0440\u043e\u043a\u0441\u0438 (\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f)\nproxy = ProxyConfig(\n    type=ProxyType.HTTP,\n    address=\"very-long-proxy-domain-name.example.com\",  # \u0434\u043e 255 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\n    port=8080,\n    login=\"very_long_username_up_to_128_chars\",  # \u0434\u043e 128 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\n    password=\"very_long_password_up_to_256_characters\"  # \u0434\u043e 256 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432\n)\n\n# \u0420\u0435\u0448\u0438\u0442\u044c recaptcha\nrecaptcha_task = await client.get_recaptcha_mobile_token(\n    app_name=\"org.telegram.messenger\",\n    app_device=AppDevice.ANDROID,\n    app_key=\"6Lc-recaptcha-site-key\",\n    app_action=\"login\",\n    proxy=proxy\n)\n\n# \u0416\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nresult = await client.wait_for_result(recaptcha_task.id, \"recaptcha\")\nprint(f\"Recaptcha \u0442\u043e\u043a\u0435\u043d: {result.token}\")\n```\n\n### \ud83d\udd10 Turnstile\n\n```python\n# \u0420\u0435\u0448\u0438\u0442\u044c Cloudflare Turnstile\nturnstile_task = await client.get_turnstile_token(\n    url=\"https://example.com/page\",\n    site_key=\"0x4AAAA...\",\n    action=\"login\",\n    proxy=\"http://proxy.example.com:8080\"  # \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\n)\n\n# \u0416\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nresult = await client.wait_for_result(turnstile_task.id, \"turnstile\")\nprint(f\"Turnstile \u0442\u043e\u043a\u0435\u043d: {result.token}\")\n```\n\n### \ud83d\udcde VoIP Push\n\n```python\n# \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c VoIP push \u0442\u043e\u043a\u0435\u043d\nvoip_task = await client.get_voip_token(\n    app_name=\"tgiOS\",\n    ref=\"voip_ref\"\n)\n\n# \u0416\u0434\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\nresult = await client.wait_for_result(voip_task.id, \"voip\")\nprint(f\"VoIP \u0442\u043e\u043a\u0435\u043d: {result.token}\")\n```\n\n### \ud83d\udd04 \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\n\n```python\n# \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0436\u0434\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438\nresult = await client.wait_for_result(\n    task_id=\"task_id\",\n    service=\"push\",  # push, email, integrity, recaptcha, turnstile, voip\n    timeout=180.0,   # \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f\n    poll_interval=2.0  # \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\u043c\u0438\n)\n```\n\n### \ud83e\ude9d Webhook \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430\n\n```python\n# \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 webhook\ntask = await client.get_push_token(\n    app_name=\"tgiOS\",\n    app_device=AppDevice.IOS,\n    webhook=\"https://yourapp.com/webhook\"\n)\n\n# \u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f, \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043f\u0440\u0438\u0434\u0435\u0442 POST \u0437\u0430\u043f\u0440\u043e\u0441\n# \u0441 JSON \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u0442\u0432\u0435\u0442\u0443 get_status\n```\n\n## \ud83d\udea8 \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a\n\n```python\nfrom reghelp_client import (\n    RegHelpError,\n    RateLimitError,\n    UnauthorizedError,\n    TaskNotFoundError,\n    NetworkError\n)\n\ntry:\n    task = await client.get_push_token(\"tgiOS\", AppDevice.IOS)\nexcept RateLimitError:\n    print(\"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d \u043b\u0438\u043c\u0438\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (50/\u0441\u0435\u043a)\")\nexcept UnauthorizedError:\n    print(\"\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 API \u043a\u043b\u044e\u0447\")\nexcept TaskNotFoundError as e:\n    print(f\"\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430: {e.task_id}\")\nexcept NetworkError as e:\n    print(f\"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430: {e}\")\nexcept RegHelpError as e:\n    print(f\"API \u043e\u0448\u0438\u0431\u043a\u0430: {e}\")\n```\n\n## \u2699\ufe0f \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\n\n### \u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\n\n```python\nimport logging\n\n# \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c debug \u043b\u043e\u0433\u0438\nlogging.basicConfig(level=logging.DEBUG)\nlogger = logging.getLogger(\"reghelp_client\")\n```\n\n### \u041a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0439 HTTP \u043a\u043b\u0438\u0435\u043d\u0442\n\n```python\nimport httpx\n\n# \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 HTTP \u043a\u043b\u0438\u0435\u043d\u0442\ncustom_client = httpx.AsyncClient(\n    timeout=60.0,\n    verify=False  # \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c SSL \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 (\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f)\n)\n\nclient = RegHelpClient(\n    api_key=\"your_api_key\",\n    http_client=custom_client\n)\n```\n\n## \ud83e\uddea \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432\n\n### \u041c\u0430\u0441\u0441\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432\n\n```python\nimport asyncio\n\nasync def get_multiple_tokens():\n    async with RegHelpClient(\"your_api_key\") as client:\n        # \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\n        tasks = await asyncio.gather(*[\n            client.get_push_token(\"tgiOS\", AppDevice.IOS)\n            for _ in range(5)\n        ])\n        \n        # \u0416\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b\n        results = await asyncio.gather(*[\n            client.wait_for_result(task.id, \"push\")\n            for task in tasks\n        ])\n        \n        for i, result in enumerate(results):\n            print(f\"\u0422\u043e\u043a\u0435\u043d {i+1}: {result.token}\")\n```\n\n### \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u043b\u0430\u043d\u0441\u043e\u043c\n\n```python\nasync def manage_balance():\n    async with RegHelpClient(\"your_api_key\") as client:\n        balance = await client.get_balance()\n        \n        if balance.balance < 10:\n            print(\"\u041d\u0438\u0437\u043a\u0438\u0439 \u0431\u0430\u043b\u0430\u043d\u0441! \u041f\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\")\n            return\n            \n        print(f\"\u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0431\u0430\u043b\u0430\u043d\u0441: {balance.balance} {balance.currency}\")\n```\n\n### \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\n\n```python\nasync def long_running_task():\n    async with RegHelpClient(\"your_api_key\") as client:\n        task = await client.get_push_token(\"tgiOS\", AppDevice.IOS)\n        \n        # \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u0441 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u043e\u043c\n        while True:\n            status = await client.get_push_status(task.id)\n            \n            if status.status == \"done\":\n                print(f\"\u0413\u043e\u0442\u043e\u0432\u043e! \u0422\u043e\u043a\u0435\u043d: {status.token}\")\n                break\n            elif status.status == \"error\":\n                print(f\"\u041e\u0448\u0438\u0431\u043a\u0430: {status.message}\")\n                break\n                \n            print(f\"\u0421\u0442\u0430\u0442\u0443\u0441: {status.status}\")\n            await asyncio.sleep(5)  # \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0435 5 \u0441\u0435\u043a\u0443\u043d\u0434\n```\n\n## \ud83d\udccb \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\n\n- Python 3.8+\n- httpx >= 0.27.0\n- pydantic >= 2.0.0\n\n## \ud83d\udcc4 \u041b\u0438\u0446\u0435\u043d\u0437\u0438\u044f\n\nMIT License. \u0421\u043c. [LICENSE](LICENSE) \u0434\u043b\u044f \u0434\u0435\u0442\u0430\u043b\u0435\u0439.\n\n## \ud83e\udd1d \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430\n\n- \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: https://reghelp.net/api-docs\n- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430: support@reghelp.net\n- Issues: https://github.com/REGHELPNET/reghelp_client/issues\n\n---\n\n## \ud83c\udf10 Environment variables / \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| `REGHELP_API_KEY` | Your personal API key | `demo_123abc` |\n| `REGHELP_BASE_URL` | Override base URL if you host a private mirror | `https://api.reghelp.net` |\n| `REGHELP_TIMEOUT` | Default request timeout in seconds | `30` |\n| `REGHELP_MAX_RETRIES` | Max automatic retries on network errors | `3` |\n\n> \ud83d\udca1 *Tip:* you can create a `.env` file and load it with [python-dotenv](https://github.com/theskumar/python-dotenv).\n\n---\n\n## \ud83e\uddea Testing / \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\n\n```bash\n# clone repo and install dev extras\ngit clone https://github.com/REGHELPNET/reghelp_client.git\ncd reghelp_client\npip install -e \".[dev]\"\n\n# unit tests + coverage\npytest -v --cov=reghelp_client --cov-report=term-missing\n```\n\nAdditional commands:\n\n* **Formatting** \u2013 `black reghelp_client/ tests/`\n* **Linting** \u2013 `ruff check reghelp_client/ tests/ examples/`\n* **Type checking** \u2013 `mypy reghelp_client/`\n\n---\n\n## \ud83d\udee0\ufe0f Contributing / \u0412\u043a\u043b\u0430\u0434\n\n1. Fork the repository and create your branch: `git checkout -b feat/my-feature`  \n2. Install dev dependencies: `pip install -e \".[dev]\"`  \n3. Run `pre-commit install` to enable hooks.  \n4. Ensure tests & linters pass: `pytest && ruff check . && mypy .`  \n5. Submit a pull-request with a clear description of your changes.\n\nWe follow **Conventional Commits** for commit messages and the **Black** code style.\n\n---\n\n## \u2753 FAQ / \u0427\u0430\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b\n\n<details>\n<summary>How do I increase the request timeout?</summary>\n\n```python\nclient = RegHelpClient(\"api_key\", timeout=60.0)\n```\n\n</details>\n\n<details>\n<summary>Does the client support synchronous code?</summary>\n\nNo, the library is asynchronous-first. You can run it in synchronous code with `asyncio.run()`.\n\n</details>\n\n<details>\n<summary>What is the difference between `Integrity` and `SafetyNet`?</summary>\n\n`Integrity` refers to Google Play Integrity API while SafetyNet is deprecated. REGHelp supports the new Integrity API.\n\n</details>\n\n---\n\n## \ud83d\uddd2\ufe0f Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a complete release history. \n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2025 REGHelp Team  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "\u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f Python \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 REGHelp Key API",
    "version": "1.2.3",
    "project_urls": {
        "Bug Reports": "https://github.com/REGHELPNET/reghelp_client/issues",
        "Documentation": "https://docs.reghelp.net/",
        "Homepage": "https://github.com/REGHELPNET/reghelp_client",
        "Source": "https://github.com/REGHELPNET/reghelp_client"
    },
    "split_keywords": [
        "reghelp",
        " api",
        " client",
        " async",
        " push",
        " email",
        " telegram",
        " integrity",
        " recaptcha",
        " turnstile",
        " voip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b61fa92733cd151feb23268265c71d514b6fd2a914d9cfba1fc2289b347ff48f",
                "md5": "73b8f7df063a16a4036ef69f16f194d7",
                "sha256": "8395b8a9d2fd6bb000c01a961508323d5b7d04e0f50f0db194c0fb68a13b22c3"
            },
            "downloads": -1,
            "filename": "reghelp_client-1.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "73b8f7df063a16a4036ef69f16f194d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 17355,
            "upload_time": "2025-07-22T05:24:42",
            "upload_time_iso_8601": "2025-07-22T05:24:42.779277Z",
            "url": "https://files.pythonhosted.org/packages/b6/1f/a92733cd151feb23268265c71d514b6fd2a914d9cfba1fc2289b347ff48f/reghelp_client-1.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3dc3803f8ec1d026fce5c75120c41205233e7b7f2877a36c1b1fc4e7cc4f1e4a",
                "md5": "7e227fb4aa37cc7a19598298ec89f990",
                "sha256": "2f4a32e534beba89997c1d54748299603d07274fb49b5eb511e2cde467ca7a7d"
            },
            "downloads": -1,
            "filename": "reghelp_client-1.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "7e227fb4aa37cc7a19598298ec89f990",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 21781,
            "upload_time": "2025-07-22T05:24:44",
            "upload_time_iso_8601": "2025-07-22T05:24:44.016705Z",
            "url": "https://files.pythonhosted.org/packages/3d/c3/803f8ec1d026fce5c75120c41205233e7b7f2877a36c1b1fc4e7cc4f1e4a/reghelp_client-1.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-22 05:24:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "REGHELPNET",
    "github_project": "reghelp_client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "httpx",
            "specs": [
                [
                    ">=",
                    "0.27.0"
                ]
            ]
        },
        {
            "name": "pydantic",
            "specs": [
                [
                    ">=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.5.0"
                ]
            ]
        }
    ],
    "lcname": "reghelp-client"
}
        
Elapsed time: 1.63384s