How to Integrate REGHelp API: Step-by-Step
This tutorial walks you through integrating REGHelp API into your application, from getting an API key to handling responses in production.
Step 1: Get Your API Key
- Sign up for a REGHelp account
- Navigate to your profile page
- Copy your API key from the dashboard
- Add funds to your balance
Step 2: Make Your First Request
All API requests use GET with the apiKey as a query parameter:
curl "https://api.reghelp.net/push/getToken?apiKey=YOUR_KEY&appName=tgiOS&appDevice=iOS"
Step 3: Handle Responses
Task creation (*/getToken) response:
{
"id": "664462c0f45c5b1b760b7c3e",
"service": "tg",
"product": "push",
"price": 0.75,
"balance": 122.50,
"status": "success"
}
Status polling (*/getStatus) response:
{
"id": "664462c0f45c5b1b760b7c3e",
"status": "done",
"token": "1673463060517848736:APA91b...",
"message": "OK"
}
Status values:
done— task completed successfullywait/pending— task is being processederror— task failed (checkmessagefield)
Step 4: Implement Error Handling
import asyncio
from reghelp_client import RegHelpClient, AppDevice
async def get_push_token():
async with RegHelpClient("YOUR_API_KEY") as client:
# Create task
task = await client.get_push_token("tgiOS", AppDevice.IOS)
# Wait for result (auto-polls getStatus)
result = await client.wait_for_result(task.id, "push")
print(result.token)
asyncio.run(get_push_token())
Or with raw HTTP:
import httpx
async def create_push_token(api_key: str, app_name: str, app_device: str):
async with httpx.AsyncClient() as client:
# Step 1: Create task
resp = await client.get(
"https://api.reghelp.net/push/getToken",
params={"apiKey": api_key, "appName": app_name, "appDevice": app_device},
timeout=30.0,
)
data = resp.json()
if data["status"] != "success":
raise Exception(f"API error: {data.get('detail', 'unknown')}")
task_id = data["id"]
# Step 2: Poll for result
for _ in range(60):
resp = await client.get(
"https://api.reghelp.net/push/getStatus",
params={"apiKey": api_key, "id": task_id},
timeout=10.0,
)
result = resp.json()
if result["status"] == "done":
return result["token"]
if result["status"] == "error":
raise Exception(f"Task failed: {result.get('message')}")
await asyncio.sleep(3)
Step 5: Set Up Webhooks (Optional)
Add the webHook parameter to any getToken request to receive results via POST callback:
GET https://api.reghelp.net/push/getToken?apiKey=YOUR_KEY&appName=tgiOS&appDevice=iOS&webHook=https%3A%2F%2Fyour-server.com%2Fwebhook
When the task completes, REGHelp sends a POST to your webhook URL with the same payload as getStatus.
Rate Limits
- Rate limit per API key / IP pair (HTTP 429 on exceed)
- Use exponential backoff for retries
SDKs and Libraries
Official Python client library:
pip install reghelp_client
