The future of
OTP verification.
Integrate the world's most reliable virtual & long-term rental number API. One endpoint, JSON everywhere.
Every request — temp number or rental — must include your API Key in the query string.
Response shapes differ by endpoint and by action — the SMS OTP API below is a mix of plain text and JSON, not one single format. Always check what each action's example on this page actually shows before parsing.
SMS OTP API — /stubs/handler_api.php
getBalance, getNumber, getStatus and setStatus reply in plain text (a legacy colon-separated protocol) — getServers, getCountries and getServices reply in JSON. See each action below for its exact shape.
Cheap Numbers API — /stubs/cheap_handler.php
Same plain-text protocol as the SMS OTP API. getServers and getServices reply in JSON; buyNumber replies with one CSV line.
Premium API — /stubs/premium-handler.php
Same plain-text protocol as the Cheap Numbers API. getServers and getServices reply in JSON; buyNumber replies with one CSV line. The code is delivered by SMS or call.
Rental API — /stubs/rental-handler.php
SUCCESSRental, Telegram and Email OTP always reply in JSON with a status field — the SMS OTP API is the one endpoint with the mixed plain-text/JSON behaviour described above, kept for backward compatibility.
Temporary phone numbers for receiving a single SMS/OTP. Legacy colon-separated protocol — most actions reply in plain text, the listing actions reply in JSON.
Required in every request
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key from the dashboard |
| action | Required | The operation to run (see the table below) |
Actions at a glance
| Action | Extra required parameters | Reply |
|---|---|---|
| getBalance | — | Plain text |
| getServers | — | JSON |
| getCountries | — (type optional) | JSON |
| getServices | country (+ type for servers 2–7) | JSON |
| getNumber | service, country (+ type for servers 2–7) | Plain text |
| getStatus | id | Plain text |
| setStatus | id, status | Plain text |
Response format
Plain-text replies are a single line, fields separated by :. Compare the raw body against the values shown for each action. Prices and balances are in PKR. The type parameter selects the server (1–7); call getServers to see which are active.
Any error is a plain-text code — see Error Codes. An unknown action returns an empty body.
Typical flow
getCountries → getServices → getNumber → poll getStatus until STATUS_OK → setStatus (status=6 to finish, or 8 to cancel and refund).
Your wallet balance in PKR. Replies in plain text.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getBalance |
Responses
Lists every server type (1–7) and whether it is currently active. Check this before assuming a given type has countries/services behind it.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getServers';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getServers"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getServers |
Responses
Countries available for each server type, keyed by type. Use a returned id as country in Get Services and Get Number.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getCountries&type=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getCountries", "type": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getCountries |
| type | Optional | 1–7. Omit to get every server type at once |
Responses
Services and prices for a country on a given server. Returns an object keyed by service id; each value is "Name - price PKR".
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getServices&country=COUNTRY_ID&type=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getServices", "country": "COUNTRY_ID", "type": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getServices |
| country | Required | Country id from Get Countries |
| type | Optional | 1–7, default 1. Must match the server the country came from |
Responses
Orders a phone number. The price is deducted from your wallet. Replies in plain text: ACCESS_NUMBER:order_id:phone:price on success, or an error code.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getNumber&service=SERVICE_ID&country=COUNTRY_ID&type=1';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getNumber", "service": "SERVICE_ID", "country": "COUNTRY_ID", "type": "1"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getNumber |
| service | Required | Service id from Get Services |
| country | Required | Country id from Get Countries |
| type | Optional | 1–7, default 1. Must match the server used for Get Countries / Get Services |
Responses
Checks whether the SMS for an order has arrived. Poll every few seconds. Replies in plain text.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getStatus&id=ORDER_ID';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getStatus", "id": "ORDER_ID"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getStatus |
| id | Required | Order id from getNumber (the first value after ACCESS_NUMBER:) |
Responses
Finish an order after the SMS arrived, or cancel it for a refund. Replies in plain text.
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=setStatus&id=ORDER_ID&status=8';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "setStatus", "id": "ORDER_ID", "status": "8"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | setStatus |
| id | Required | Order id from getNumber |
| status | Required | 3 or 6 = complete (only once an SMS was received) · 8 = cancel and refund (allowed 2 minutes after purchase) |
Responses
Long-term numbers you keep for days or months, instead of a single OTP. A separate endpoint from the SMS OTP API — same api_key, different base URL and a JSON response shape.
Required in every request
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key from the dashboard |
| action | Required | The operation to run (see the table below) |
Actions at a glance
| Action | Extra required parameters | Returns |
|---|---|---|
| getRentalCountries | — (provider optional) | Countries |
| getRentalPricing | country_code, provider | Durations + prices |
| getAvailableRentals | country_code, provider | Live stock |
| rentNumber | country_code, provider, duration_hours | Rented number |
| getMyRentals | — | Your rentals |
| getRentalSMS | order_id | Messages on a rental |
| renewRental | rental_id, duration_hours | New expiry |
| cancelRental | rental_id | Refund (Server 2, 20 min) |
Providers and durations
provider is 1 (Server 1) or 2 (Server 2). Valid duration_hours: 12, 24, 168, 720, 4320, 8640. Server 2 supports only the monthly durations 720, 4320 and 8640. Prices and balances are in PKR.
Response format
Every response is JSON. The HTTP status is always 200 — check the status field in the body (a string).
Errors: see Error Codes.
Typical flow
getRentalCountries → getRentalPricing → rentNumber → getRentalSMS → renewRental or cancelRental.
Countries available for rentals.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getRentalCountries';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getRentalCountries"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getRentalCountries |
| provider | Optional | 1 or 2. Omit to list both servers |
Responses
Available durations and prices for one country on one server.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getRentalPricing&country_code=ca&provider=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getRentalPricing", "country_code": "ca", "provider": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getRentalPricing |
| country_code | Required | country_code from Get Rental Countries (e.g. ca) |
| provider | Required | 1 or 2 |
Responses
Live stock for a country on one server.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getAvailableRentals&country_code=ca&provider=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getAvailableRentals", "country_code": "ca", "provider": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getAvailableRentals |
| country_code | Required | Country code, e.g. ca |
| provider | Required | 1 or 2 |
Responses
Rents a number for the chosen duration. The price is deducted from your wallet immediately.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=rentNumber&country_code=ca&provider=1&duration_hours=720';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "rentNumber", "country_code": "ca", "provider": "1", "duration_hours": "720"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | rentNumber |
| country_code | Required | Country code from Get Rental Countries |
| provider | Required | 1 or 2 |
| duration_hours | Required | One of 12, 24, 168, 720, 4320, 8640. Server 2: only 720, 4320, 8640 |
Responses
All rentals on your account.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getMyRentals';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getMyRentals"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getMyRentals |
Responses
Messages received on a rented number.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getRentalSMS&order_id=ord_8f3a91';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getRentalSMS", "order_id": "ord_8f3a91"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getRentalSMS |
| order_id | Required | order_id from Rent Number / Get My Rentals |
Responses
Extends an existing rental. The price is deducted from your wallet.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=renewRental&rental_id=12&duration_hours=720';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "renewRental", "rental_id": "12", "duration_hours": "720"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | renewRental |
| rental_id | Required | id from Get My Rentals |
| duration_hours | Required | One of 12, 24, 168, 720, 4320, 8640. Server 2: only 720, 4320, 8640. duration is accepted as an alias |
Responses
Cancels a rental and refunds your wallet. Server 2 only, within 20 minutes of purchase, and only if no SMS has been received.
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=cancelRental&rental_id=12';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "cancelRental", "rental_id": "12"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | cancelRental |
| rental_id | Required | id from Get My Rentals |
Responses
Low-price temporary numbers for a single OTP. Each server is a fixed number range at a fixed price — you pick a server and buy, there is no country/service choice. A separate endpoint from the SMS OTP API, but the same plain-text protocol and the same api_key.
Required in every request
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key from the dashboard |
| action | Required | The operation to run (see the table below) |
Actions at a glance
| Action | Extra required parameters | Reply |
|---|---|---|
| getBalance | — | Plain text |
| getServers | — (type optional) | JSON |
| getServices | server (+ type for type 2) | JSON |
| buyNumber | server (+ type for type 2) | Plain text (CSV) |
| getStatus | id | Plain text |
| setStatus | id, status | Plain text |
Validity and refunds
A bought number is held for 20 minutes (1200 seconds). Cancel with setStatus status=8 before a code arrives for a full refund. If no code arrives, the order expires and is refunded automatically the next time you call getStatus on it. Once a code has been received there is no refund. Prices and balances are in PKR.
Response format
getServers and getServices reply in JSON; every other action replies in plain text. buyNumber returns one CSV line: order_id,number,validity_seconds. Any error is a plain-text code — see Error Codes.
Typical flow
getServers → buyNumber → poll getStatus until STATUS_OK → setStatus (status=3 to finish, or 8 to cancel and refund).
Your wallet balance in PKR. Replies in plain text.
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getBalance |
Responses
Lists the servers you can buy from, with their price. Use a returned id as server in Get Services and Buy Number. Servers are grouped by type.
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getServers';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getServers"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getServers |
| type | Optional | 1 or 2. Omit to list both groups |
Responses
The name and price of one server. Returns an object keyed by the server id; the value is "Name - price".
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getServices&server=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getServices", "server": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getServices |
| server | Required | Server id from Get Servers |
| type | Optional | 1 (default) or 2 — the key the server is listed under in Get Servers |
Responses
Buys a number on a server. The price is deducted from your wallet immediately and the number is held for 20 minutes. Replies in plain text: order_id,number,validity_seconds.
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=buyNumber&server=1';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "buyNumber", "server": "1"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | buyNumber |
| server | Required | Server id from Get Servers |
| type | Optional | 1 (default) or 2 — the key the server is listed under in Get Servers |
Responses
Checks whether the code for an order has arrived. Poll every few seconds. Replies in plain text.
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getStatus&id=ORDER_ID';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getStatus", "id": "ORDER_ID"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getStatus |
| id | Required | order_id from Buy Number (the first value of the CSV reply) |
Responses
Finish an order after the code arrived, or cancel it for a full refund. Replies in plain text.
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=setStatus&id=ORDER_ID&status=8';
echo file_get_contents($url); // plain text
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "setStatus", "id": "ORDER_ID", "status": "8"}
print(requests.get(url, params=params).text) # plain text
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | setStatus |
| id | Required | order_id from Buy Number |
| status | Required | 8 = cancel and refund (only before a code arrived) · 3 or 6 = finish (only after a code arrived) |
Responses
Temporary email addresses for OTP verification. A separate endpoint from SMS OTP and Rental — same api_key, own base URL and response shape.
Required in every request
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key from the dashboard |
| action | Required | The operation to run (see the table below) |
| server | Optional | 1 (default) or 2 — used by Get Services, Buy Email and Get Domains. Actions on an existing order detect the server from email_id |
Server flows
| Server | Flow |
|---|---|
| 1 | Service-based — e.g. Instagram/Telegram codes on any in-stock domain (gmail.com, icloud.com, mailnestpro.com, hihinail.com, flytempbox.com, mailburstx.com, others). Buy with service_id + domain. |
| 2 | Domain-based — e.g. gmail.com, mail.com, gmx.com. Buy with domain + site. Supports reorderEmail for a fresh code on the same mailbox. |
Actions at a glance
| Action | Server | Extra required parameters | Returns |
|---|---|---|---|
| getBalance | Both | — | Wallet balance |
| getEmailDomains | 1 | — | Domains with stock |
| getEmailServices | 1 / 2 | — | S1: services on a domain · S2: domains for a site |
| buyEmail | 1 / 2 | S1: service_id · S2: domain | Email address + email_id |
| getEmailCode | Auto | email_id | Verification code |
| cancelEmail | Auto | email_id | Cancel + refund |
| reorderEmail | 2 | email_id | Fresh code on same mailbox |
| getEmailHistory | Both | — | Past orders (paginated) |
Response format
Every response is JSON. The HTTP status is always 200 — check the status field in the body (it is a string). Prices and balances are in PKR.
200 success · 202 still waiting · 300 cancelled · anything else is an error — see Error Codes.
Typical flow
getEmailDomains → getEmailServices → buyEmail → poll getEmailCode until 200 (or cancelEmail to refund).
Returns your current wallet balance. Works even if the email service is switched off.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getBalance';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getBalance |
Responses
Server 1 only. Lists every email domain that currently has stock (gmail.com, icloud.com, mailnestpro.com, hihinail.com, flytempbox.com, mailburstx.com, others). Use a returned domain value in Get Services and Buy Email.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailDomains&server=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailDomains", "server": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getEmailDomains |
| server | Optional | 1 (default). 2 is rejected — Server 2 lists domains through Get Services |
| all | Optional | Send 1 to include domains with zero stock |
Responses
Server 1: services (Instagram, Telegram, …) available on a domain, with price and stock. Server 2: domains available for a site, with price and stock. Prices are in PKR.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailServices&server=1&domain=gmail.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailServices", "server": "1", "domain": "gmail.com"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Server 1 | Server 2 | Description |
|---|---|---|---|
| api_key | Required | Required | Your API key |
| action | Required | Required | getEmailServices |
| server | Optional | Required | 1 (default) or 2 |
| domain | Optional | Not used | Server 1: a domain from Get Email Domains. Default gmail.com. Invalid value returns 400 |
| site | Not used | Optional | Server 2: website you are registering on. Default telegram.com |
Responses
Purchases a temporary email address. The price is deducted from your wallet immediately. If no code arrives, cancel the order to get a refund.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=buyEmail&server=1&service_id=ig&domain=gmail.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "buyEmail", "server": "1", "service_id": "ig", "domain": "gmail.com"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Server 1 | Server 2 | Description |
|---|---|---|---|
| api_key | Required | Required | Your API key |
| action | Required | Required | buyEmail |
| server | Optional | Required | 1 (default) or 2 |
| service_id | Required | Not used | Server 1: service_code from Get Email Services (e.g. ig, tg, fb) |
| domain | Optional | Required | Server 1: default gmail.com, must be a valid domain. Server 2: a domain from Get Email Services |
| site | Not used | Optional | Server 2: website you are registering on. Default telegram.com |
Responses
Poll every 5–10 seconds after buying until the verification code arrives. The server is detected automatically from the email_id, so server is not needed.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailCode&email_id=7291834';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailCode", "email_id": "7291834"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getEmailCode |
| email_id | Required | email_id returned by Buy Email |
Responses
Cancels an activation and refunds your wallet. If the code has already arrived, the order is completed instead and nothing is refunded.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=cancelEmail&email_id=7291834';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "cancelEmail", "email_id": "7291834"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | cancelEmail |
| email_id | Required | email_id returned by Buy Email |
Responses
Requests a fresh code on the same mailbox. The order stays open and returns to “waiting”, so you can poll getEmailCode again. Works only for orders bought on Server 2 and not cancelled. The server is detected from the email_id.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=reorderEmail&email_id=7291834';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "reorderEmail", "email_id": "7291834"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | reorderEmail |
| email_id | Required | email_id of a Server 2 order |
Responses
Your past email purchases, newest first. 20 per page.
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailHistory&page=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailHistory", "page": "1"}
print(requests.get(url, params=params).json())
Request Parameters
| Parameter | Required | Description |
|---|---|---|
| api_key | Required | Your API key |
| action | Required | getEmailHistory |
| page | Optional | Page number, default 1 |
Responses
active = waiting for code · received = code delivered · cancelled = cancelled / refundedError Codes
SMS OTP API — /stubs/handler_api.php
Returned as literal plain text (not JSON) by getBalance, getNumber, getStatus and setStatus — compare the raw response body directly against the values below. Auth errors also apply to the JSON actions.
| Code | Description |
|---|---|
| BAD_KEY | Missing or invalid API key. |
| ACCOUNT_BLOCKED | This account is suspended. |
| BAD_COUNTRY / BAD_SERVICE / BAD_TYPE / BAD_ID / BAD_STATUS | A required parameter is missing, invalid, or has no matching record. |
| NO_BALANCE | Insufficient wallet balance for this purchase. |
| NO_BALANCE_FOR_NEW_PRICE:<price> | getNumber only — the live price rose above your balance. The number was released and nothing was charged; top up to at least <price> and try again. |
| NO_NUMBERS | No numbers currently available for that country/service. |
| NO_ACTIVATION | No activation found for this id on this account. |
| EARLY_CANCEL_DENIED | Numbers can only be cancelled 2 minutes after purchase. |
| NO_SMS_RECEIVED | Cannot finish the order — no SMS/code received yet. |
| STATUS_ALREADY_CHANGED | This activation was already finalized (finished or cancelled). |
| ERROR_PROVIDER_1-7:<detail> | The server for that type returned an error — the text after the colon is the detail. Nothing is charged. |
Rental API — /stubs/rental-handler.php
| status | Example message | When it happens |
|---|---|---|
| 401 | Invalid API key. / API key is required. | Missing or invalid api_key |
| 403 | Account is blocked or inactive. | Account suspended |
| 400 | country_code is required. / provider is required. Use 1 or 2. / Cancel window expired… | Missing or invalid parameter, invalid duration for the server, or cancelRental outside the 20-minute window / on a Server 1 rental / after an SMS arrived |
| 402 | Insufficient balance. | Wallet balance too low |
| 404 | No pricing found… / Rental not found… / Order not found or access denied. | No pricing for that country/duration, or wrong rental_id / order_id |
| 502 | Server 1 error: … / Server 2 error: … | Upstream error — see message. Nothing is charged |
| 503 | Server 1 is currently unavailable/disabled. | Server switched off in admin settings |
| 500 | Database error: … | DB transaction failed — balance not deducted |
Cheap Numbers API — /stubs/cheap_handler.php
Returned as literal plain text (not JSON).
| Code | Description |
|---|---|
| BAD_KEY | Missing or invalid API key. |
| ACCOUNT_BLOCKED | This account is suspended. |
| BAD_ACTION | Unknown or missing action. |
| BAD_SERVER | server is missing, or that server does not exist / is inactive. |
| NO_SERVERS | getServers: no server is currently available. |
| NO_SERVICES | getServices: the server was not found or is inactive. |
| LOW_BALANCE | Insufficient wallet balance for this purchase. Nothing is charged. |
| NO_NUMBERS | No number could be allocated right now. Nothing is charged — try again shortly. |
| DATABASE_ERROR | The order could not be saved. The charge is reversed. |
| BAD_ID | id is missing. |
| NO_ACTIVATION | No order found for this id on this account. |
| BAD_STATUS | status is not 3, 6 or 8, or you tried to cancel an order that already received a code. |
| NO_SMS_RECEIVED | Cannot finish the order — no code received yet. |
| STATUS_CANCEL | getStatus: the order expired (refunded), was cancelled or was completed without a code — stop polling. |
Premium API — /stubs/premium-handler.php
Returned as literal plain text (not JSON).
| Code | Description |
|---|---|
| BAD_KEY | Missing or invalid API key. |
| ACCOUNT_BLOCKED | This account is suspended. |
| BAD_ACTION | Unknown or missing action. |
| BAD_SERVER | server is missing, or that country does not exist / is inactive. |
| BAD_SERVICE | service is missing, or not available for that country. |
| NO_SERVERS | getServers: no country is currently available. |
| NO_SERVICES | getServices: no services found for that country. |
| LOW_BALANCE | Insufficient wallet balance for this purchase. Nothing is charged. |
| NO_NUMBERS | No number could be allocated right now. Nothing is charged — try again shortly. |
| PROVIDER_NOT_CONFIGURED | Premium is not set up or is currently disabled. |
| DATABASE_ERROR | The order could not be saved. The charge is reversed. |
| BAD_ID | id is missing. |
| NO_ACTIVATION | No order found for this id on this account. |
| BAD_STATUS | status is not 3, 6 or 8, or you tried to cancel an order that already received a code. |
| NO_SMS_RECEIVED | Cannot finish the order — no code received yet. |
| STATUS_CANCEL | getStatus: the order expired (refunded) or was closed without a code — stop polling. |
Email OTP API — /stubs/email-handler.php
| status | When it happens | Example message |
|---|---|---|
| 200 | Success (all actions) | {"status":"200", ...} |
| 202 | getEmailCode: no code yet — keep polling | Waiting for code... |
| 300 | Activation was cancelled (by you or automatically). Any charge is refunded | Activation was cancelled |
| 400 | Missing/unknown action, a required parameter is missing (service_id, domain, email_id), invalid Server 1 domain, or the action is not allowed for that order | Invalid domain. Use action=getEmailDomains for the list |
| 401 | Invalid or missing api_key | BAD_KEY |
| 402 | Wallet balance too low for the purchase | Low balance. Need: 120 PKR — Have: 45.5 PKR |
| 403 | Account suspended | ACCOUNT_BLOCKED |
| 404 | Service/domain not available, no stock, or email_id not found | Email activation not found |
| 500 | Upstream connection error or database error — nothing is charged when a purchase fails | Database error. Try again. |
| 503 | Email service disabled or not configured | Server 1 email service is disabled |