Instant Delivery
OTPs delivered within seconds
150+ Countries
Numbers from worldwide locations
500+ Services
WhatsApp, Telegram, Instagram & more
99.9% Uptime
Enterprise-grade reliability
Quick Start
Get your first OTP in 4 simple steps
Get API Key
Sign up and copy your key
Check Balance
Verify sufficient funds
Get Number
Purchase a virtual number
Receive OTP
Poll for incoming SMS
Base URL
https://otpx.org/api/stubs/handler_api.phpCode Examples
Ready-to-use examples in popular languages
curl "https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=wa&country=22&operator=any"import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://otpx.org/api/stubs/handler_api.php"
# Get a number for WhatsApp
response = requests.get(BASE_URL, params={
"api_key": API_KEY,
"action": "getNumber",
"service": "wa",
"country": "22",
"operator": "any"
})
print(response.text) # ACCESS_NUMBER:12345:919876543210const API_KEY = "YOUR_API_KEY";
const BASE_URL = "https://otpx.org/api/stubs/handler_api.php";
// Get a number for WhatsApp
const params = new URLSearchParams({
api_key: API_KEY,
action: "getNumber",
service: "wa",
country: "22",
operator: "any"
});
const response = await fetch(`${BASE_URL}?${params}`);
const data = await response.text();
console.log(data); // ACCESS_NUMBER:12345:919876543210<?php
$api_key = "YOUR_API_KEY";
$base_url = "https://otpx.org/api/stubs/handler_api.php";
// Get a number for WhatsApp
$params = http_build_query([
"api_key" => $api_key,
"action" => "getNumber",
"service" => "wa",
"country" => "22",
"operator" => "any"
]);
$response = file_get_contents("$base_url?$params");
echo $response; // ACCESS_NUMBER:12345:919876543210API Endpoints
Complete reference for all available endpoints
Get Balance
Check your current account balance before making purchases
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getBalance | |
| api_key | string | Your API Key |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance
// Response:
ACCESS_BALANCE:150.50Get Number
Purchase a virtual phone number for SMS verification
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getNumber | |
| api_key | string | Your API Key | |
| service | string | Service code (e.g., wa for WhatsApp) | |
| country | number | Country code (e.g., 22 for India) | |
| maxPrice | number | Maximum price you will pay — providers above it are skipped | |
| providerIds | string | Only buy from these providers (server IDs), comma-separated, e.g. 1,2,3 | |
| operator | string | One specific server ID, or "any" (default) to pick the cheapest available |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=wa&country=22&maxPrice=30&providerIds=15,16
// Response:
ACCESS_NUMBER:12345:919876543210Get Status
Check SMS status and retrieve received OTP code
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getStatus | |
| api_key | string | Your API Key | |
| id | number | Activation ID from getNumber |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=12345
// Response:
STATUS_OK:123456Set Status
Update activation status - cancel, complete, or request new SMS
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | setStatus | |
| api_key | string | Your API Key | |
| id | number | Activation ID | |
| status | number | Status code: 3 (request new SMS) or 8 (cancel) |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=12345&status=8
// Response:
ACCESS_CANCELServices List
List every active service with its code and name
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getServicesList | |
| api_key | string | Your API Key |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServicesList
// Response:
{
"status": "success",
"services": [
{
"code": "wa",
"name": "WhatsApp"
},
{
"code": "tg",
"name": "Telegram"
}
]
}Countries
List active countries — use the key as the country code in getNumber / getPrices
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getCountries | |
| api_key | string | Your API Key |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountries
// Response:
{
"22": {
"id": 22,
"eng": "India"
},
"6": {
"id": 6,
"eng": "Indonesia"
}
}Get Prices
Your current price and available numbers per country and service. Both filters are optional.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getPrices | |
| api_key | string | Your API Key | |
| service | string | Service code (optional — default: all services) | |
| country | string | Country code (optional — default: all countries) |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPrices&service=wa&country=22
// Response:
{
"22": {
"wa": {
"cost": 8.8,
"count": 1250
}
}
}Get Prices V2
Every price tier for a service in a country, with the numbers available at each price. Filters are optional.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| action | string | getPricesV2 | |
| api_key | string | Your API Key | |
| service | string | Service code (optional — default: all services) | |
| country | string | Country code (optional — default: all countries) |
Example
GET https://otpx.org/api/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPricesV2&service=wa&country=22
// Response:
{
"22": {
"wa": {
"8.80": 1250,
"27.50": 300,
"29.61": 0
}
}
}Error Codes
Handle errors gracefully in your integration
| Code | Severity | Description |
|---|---|---|
| BAD_KEY | error | Invalid or missing API key |
| BAD_ACTION | error | Unknown action parameter |
| BAD_SERVICE | warning | Invalid service code |
| BAD_COUNTRY | warning | Invalid country code |
| NO_BALANCE | error | Insufficient account balance |
| NO_NUMBERS | warning | No numbers available for this service |
| WRONG_MAX_PRICE:$min | warning | No provider at or below maxPrice — $min is the lowest current price |
| NO_ACTIVATION | error | Invalid activation ID |
| ACCOUNT_BAN | critical | Account has been banned |
Reference Data
Countries, services, and operators available via API
Countries
Available country codes
Services
Supported platforms
Operators
Network operators
View complete reference data in the Interactive API Docs after logging in.
