OTPGet API Docs –
SMS OTP, Cheap Numbers, Rental & Email
Buy virtual phone numbers for OTP verification, get cheap bulk SMS numbers for quick turnaround, rent long-term SMS numbers across 200+ countries, and get temporary Gmail addresses — all via one simple REST API.
Get temporary phone numbers in seconds for immediate SMS verification. Perfect for bulk verification, testing, or quick OTP needs. Numbers stay active for 15 minutes.
Base URL: https://www.otpget.com/stubs/cheap_handler.php
| # | Action | Required Params | Description |
|---|---|---|---|
| 1 | getBalance | — | Get wallet balance |
| 2 | getServers | type | List servers (type=1 for Server 1, type=2 for Server 2) |
| 3 | buyNumber | server, type | Buy a cheap number — returns ORDER_ID,NUMBER,SECS_LEFT |
| 4 | getStatus | id | Check for received OTP (poll every 5 seconds) |
| 5 | setStatus | id, status | Cancel (status=8, refund) or finish (status=3) |
type=1 = Server 1 (Server1) | type=2 = Server 2 (Server2)
List available cheap number servers. Use type parameter to filter (1 or 2).
$servers = json_decode(file_get_contents($url), true);
foreach($servers['1'] as $server) {
echo $server['name'] . ' (ID: ' . $server['id'] . ')' . PHP_EOL;
}
url = "https://www.otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_API_KEY", "action": "getServers", "type": "1"}
servers = requests.get(url, params=params).json()
for server in servers['1']:
print(server['name'])
"1": [
{"id": "1", "name": "Pakistan Server 1"},
{"id": "2", "name": "Pakistan Server 2"}
],
"2": [
{"id": "3", "name": "India Server"}
]
}
Instantly purchase a cheap number. Balance is deducted immediately. Number stays valid for 15 minutes.
$response = file_get_contents($url);
list($order_id, $number, $expires) = explode(',', $response);
echo "Order: $order_id | Number: $number | Expires in: $expires seconds";
url = "https://www.otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_API_KEY", "action": "buyNumber", "server": "1", "type": "1"}
response = requests.get(url, params=params).text
order_id, number, expires = response.split(',')
print(f"Number: {number}, Expires: {expires}s")
ORDER_ID_12345,+923001234567,900
Format: order_id,phone_number,seconds_until_expiry
Poll this endpoint every 5–10 seconds after buying a number to check if the OTP has arrived.
for($i = 0; $i < 30; $i++) { // Poll for 2.5 minutes max
$response = file_get_contents($url);
if(strpos($response, 'STATUS_OK:') === 0) {
$otp = substr($response, 10);
echo "OTP: $otp";
break;
}
sleep(5);
}
url = "https://www.otpget.com/stubs/cheap_handler.php"
for _ in range(30): # poll for 2.5 minutes
response = requests.get(url, params={"api_key": "YOUR_API_KEY", "action": "getStatus", "id": "ORDER_ID"}).text
if 'STATUS_OK:' in response:
otp = response.split(':')[1]
print(f'OTP: {otp}')
break
time.sleep(5)
STATUS_OK:847293
STATUS_WAIT_CODE
Mark an order as complete or cancel it for a refund.
| Status | Meaning |
|---|---|
| 3 or 6 | Finish (OTP must already be received) |
| 8 | Cancel & Refund (only if no OTP received yet) |
echo file_get_contents($url); // ACCESS_FINISH or error
url = "https://www.otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_API_KEY", "action": "setStatus", "id": "ORDER_ID", "status": "3"}
print(requests.get(url, params=params).text) # ACCESS_FINISH
Full documentation for SMS OTP API, Rental API, and Email OTP API continues below...
Reference the complete docs.php file for all 17 endpoints