Developer Portal v1.0
The future of
OTP verification.
Integrate the world's most reliable virtual number API. One endpoint, four providers, 200+ countries.
http://otpget.com/stubs/handler_api.php
Authentication
All requests must include your API Key in the query string.
?api_key=YOUR_API_KEY
1. Get Balance
Check your account balance in PKR by entering this URL in your browser.
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getBalance"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).text)
2. Get Countries
List all available countries. You can filter by provider type (1, 2, 3, or 4).
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountries&type=1
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getCountries&type=1';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getCountries&type=1';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getCountries&type=1"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getCountries", "type": "1"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getCountries", "type": "1"}
print(requests.get(url, params=params).text)
JSON RESPONSE
{
"1": [{"id": "1", "name": "Russia"}, ...],
"2": [{"id": "1", "name": "USA"}, ...],
...
}
"1": [{"id": "1", "name": "Russia"}, ...],
"2": [{"id": "1", "name": "USA"}, ...],
...
}
3. Get Services
Get available services for a specific country and provider.
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=1&type=1
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getServices&country=1&type=1';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getServices&country=1&type=1';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getServices&country=1&type=1"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getServices", "country": "1", "type": "1"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getServices", "country": "1", "type": "1"}
print(requests.get(url, params=params).text)
JSON RESPONSE
{
"tg": "Telegram - 45 PKR",
"wa": "WhatsApp - 60 PKR"
}
"tg": "Telegram - 45 PKR",
"wa": "WhatsApp - 60 PKR"
}
4. Request Number
Order a new phone number to receive SMS. This will deduct PKR from your balance.
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=$SERVICE_ID&country=$COUNTRY_ID&type=$PROVIDER_ID
| Parameter | Type | Description |
|---|---|---|
| service | string | e.g., '1', '2' |
| country | int | Country ID from list |
| type | int | Provider (1-4) |
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getNumber&service=$SERVICE_ID&country=$COUNTRY_ID&type=$PROVIDER_ID';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getNumber&service=$SERVICE_ID&country=$COUNTRY_ID&type=$PROVIDER_ID';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getNumber&service=$SERVICE_ID&country=$COUNTRY_ID&type=$PROVIDER_ID"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getNumber", "service": "1", "country": "1", "type": "1"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getNumber", "service": "1", "country": "1", "type": "1"}
print(requests.get(url, params=params).text)
SUCCESS
ACCESS_NUMBER:$order_id:$phone
5. Get Activation Status
Check if an SMS has been received for an order ID.
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=YOUR_ORDER_ID
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getStatus&id=YOUR_ORDER_ID';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getStatus&id=YOUR_ORDER_ID';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getStatus&id=YOUR_ORDER_ID"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getStatus", "id": "YOUR_ORDER_ID"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getStatus", "id": "YOUR_ORDER_ID"}
print(requests.get(url, params=params).text)
WAITING
STATUS_WAIT_CODE
RECEIVED
STATUS_OK:$code
6. Set Activation Status
Cancel an activation for a refund or complete a successful one.
http://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=YOUR_ORDER_ID&status=8
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=setStatus&id=YOUR_ORDER_ID&status=8';
echo file_get_contents($url);
$url = 'http://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=setStatus&id=YOUR_ORDER_ID&status=8';
echo file_get_contents($url);
curl "http://otpget.com/stubs/handler_api.php?api_key=YOUR_KEY&action=setStatus&id=YOUR_ORDER_ID&status=8"
import requests
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "setStatus", "id": "YOUR_ORDER_ID", "status": "8"}
print(requests.get(url, params=params).text)
url = "http://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "setStatus", "id": "YOUR_ORDER_ID", "status": "8"}
print(requests.get(url, params=params).text)
| Status Code | Meaning |
|---|---|
| 3 | Request another SMS (Retry) |
| 6 | Complete Activation (Success) |
| 8 | Cancel and Refund (Only if no SMS received) |
Error Codes
| Code | Description |
|---|---|
| BAD_KEY | Invalid or expired API key. |
| NO_BALANCE | Insufficient account wallet funds. |
| NO_NUMBERS | Selected service/country currently out of stock. |
| BAD_ACTION | The requested action is not recognized. |