REGHelp Python Client is an asynchronous Python SDK for the REGHelp Key API. Use it to integrate mobile testing and automation workflows for iOS and Android push tokens, VoIP push, Cloudflare Turnstile, reCAPTCHA Mobile, Google Play Integrity, iCloud Hide My Email, Gmail OAuth, webhooks, and task status polling.
pip install reghelp-client| API area | Supported workflows |
|---|---|
| Push Token API | APNS, FCM, Telegram iOS/Android push tokens, VoIP push tokens |
| CAPTCHA API | Cloudflare Turnstile, reCAPTCHA Mobile, challenge status polling |
| Device Attestation | Google Play Integrity tokens for Android testing flows |
| Email API | iCloud Hide My Email, Gmail OAuth, email verification code polling |
| Integration tooling | Async Python client, typed Pydantic models, retries, webhooks |
Built for QA engineers, mobile automation teams, and backend developers who need a typed async/await Python client for REGHelp services.
Русская версия ниже: асинхронный Python SDK для REGHelp Key API, push-токенов, Turnstile, reCAPTCHA Mobile, Play Integrity, iCloud HME, Gmail OAuth и webhook-интеграций.
- Features
- Installation
- Quick start
- What's new
- Environment variables
- Testing
- Contributing
- FAQ
- Changelog
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.
- Asynchronous first – full
async/awaitsupport powered byhttpx. - Type-safe – strict typing with Pydantic data models.
- Retries with exponential back-off built-in.
- Smart rate-limit handling (provider-configurable).
- Async context-manager for automatic resource management.
- Webhook support out of the box.
- Comprehensive error handling with dedicated exception classes.
⚠️ Breaking —get_integrity_token()now requires a mandatoryapp_version_code: intargument (the APKversionCodeof the target app). The Key API rejects Integrity requests without it since the 2026-05 release. The parameter is positional afternonce, so callers that already use keyword-onlyref/webhook/token_typeupgrade without other changes.- Added
IntegrityTokenType.CLASSICfor explicit Classic-flow selection (MEETS_STRONG_INTEGRITY, ~1-3s). Standard/Express remainsIntegrityTokenType.STD(MEETS_DEVICE_INTEGRITY, ~300-600ms). token_typeaccepts strings ("classic","std","standard","express", case-insensitive) and validates them client-side.IntegrityRequestPydantic model gainedapp_version_code(aliasappVersionCode) with1..2_147_483_647range validation.
- Improved GitHub and PyPI package metadata for discovery: clearer English summary, expanded keywords, and updated project links.
- Added a search-friendly README intro for Push Token API, CAPTCHA API, Play Integrity, Turnstile, reCAPTCHA Mobile, iCloud HME, Gmail OAuth, APNS, and FCM workflows.
- Synchronized
reghelp_client.__version__with the package version.
proxyparameter inget_recaptcha_mobile_token()andRecaptchaMobileRequestmodel is now optional (Noneby default). Proxy parameters are only included in the request when explicitly provided.- Added
processingstatus toTaskStatusenum — Recaptcha Mobile API returns this status while a task is being executed.
wait_for_resultnow returns task data even whenstatus="error", so your code can decide how to handle failures.- All
get_*_statusmethods return the full API payload instead of raising whenstatus="error". set_push_statustreats HTTP 200 responses with a valid balance as success, even ifstatus="error".get_turnstile_tokenaccepts newactorandscopeparameters and forwards them to the API.
- Added support for the
submittedtask status in client models. - Masked
apiKeyin debug logs. - Preserved
task_idacross 429 retries for better diagnostics. - Generalized rate-limit messaging (limits are provider-controlled).
- Updated documentation and examples (no longer read tokens from create responses).
- Improved error handling for
TASK_NOT_FOUND– when task ID is known, it returnsTaskNotFoundErrorwith the specific ID; otherwise it raises a genericRegHelpErrorinstead of the confusing "unknown" message.
- Fixed
TaskNotFoundError– now shows the real task ID instead of "unknown" when a task is not found. - Improved error handling – better reporting for status methods with correct task context.
- Increased proxy configuration limits – proxy address up to 255 characters, login up to 128, password up to 256.
- Enhanced
ProxyConfigvalidation – improved support for long domain names and credentials.
- Standard Integrity tokens – request them via
get_integrity_token(..., token_type="std"). IntegrityTokenTypeenum for type-safe token selection.- Public exports for
AppDevice,IntegrityStatusResponse,VoipStatusResponse,IntegrityTokenTypefrom the package root. get_integrity_token()switched to keyword-only parameters for new options while staying backward compatible.
pip install reghelp-clientFor development:
pip install "reghelp-client[dev]"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"Task created: {task.id}")
# Wait for result
result = await client.wait_for_result(task.id, "push")
print(f"Push token: {result.token}")
if __name__ == "__main__":
asyncio.run(main())Современная асинхронная Python библиотека для работы с REGHelp Key API. Поддерживает все сервисы: Push tokens, Email, Integrity, Turnstile, VoIP Push, Recaptcha Mobile.
- Асинхронность: Полная поддержка async/await
- Типизация: Полная типизация с Pydantic моделями
- Retry логика: Автоматические повторы с exponential backoff
- Rate limiting: Умная обработка rate limits (динамические лимиты провайдера)
- Context manager: Поддержка async context manager
- Webhook support: Поддержка webhook уведомлений
- Comprehensive error handling: Детальная обработка всех ошибок API
- Улучшены метаданные пакета для GitHub и PyPI: англоязычный summary, расширенные keywords и актуальные ссылки проекта.
- Добавлен SEO-friendly верх README для Push Token API, CAPTCHA API, Play Integrity, Turnstile, reCAPTCHA Mobile, iCloud HME, Gmail OAuth, APNS и FCM.
- Версия
reghelp_client.__version__синхронизирована с версией пакета.
- Параметр
proxyвget_recaptcha_mobile_token()и моделиRecaptchaMobileRequestстал необязательным (по умолчаниюNone). Прокси-параметры добавляются в запрос только при явной передаче. - Добавлен статус
processingв перечислениеTaskStatus— API Recaptcha Mobile возвращает этот статус в процессе выполнения задачи.
wait_for_resultвозвращает объект статуса даже приstatus="error", позволяя клиентскому коду принять решение самостоятельно.- Методы
get_*_statusбольше не выбрасывают исключение приstatus="error", а отдают полный ответ API. set_push_statusучитывает ответы с корректным балансом при HTTP 200, даже еслиstatus="error".get_turnstile_tokenподдерживает параметрыactorиscope(прокидываются в API).
- Поддержан новый статус задач
submittedвTaskStatus. - Добавлено маскирование
apiKeyв debug-логах. - Ретраи при
429сохраняютtask_idдля диагностики. - Обновлена документация, примеры и сообщения
RateLimitError.
- Улучшена обработка ошибки
TASK_NOT_FOUND.
- Увеличенные лимиты для прокси конфигурации — адрес прокси теперь может содержать до 255 символов, логин до 128 символов, а пароль до 256 символов.
- Улучшенная валидация ProxyConfig — расширенная поддержка длинных доменных имен и данных аутентификации.
- Стандартные Integrity-токены — используйте параметр
token_type="std"в методеget_integrity_token(). - Новый перечислитель IntegrityTokenType для строгой типизации.
- Экспорт
AppDevice,IntegrityStatusResponse,VoipStatusResponse,IntegrityTokenTypeиз корневого пакета. - Сигнатура
get_integrity_token()использует keyword-only параметры для новых опций, сохраняя совместимость с существующим кодом.
pip install reghelp-clientИли для разработки:
pip install reghelp-client[dev]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())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:
# Ваш код здесь
passfrom 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 |
from reghelp_client import PushStatusType
# Если токен оказался неработающим
await client.set_push_status(
task_id="task_id",
phone_number="+15551234567",
status=PushStatusType.NOSMS
)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}")import base64
from reghelp_client import AppDevice, IntegrityTokenType
# Сгенерируйте URL-safe Base64 nonce (16-500 символов)
nonce = base64.urlsafe_b64encode(b"your_nonce_data").decode()
# Classic flow — MEETS_STRONG_INTEGRITY (~1-3s).
# Передача app_version_code (APK versionCode) обязательна с 1.4.0.
integrity_task = await client.get_integrity_token(
app_name="tg",
app_device=AppDevice.ANDROID,
nonce=nonce,
app_version_code=12345, # versionCode целевого APK
)
result = await client.wait_for_result(integrity_task.id, "integrity")
print(f"Integrity token: {result.token}")
# Standard/Express flow — MEETS_DEVICE_INTEGRITY (~300-600ms).
fast_task = await client.get_integrity_token(
app_name="tg",
app_device=AppDevice.ANDROID,
nonce=nonce,
app_version_code=12345,
token_type=IntegrityTokenType.STD, # или строкой "std"
)Узнать актуальный versionCode целевого APK можно командой
aapt dump badging <apk> | grep versionCode или в Play Console.
Список поддерживаемых приложений и их cloudProjectNumber —
https://reghelp.net/en/api-docs/.
from reghelp_client import ProxyConfig, ProxyType
# Решить recaptcha без прокси (proxy необязателен)
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 = 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_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}")# Решить Cloudflare Turnstile
turnstile_task = await client.get_turnstile_token(
url="https://example.com/page",
site_key="0x4AAAA...",
action="login", # опционально
actor="test_bot", # опционально
scope="cf-turnstile", # опционально
proxy="http://proxy.example.com:8080" # опционально
)
# Ждать результат
result = await client.wait_for_result(turnstile_task.id, "turnstile")
print(f"Turnstile токен: {result.token}")# Получить 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}")# Автоматически ждать выполнения задачи
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
task = await client.get_push_token(
app_name="tgiOS",
app_device=AppDevice.IOS,
webhook="https://yourapp.com/webhook"
)
# Когда задача завершится, на указанный URL придет POST запрос
# с JSON данными аналогичными ответу get_statusfrom reghelp_client import (
RegHelpError,
RateLimitError,
UnauthorizedError,
TaskNotFoundError,
NetworkError
)
try:
task = await client.get_push_token("tgiOS", AppDevice.IOS)
except RateLimitError:
print("Превышен лимит запросов")
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}")import logging
# Включить debug логи
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("reghelp_client")import httpx
# Использовать свой HTTP клиент
custom_client = httpx.AsyncClient(
timeout=60.0,
verify=False # отключить SSL проверку (не рекомендуется)
)
client = RegHelpClient(
api_key="your_api_key",
http_client=custom_client
)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}")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}")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 для деталей.
- Документация: https://reghelp.net/api-docs
- Поддержка: support@reghelp.net
- Issues: https://github.com/REGHELPNET/reghelp_client/issues
| 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
.envfile and load it with python-dotenv.
# 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-missingAdditional commands:
- Formatting –
black reghelp_client/ tests/ - Linting –
ruff check reghelp_client/ tests/ examples/ - Type checking –
mypy reghelp_client/
- Fork the repository and create your branch:
git checkout -b feat/my-feature - Install dev dependencies:
pip install -e ".[dev]" - Run
pre-commit installto enable hooks. - Ensure tests & linters pass:
pytest && ruff check . && mypy . - Submit a pull-request with a clear description of your changes.
We follow Conventional Commits for commit messages and the Black code style.
How do I increase the request timeout?
client = RegHelpClient("api_key", timeout=60.0)Does the client support synchronous code?
No, the library is asynchronous-first. You can run it in synchronous code with asyncio.run().
What is the difference between `Integrity` and `SafetyNet`?
Integrity refers to Google Play Integrity API while SafetyNet is deprecated. REGHelp supports the new Integrity API.
See CHANGELOG.md for a complete release history.