Free Numbers Live Prices Top Services Pricing Reviews Feedback Terms & Policy API Docs Blog About
Log in Get Started
Developer Portal v2.0

The future of
OTP verification.

Integrate the world's most reliable virtual & long-term rental number API. One endpoint, JSON everywhere.

https://otpget.com/stubs/handler_api.php
Quick Start — switch with two changes

The API works exactly like the one your users are already used to: same parameters, same actions, same reply formats. If you are moving an existing integration (or your own panel / bot) to OtpGet, you only change two things — nothing else in your code.

  1. Base URL — point your requests to the URL of the service you use (table below).
  2. API key — use your OtpGet API key in api_key. View it in your dashboard under API Tool or Profile (you verify first with an emailed code or your password).
  3. Test first (optional) — put your Sandbox key in api_key instead. Same URL, fake numbers, no money. Swap to the real key when you go live. See Sandbox.

Base URLs

ServiceBase URL
Temp numbers (SMS OTP)https://otpget.com/stubs/handler_api.php
Rentalshttps://otpget.com/stubs/rental-handler.php
Cheap numbershttps://otpget.com/stubs/cheap_handler.php
Premium (SMS & Call)https://otpget.com/stubs/premium-handler.php
Email OTPhttps://otpget.com/stubs/email-handler.php

Requirement: the account that owns the API key must have a verified email and a phone number. Otherwise every call is refused with ACCOUNT_NOT_VERIFIED — finish it once at Complete your account.

Platforms — use the API from iOS, Android, web, POS or a bot

The API is plain REST over HTTPS with simple GET endpoints, so any system that can make a web request can use it — no SDK required. One API key works everywhere.

PlatformHow to call the API
iOS app (Swift)URLSession — see the Swift example below.
Android app (Kotlin/Java)OkHttp or HttpURLConnection — see the Kotlin example below.
WebsiteYour backend, or the browser with fetch — see the JavaScript example below.
POS systemAny terminal or till app that can make an HTTPS request; same endpoints as everywhere else.
Telegram botCall the same endpoints from your bot code; set your own prices and sell numbers to your users.

Prefer push over polling? Set up a webhook and every received SMS is POSTed to your server the moment it arrives. Test first with a sandbox key — same URL, fake numbers, no money.

Swift (iOS) — order a number, poll for the code

let api = "https://otpget.com/stubs/handler_api.php" let key = "YOUR_API_KEY" func get(_ params: [String: String]) async throws -> String { var c = URLComponents(string: api)! c.queryItems = params.map { URLQueryItem(name: $0.key, value: $0.value) } let (data, _) = try await URLSession.shared.data(from: c.url!) return String(decoding: data, as: UTF8.self) } // 1. Order a number -> ACCESS_NUMBER:order_id:phone:price let order = try await get(["api_key": key, "action": "getNumber", "service": "SERVICE_ID", "country": "COUNTRY_ID", "type": "1"]) let parts = order.split(separator: ":") let orderId = String(parts[1]) // 2. Poll for the code -> STATUS_WAIT_CODE or STATUS_OK:123456 while true { let s = try await get(["api_key": key, "action": "getStatus", "id": orderId]) if s.hasPrefix("STATUS_OK") { print("Code:", s.split(separator: ":")[1]); break } try await Task.sleep(nanoseconds: 3_000_000_000) }

Kotlin (Android) — order a number, poll for the code

val api = "https://otpget.com/stubs/handler_api.php" val key = "YOUR_API_KEY" // Run network calls off the main thread (e.g. in a coroutine). fun get(params: Map<String, String>): String { val q = params.entries.joinToString("&") { it.key + "=" + URLEncoder.encode(it.value, "UTF-8") } return URL("$api?$q").readText() // HttpURLConnection; OkHttp works the same way } // 1. Order a number -> ACCESS_NUMBER:order_id:phone:price val order = get(mapOf("api_key" to key, "action" to "getNumber", "service" to "SERVICE_ID", "country" to "COUNTRY_ID", "type" to "1")) val orderId = order.split(":")[1] // 2. Poll for the code -> STATUS_WAIT_CODE or STATUS_OK:123456 while (true) { val s = get(mapOf("api_key" to key, "action" to "getStatus", "id" to orderId)) if (s.startsWith("STATUS_OK")) { println("Code: " + s.split(":")[1]); break } Thread.sleep(3000) }

JavaScript (web / POS) — order a number, poll for the code

const API = "https://otpget.com/stubs/handler_api.php"; const KEY = "YOUR_API_KEY"; const q = (p) => API + "?" + new URLSearchParams({ api_key: KEY, ...p }); // 1. Order a number -> ACCESS_NUMBER:order_id:phone:price const order = await (await fetch(q({ action: "getNumber", service: "SERVICE_ID", country: "COUNTRY_ID", type: 1 }))).text(); const [, orderId, phone] = order.split(":"); // 2. Poll for the code -> STATUS_WAIT_CODE or STATUS_OK:123456 for (;;) { const s = await (await fetch(q({ action: "getStatus", id: orderId }))).text(); if (s.startsWith("STATUS_OK")) { console.log("Code:", s.split(":")[1]); break; } await new Promise(r => setTimeout(r, 3000)); }
Authentication

Every request — temp number or rental — must include your API Key in the query string.

?api_key=YOUR_API_KEY
Response Format

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.

PLAIN TEXT (getBalance)
ACCESS_BALANCE:125.00
JSON (getServices)
{ "12": "Telegram - 45.00 PKR", "13": "WhatsApp - 60.00 PKR" }
ERROR
BAD_KEY

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.

PLAIN TEXT (buyNumber)
ORD_6830abc123_741,224611780001,1200

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.

PLAIN TEXT (buyNumber)
a1b2c3d4e5,923001234567,1200

Rental API — /stubs/rental-handler.php

SUCCESS
{ "status": "200", ...action-specific fields }
ERROR
{ "status": "402", "message": "Insufficient balance." }

Rental 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.

Currency (optional)

All prices and balances are in PKR by default. Add the optional currency parameter to any request to receive amounts converted into another currency. The rates are the same ones used by the OTPGet website currency converter. Use Get Currencies to see the supported codes.

&currency=USD

How it works

CaseBehaviour
currency missing / empty / PKRNothing changes — amounts are returned in PKR exactly as before.
currency=USD (valid code)Amounts in the response are converted to that currency. Codes are case-insensitive.
Unknown codeActions that return amounts reply with an error (BAD_CURRENCY on the plain-text protocol, status 400 on JSON endpoints). Actions that carry no amounts ignore the parameter, so a typo can never block a cancel or refund.
DecimalsPKR amounts keep 2 decimals. Converted amounts use 4 decimals so small prices stay accurate.
ChargingDisplay only. Your wallet is always charged, refunded and held in PKR; the converted figure is what the PKR amount is worth at the current rate.

Examples

# Balance in USD (plain text) https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance&currency=USD ACCESS_BALANCE:0.4500 # Rental prices in AED (JSON adds a "currency" field) https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&currency=AED

Responses

Unknown currency (plain-text endpoints)
BAD_CURRENCY
Unknown currency (JSON endpoints)
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
Get Currencies

Lists every currency code you can pass as currency, with its rate. The list is sorted A–Z by currency name. rate is how many units of that currency equal 1 PKR. Works identically on every endpoint (SMS OTP, Cheap, Premium, Rental, Email) and always replies in JSON.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCurrencies
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getCurrencies';
$data = json_decode(file_get_contents($url), true);
print_r($data['currencies']);
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCurrencies"
import requests
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getCurrencies"}
print(requests.get(url, params=params).json()["currencies"])

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetCurrencies

Response Fields

FieldDescription
status"200"
defaultThe default currency (PKR) used when currency is not sent
countNumber of currencies returned
currencies[].codeThe value to pass as currency
currencies[].nameCurrency name
currencies[].symbolCurrency symbol
currencies[].rateUnits of this currency per 1 PKR

Responses

Success
{"status":"200","default":"PKR","count":3,"currencies":[{"code":"PKR","name":"Pakistani Rupee","symbol":"Rs","rate":1},{"code":"AED","name":"UAE Dirham","symbol":"AED","rate":0.0131},{"code":"USD","name":"US Dollar","symbol":"$","rate":0.0036}]}
Invalid / missing API key
BAD_KEY
Sandbox (test mode)

Test your whole integration without spending money. In your dashboard open API Tool (or Profile), enter your account password and generate a Sandbox Key (it starts with sbx_). Keys are hidden until you confirm your password. Use it in place of your real key in api_key — everything else (URLs, parameters, reply formats) stays exactly the same. Your real key always does real purchases.

How to test, step by step

  1. Create the key — Dashboard → API Tool (or Profile) → Generate Sandbox Key. It starts with sbx_.
  2. Keep your real URL — nothing changes except the key: api_key=sbx_....
  3. Run the whole flow — list servers/prices → buy a number → poll the status until the code arrives (~10 s) → finish or cancel.
  4. Try the errors — add &scenario=no_numbers, low_balance or no_code to a buy request.
  5. Start clean — Reset Sandbox Orders & Balance on the API Tool page.
  6. Go live — replace the sandbox key with your real key. That is the only change.

The sandbox can never spend your real balance or reach a provider, and a sandbox key cannot be used for real purchases.

How the sandbox behaves

AreaBehaviour
Lists & pricesServers, countries, services, rental pricing and prices are the real ones (including your discount), so you can build against live data.
NumbersFake numbers. No provider is called and nothing is charged to your real balance.
BalanceA virtual balance of 5000 (PKR). Buying lowers it, cancelling / expiry refunds it. getBalance shows the virtual balance. Use the Reset button on the API Tool page to start over.
CodeArrives about 10 seconds after the purchase (poll getStatus / getEmailCode / getRentalSMS). The same cancel rules apply: for SMS, cancel is refused in the first 2 minutes (EARLY_CANCEL_DENIED).
ExpiryAn order that never completes is cancelled and refunded after 20 minutes.
Test errorsAdd &scenario=no_numbers, &scenario=low_balance or &scenario=no_code to a buy request (getNumber, buyNumber, rentNumber, buyEmail) to test those replies. no_code never delivers the code.
Email pricesEmail stock is priced live, so sandbox email orders use a fixed sample price (15.00 before your discount).
# Same call, sandbox key https://otpget.com/stubs/handler_api.php?api_key=sbx_YOUR_SANDBOX_KEY&action=getBalance ACCESS_BALANCE:5000.00

Every sandbox reply carries the header X-Sandbox: 1. Switch to your real key when you go live — no other change is needed.

API Discount

If a discount has been set on your account, every price you receive through the API — getServices, getPrice, rental pricing, email and cheap/premium lists, and the price returned when you buy — is already reduced by that percentage, and that is the amount charged (and refunded on cancel). There is nothing to send or calculate on your side. The discount is applied in PKR before any currency conversion.

SMS OTP API

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.

https://otpget.com/stubs/handler_api.php

Required in every request

ParameterRequiredDescription
api_keyRequiredYour API key from the dashboard
actionRequiredThe operation to run (see the table below)
currencyOptionalReturn amounts in this currency instead of PKR — see Currency

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getCurrencies—JSON
getServers—JSON
getCountries— (type optional)JSON
getServicescountry (+ type for servers 2–5)JSON
getPricecountry, service (+ type)JSON
getNumberservice, country (+ type for servers 2–5)Plain text
getStatusidPlain text
setStatusid, statusPlain text
getStatistics— (type, country, service, limit optional)JSON

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 by default — add the optional currency parameter to get them in another currency (see Currency). The type parameter selects the server (1–6); call getServers to see which are active.

ACCESS_NUMBER:a1b2c3d4e5f6a7b8c9d0:923001234567:45.00
{ "12": "Telegram - 45.00 PKR", "13": "WhatsApp - 60.00 PKR" }

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).

1. Get Balance

Your wallet balance in PKR (or in the currency you request with currency). Replies in plain text.

Without currency — default PKR https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance With currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetBalance
currencyOptionalReturn the balance in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (plain text)
ACCESS_BALANCE:125.00
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
2. Get Servers

Lists every server type (1–5) and whether it is currently active. Check this before assuming a given type has countries/services behind it.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServers
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getServers';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServers"
import requests
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getServers"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServers

Responses

Success (JSON)
{"status":"200","count":5,"servers":[{"id":"1","active":true},{"id":"2","active":true},{"id":"3","active":true},{"id":"4","active":true},{"id":"5","active":true}]}
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
3. Get Countries

Countries available for each server type, keyed by type. Use a returned id as country in Get Services and Get Number.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountries&type=1
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountries&type=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetCountries
typeOptional1–5. Omit to get every server type at once

Responses

Success — one type (JSON)
{"1":[{"id":"1","name":"Canada"},{"id":"3","name":"United States of America"}]}
Success — no type (JSON)
{"1":[{"id":"1","name":"Canada"}],"2":[{"id":"6","name":"Russia"}],"3":[...],"4":[...],"5":[...]}
Unknown type
[]
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
4. Get Services

Services and prices for a country on a given server. Returns an object keyed by service id; each value is "Name - price PKR" (the code at the end is the currency you requested — PKR by default).

Without currency — default PKR https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=COUNTRY_ID&type=1 With currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=COUNTRY_ID&type=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=COUNTRY_ID&type=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServices
countryRequiredCountry id from Get Countries
typeOptional1–5, default 1. Must match the server the country came from
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (JSON)
{"12":"Telegram - 45.00 PKR","13":"WhatsApp - 60.00 PKR"}
No services
[]
country missing
BAD_COUNTRY
Invalid type
BAD_TYPE
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
Get Price

Price of one service: give the server (type), the country and the service id — you get the price back. Replies in JSON; failures reply in plain text like the other SMS OTP actions.

Without currency — default PKR https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPrice&country=COUNTRY_ID&service=SERVICE_ID&type=1 With currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPrice&country=COUNTRY_ID&service=SERVICE_ID&type=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getPrice&country=COUNTRY_ID&service=SERVICE_ID&type=1';
$data = json_decode(file_get_contents($url), true);
echo $data['price'] . ' ' . $data['currency'];
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getPrice&country=COUNTRY_ID&service=SERVICE_ID&type=1"
import requests
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "country": "COUNTRY_ID", "service": "SERVICE_ID", "type": "1"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetPrice
countryRequiredCountry id for that server — from getCountries
serviceRequiredService id — from getServices
typeOptionalServer 1–5. Default 1
currencyOptionalReturn the price in this currency instead of PKR (e.g. USD). See Currency

The price returned is the listed price in your account. It is the same figure getServices shows; with currency it is converted using the OTPGet currency converter, without it you always get PKR.

Responses

Success
{"status":"200","server":"1","country":"4","service_id":"564490","service_name":"Telegram","currency":"PKR","price":"652.50"}
Invalid / missing API key
BAD_KEY
Missing country
BAD_COUNTRY
Missing service
BAD_SERVICE
Invalid server (type)
BAD_TYPE
Service not found for that server and country
NO_SERVICE
Unknown currency code
BAD_CURRENCY
5. Get Number

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.

Without currency — default PKR https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=SERVICE_ID&country=COUNTRY_ID&type=1 With currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=SERVICE_ID&country=COUNTRY_ID&type=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=SERVICE_ID&country=COUNTRY_ID&type=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetNumber
serviceRequiredService id from Get Services
countryRequiredCountry id from Get Countries
typeOptional1–5, default 1. Must match the server used for Get Countries / Get Services
currencyOptionalReturn the charged price (and balance) in this currency instead of PKR. Your wallet is still charged in PKR. See Currency

Responses

Success (plain text)
ACCESS_NUMBER:a1b2c3d4e5f6a7b8c9d0:923001234567:45.00
service missing / not found
BAD_SERVICE
country missing / not found
BAD_COUNTRY
Invalid type
BAD_TYPE
Wallet too low
NO_BALANCE
Live price above your balance (number released, nothing charged)
NO_BALANCE_FOR_NEW_PRICE:52.50
No stock
NO_NUMBERS
Server error
ERROR_PROVIDER_1:Server 1 error
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
6. Get Activation Status

Checks whether the SMS for an order has arrived. Poll every few seconds. Replies in plain text.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getStatus&id=ORDER_ID';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetStatus
idRequiredOrder id from getNumber (the first value after ACCESS_NUMBER:)

Responses

Waiting — keep polling
STATUS_WAIT_CODE
SMS received (plain text)
STATUS_OK:123456
Cancelled / closed without SMS
STATUS_CANCEL
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
6b. Get Status V2 (full SMS text)

Same as getStatus, but when the SMS has arrived the reply is JSON with the code and the full message text (where the server provides the full text). Use it when you need more than the code. While waiting or when cancelled, the reply is the same plain text as getStatus (STATUS_WAIT_CODE, STATUS_CANCEL, ...).

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatusV2&id=ORDER_ID

Responses

SMS received
{"verificationType":2,"sms":{"dateTime":"2026-01-01T12:00:00+00:00","code":"123456","text":"Your WhatsApp code: 123-456"}}

text is the full message when the server delivers it; otherwise it is the same as code. If a number receives several messages, code is the latest one and text contains them all. Plain getStatus keeps working exactly as before.

Webhook — get the SMS pushed to your server (optional)

Webhook or polling — your choice. Instead of polling getStatus, you can give us an HTTPS address and we will POST every received SMS to it the moment it arrives. It is optional: if you set nothing, nothing changes — getStatus / getStatusV2 keep working exactly as before, and you can use both together.

Set it up

Dashboard → API page → API Access Control: enter your Webhook URLs — up to 5, one per line (each must be https://, a public address; every URL receives every SMS, signed with the same secret) and your server IPs in Allowed IPs if you want an IP whitelist. A Webhook secret is generated for you on first save. Use Send Test Webhook to check your endpoints (the test goes to every saved URL); the last deliveries are listed on the same page.

Which servers support it

Server (type)Webhook (push)What to do
Server 1SupportedSMS is pushed to your webhook.
Server 2SupportedSMS is pushed to your webhook (full message text included).
Server 3SupportedSMS is pushed to your webhook.
Server 4SupportedSMS is pushed to your webhook.
Server 5SupportedSMS is pushed to your webhook.
Email serversNot supportedPoll getEmailCode.
RentalsNot supportedPoll getRentalSMS.

Push depends on the server sending us the message, so a webhook is a speed-up, not a guarantee: keep a slow fallback poll (for example every 15–30 seconds) so an order is never missed if a push does not arrive.

What we send

POST with Content-Type: application/json:

{ "event": "sms", "activationId": "ORDER_ID", "number": "15550123891", "service": "wa", "code": "123456", "text": "Your WhatsApp code: 123-456", "receivedAt": "2026-01-01T12:00:00+00:00" }

activationId is the same id you got from getNumber. text is the full message when the server sends it, otherwise the code.

Verify the request

Every request carries X-OtpGet-Signature: sha256=<hex> — the HMAC-SHA256 of the raw request body using your Webhook secret. Compare it before trusting the call:

// PHP $ok = hash_equals('sha256=' . hash_hmac('sha256', file_get_contents('php://input'), $secret), $_SERVER['HTTP_X_OTPGET_SIGNATURE'] ?? '');

Delivery rules

  • Answer with any 2xx status within a few seconds. Otherwise we retry that URL up to 3 times (immediately, after ~5 s, after ~20 s); if your endpoint keeps failing we only try once per message until it recovers.
  • The same message can in rare cases arrive twice — treat activationId + code as idempotent.
  • HTTPS only. Redirects are not followed. Local / private addresses are rejected.
  • If an order receives a second message, you get a second POST with the new code and text.
7. Set Activation Status

Finish an order after the SMS arrived, or cancel it for a refund. Replies in plain text.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredsetStatus
idRequiredOrder id from getNumber
statusRequired3 or 6 = complete (only once an SMS was received) · 8 = cancel and refund (allowed 2 minutes after purchase)

Responses

Cancelled and refunded (status=8)
ACCESS_READY
Completed (status=3 or 6)
ACCESS_FINISH
Cancel refused — within 2 minutes of purchase, or the server says it is too early
EARLY_CANCEL_DENIED
Complete before any SMS arrived
NO_SMS_RECEIVED
Already finished or cancelled (also returned if the server had already delivered the code, or another request cancelled it first)
STATUS_ALREADY_CHANGED
The server could not confirm the cancel — nothing is refunded yet, try again shortly (if the server did cancel, the order is cancelled and refunded automatically within a minute)
ERROR_PROVIDER_1:Server 1 error
status is not 3, 6 or 8
BAD_STATUS
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Statistics — Top 20 Activations

Shows what is actually being bought across all users, ranked by popularity — the same data as the Statistics page on the website. Use it to check which service / server / country combinations are performing best before you buy. Filter by server (type), country and service. getTopActivations is an alias of getStatistics. The call is read-only — it never touches your balance.

Without currency — default PKR https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatistics With currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatistics&currency=USD
Filtered — without currency https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatistics&type=2&country=COUNTRY_ID&service=WhatsApp Filtered — with currency (optional) — e.g. USD https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatistics&type=2&country=COUNTRY_ID&service=WhatsApp&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/handler_api.php?api_key=' . $apiKey . '&action=getStatistics&type=2&service=WhatsApp';
$data = json_decode(file_get_contents($url), true);
print_r($data['data']);
curl "https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatistics&type=2&service=WhatsApp"
import requests
url = "https://otpget.com/stubs/handler_api.php"
params = {"api_key": "YOUR_KEY", "action": "getStatistics", "type": "2", "service": "WhatsApp"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetStatistics (or getTopActivations)
typeOptionalServer filter, 1–5 (see getServers). Leave out for all servers.
countryOptionalCountry id from getCountries. Needs type — a country id belongs to one server.
serviceOptionalService name, e.g. WhatsApp (the name shown in getServices).
limitOptionalNumber of rows, 1–20 (default 20).
currencyOptionalAccepted like on every other action — see Currency. The ranking contains no amounts, so the reply is the same with or without it.

The list groups by whichever of country / service / server you have not filtered, so every filter combination returns a useful ranking. Rows are ordered best first (rank 1 = most popular); purchase counts are not returned. Results are refreshed about once a minute.

Responses

Success (JSON)
{"status":"200","filters":{"type":"2","country":"","service":"WhatsApp"},"count":2,"data":[{"rank":1,"type":"2","server":"Server 2","service":"WhatsApp","country":"India"},{"rank":2,"type":"2","server":"Server 2","service":"WhatsApp","country":"Brazil"}]}
Invalid type, or country without type
BAD_TYPE
Invalid country / service value
BAD_COUNTRY  |  BAD_SERVICE  |  BAD_CURRENCY
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Rental Number API

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.

https://otpget.com/stubs/rental-handler.php

Required in every request

ParameterRequiredDescription
api_keyRequiredYour API key from the dashboard
actionRequiredThe operation to run (see the table below)
currencyOptionalReturn amounts in this currency instead of PKR — see Currency

Actions at a glance

ActionExtra required parametersReturns
getCurrencies—Currency codes + rates
getRentalCountries— (provider optional)Countries
getRentalPricingcountry_code, providerDurations + prices
getPricecountry_code, provider, duration_hoursOne price
getAvailableRentalscountry_code, providerLive stock
rentNumbercountry_code, provider, duration_hoursRented number
getMyRentals—Your rentals
getRentalSMSorder_idMessages on a rental
renewRentalrental_id, duration_hoursNew expiry
cancelRentalrental_idRefund (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 by default (optional currency parameter — see Currency).

Response format

Every response is JSON. The HTTP status is always 200 — check the status field in the body (a string).

{ "status": "200", ...action-specific fields }
{ "status": "402", "message": "Insufficient balance." }

Errors: see Error Codes.

Typical flow

getRentalCountries → getRentalPricing → rentNumber → getRentalSMS → renewRental or cancelRental.

1. Get Rental Countries

Countries available for rentals.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalCountries
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getRentalCountries';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalCountries"
import requests
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getRentalCountries"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetRentalCountries
providerOptional1 or 2. Omit to list both servers

Responses

Success
{"status":"200","countries":[{"id":"1","provider":"1","name":"Canada","country_code":"ca"},{"id":"3","provider":"1","name":"United States of America","country_code":"us"}]}
Invalid provider
{"status":"400","message":"Invalid provider. Use 1 or 2."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
2. Get Rental Pricing

Available durations and prices for one country on one server.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&country_code=ca&provider=1 With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&country_code=ca&provider=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&country_code=ca&provider=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetRentalPricing
country_codeRequiredcountry_code from Get Rental Countries (e.g. ca)
providerRequired1 or 2
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success
{"status":"200","currency":"PKR","pricing":[{"id":"4","duration_hours":"720","duration_preset":"1month","price":"1500.00","country_name":"Canada"}]}
Missing country_code
{"status":"400","message":"country_code is required."}
Missing / invalid provider
{"status":"400","message":"provider is required. Use 1 or 2."}
No pricing
{"status":"404","message":"No pricing found for this country and provider."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
Get Price

Price of one rental: give the provider (server), the country and the duration — you get the price back. Replies in JSON.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getPrice&country_code=ca&provider=1&duration_hours=720 With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getPrice&country_code=ca&provider=1&duration_hours=720&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getPrice&country_code=ca&provider=1&duration_hours=720';
$data = json_decode(file_get_contents($url), true);
echo $data['price'] . ' ' . $data['currency'];
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getPrice&country_code=ca&provider=1&duration_hours=720"
import requests
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "country_code": "ca", "provider": "1", "duration_hours": "720"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetPrice
providerRequired1 (Server 1) or 2 (Server 2)
country_codeRequiredCountry code — from getRentalCountries
duration_hoursRequiredRental duration — one of the durations returned by getRentalPricing
currencyOptionalReturn the price in this currency instead of PKR (e.g. USD). See Currency

The price returned is the listed price in your account. It is the same figure getRentalPricing shows; with currency it is converted using the OTPGet currency converter, without it you always get PKR.

Responses

Success
{"status":"200","provider":"1","country_code":"ca","country_name":"Canada","duration_hours":"720","currency":"PKR","price":"1500.00"}
Missing / invalid parameter
{"status":"400","message":"duration_hours is required."}
No price for that country / provider / duration
{"status":"404","message":"No pricing found for this country, provider and duration."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
3. Get Available Rentals

Live stock for a country on one server.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getAvailableRentals&country_code=ca&provider=1
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getAvailableRentals&country_code=ca&provider=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetAvailableRentals
country_codeRequiredCountry code, e.g. ca
providerRequired1 or 2

Responses

Success
{"status":"200","country_code":"ca","provider":"1","available":[{"area_code":"ca","area_title":"Canada","unit_price":8.5,"available":42}]}
Missing parameter
{"status":"400","message":"country_code is required."}
Server unavailable
{"status":"503","message":"Server 1 is currently unavailable."}
Upstream error
{"status":"502","message":"Server 1 error: ..."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
4. Rent Number

Rents a number for the chosen duration. The price is deducted from your wallet immediately.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=rentNumber&country_code=ca&provider=1&duration_hours=720 With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=rentNumber&country_code=ca&provider=1&duration_hours=720&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=rentNumber&country_code=ca&provider=1&duration_hours=720"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredrentNumber
country_codeRequiredCountry code from Get Rental Countries
providerRequired1 or 2
duration_hoursRequiredOne of 12, 24, 168, 720, 4320, 8640. Server 2: only 720, 4320, 8640
currencyOptionalReturn the charged price (and balance) in this currency instead of PKR. Your wallet is still charged in PKR. See Currency

Responses

Success
{"status":"200","message":"Number rented successfully","phone":"+15551234567","order_id":"ord_8f3a91","server":"Server 1","duration_hours":720,"currency":"PKR","price_paid":"1500.00","new_balance":"3500.00","expires":"2026-10-24 12:00:00"}
Missing parameter
{"status":"400","message":"duration_hours is required. e.g. duration_hours=720. Valid values: 12, 24, 168, 720, 4320, 8640"}
Server 2 duration
{"status":"400","message":"Server 2 only supports monthly durations: 720 (1 month), 4320 (6 months), 8640 (12 months)."}
Insufficient balance
{"status":"402","message":"Insufficient balance."}
No pricing
{"status":"404","message":"No pricing found for country_code=ca, provider=1, duration_hours=720. Use action=getRentalPricing to see available durations."}
Server error
{"status":"502","message":"Server 1 error: ..."}
Server disabled
{"status":"503","message":"Server 1 is currently disabled."}
Database error (nothing charged)
{"status":"500","message":"Database error: ..."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
5. Get My Rentals

All rentals on your account.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getMyRentals With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getMyRentals&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/rental-handler.php?api_key=' . $apiKey . '&action=getMyRentals';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getMyRentals"
import requests
url = "https://otpget.com/stubs/rental-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getMyRentals"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetMyRentals
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success
{"status":"200","currency":"PKR","total":1,"rentals":[{"id":"12","server":"Server 1","phone_number":"+15551234567","order_id":"ord_8f3a91","status":"active","country_code":"ca","country_name":"Canada","duration_hours":"720","price_paid":"1500.00","expiry_time":"2026-10-24 12:00:00"}]}
Query failed
{"status":"500","message":"Database query failed: ..."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
6. Get Rental SMS

Messages received on a rented number.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalSMS&order_id=ord_8f3a91
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalSMS&order_id=ord_8f3a91"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetRentalSMS
order_idRequiredorder_id from Rent Number / Get My Rentals

Responses

Success
{"status":"200","phone_number":"+15551234567","order_id":"ord_8f3a91","total":1,"messages":[{"from":"Google","text":"Your code is 482913","code":"482913","timestamp":"2026-09-24 12:05:00"}]}
Missing parameter
{"status":"400","message":"order_id is required."}
Not found
{"status":"404","message":"Order not found or access denied."}
Upstream error
{"status":"502","message":"Server 2 error: ..."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
7. Renew Rental

Extends an existing rental. The price is deducted from your wallet.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=renewRental&rental_id=12&duration_hours=720 With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=renewRental&rental_id=12&duration_hours=720&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=renewRental&rental_id=12&duration_hours=720"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredrenewRental
rental_idRequiredid from Get My Rentals
duration_hoursRequiredOne of 12, 24, 168, 720, 4320, 8640. Server 2: only 720, 4320, 8640. duration is accepted as an alias
currencyOptionalReturn the charged price (and balance) in this currency instead of PKR. Your wallet is still charged in PKR. See Currency

Responses

Success
{"status":"200","message":"Renewed successfully","rental_id":12,"phone_number":"+15551234567","duration_hours":720,"currency":"PKR","price_paid":"1500.00","new_balance":"2000.00","new_expiry":"2026-11-23 12:00:00"}
Missing parameter
{"status":"400","message":"rental_id is required. Get it from getMyRentals."}
Invalid duration
{"status":"400","message":"Invalid duration for Server 1."}
Insufficient balance
{"status":"402","message":"Insufficient balance."}
Rental not found
{"status":"404","message":"Rental not found or does not belong to you. Check rental_id from getMyRentals."}
Upstream error
{"status":"502","message":"Server 1 error"}
Server disabled
{"status":"503","message":"Server 2 is currently disabled."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
8. Cancel Rental

Cancels a rental and refunds your wallet. Server 2 only, within 20 minutes of purchase, and only if no SMS has been received.

Without currency — default PKR https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=cancelRental&rental_id=12 With currency (optional) — e.g. USD https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=cancelRental&rental_id=12&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=cancelRental&rental_id=12"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredcancelRental
rental_idRequiredid from Get My Rentals
currencyOptionalReturn the refunded amount (and balance) in this currency instead of PKR. See Currency

Responses

Success
{"status":"200","message":"Rental cancelled successfully","rental_id":12,"currency":"PKR","price":"1500.00","new_balance":"5000.00"}
Missing parameter
{"status":"400","message":"rental_id is required. Get it from getMyRentals."}
Server 1 rental
{"status":"400","message":"Cancel is only available for Server 2 rentals."}
Window expired
{"status":"400","message":"Cancel window expired. Rentals can only be cancelled within 20 minutes of purchase (35 min have passed)."}
SMS already received
{"status":"400","message":"Cannot cancel: an SMS has already been received on this number."}
Not found / not active
{"status":"404","message":"Rental not found, not active, or does not belong to you."}
Upstream error
{"status":"502","message":"Server 2 error: ..."}
Server disabled
{"status":"503","message":"Server 2 is currently disabled."}
Missing API key
{"status":"401","message":"API key is required."}
Invalid API key
{"status":"401","message":"Invalid API key."}
Account suspended
{"status":"403","message":"Account is blocked or inactive."}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
Cheap Numbers API

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.

https://otpget.com/stubs/cheap_handler.php

Required in every request

ParameterRequiredDescription
api_keyRequiredYour API key from the dashboard
actionRequiredThe operation to run (see the table below)
currencyOptionalReturn amounts in this currency instead of PKR — see Currency

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getCurrencies—JSON
getServers— (type optional)JSON
getServicesserver (+ type for type 2)JSON
getPriceserver (+ type for type 2)JSON
buyNumberserver (+ type for type 2)Plain text (CSV)
getStatusidPlain text
setStatusid, statusPlain 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 by default (optional currency parameter — see Currency).

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.

ORD_6830abc123_741,224611780001,1200
{"1":[{"id":1,"name":"Guinea WhatsApp","price":50.0,"currency":"₨","label":"Guinea WhatsApp — ₨50.00"}]}

Typical flow

getServers → buyNumber → poll getStatus until STATUS_OK → setStatus (status=3 to finish, or 8 to cancel and refund).

1. Get Balance

Your wallet balance in PKR (or in the currency you request with currency). Replies in plain text.

Without currency — default PKR https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getBalance With currency (optional) — e.g. USD https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getBalance&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getBalance"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetBalance
currencyOptionalReturn the balance in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (plain text)
ACCESS_BALANCE:125.00
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
2. Get Servers

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.

Without currency — default PKR https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServers With currency (optional) — e.g. USD https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServers&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getServers';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServers"
import requests
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getServers"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServers
typeOptional1 or 2. Omit to list both groups
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (JSON)
{"1":[{"id":1,"name":"Guinea WhatsApp","price":50.0,"currency":"₨","label":"Guinea WhatsApp — ₨50.00"},{"id":2,"name":"Pakistan Telegram","price":30.0,"currency":"₨","label":"Pakistan Telegram — ₨30.00"}],"2":[]}
No servers available
NO_SERVERS
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
3. Get Services

The name and price of one server. Returns an object keyed by the server id; the value is "Name - price".

Without currency — default PKR https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServices&server=1 With currency (optional) — e.g. USD https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServices&server=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServices&server=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServices
serverRequiredServer id from Get Servers
typeOptional1 (default) or 2 — the key the server is listed under in Get Servers
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (JSON)
{"1":"Guinea WhatsApp - ₨50.00"}
server missing or below 1
BAD_SERVER
Server not found / inactive
NO_SERVICES
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
Get Price

Price of one server: give the server id (and optionally type) — you get the price back. Replies in JSON.

Without currency — default PKR https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1 With currency (optional) — e.g. USD https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getPrice&server=1';
$data = json_decode(file_get_contents($url), true);
echo $data['price'] . ' ' . $data['currency'];
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1"
import requests
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "server": "1"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetPrice
serverRequiredServer id — from getServers
typeOptional1 or 2 (same as in getServers). Default 1
currencyOptionalReturn the price in this currency instead of PKR (e.g. USD). See Currency

The price returned is the listed price in your account. It is the same figure getServices shows; with currency it is converted using the OTPGet currency converter, without it you always get PKR.

Responses

Success
{"status":"200","server":"1","type":"1","name":"Server 1","currency":"PKR","price":"2.00"}
Invalid / missing API key
BAD_KEY
Missing server
BAD_SERVER
Server not found or inactive
NO_SERVICES
Unknown currency code
BAD_CURRENCY
4. Buy Number

Buys a number on a server. The price is deducted from your wallet immediately and the number is held for about 20 minutes (the exact time in seconds is the third value of the reply). Replies in plain text: order_id,number,validity_seconds.

Without currency — default PKR https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1 With currency (optional) — e.g. USD https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=buyNumber&server=1';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredbuyNumber
serverRequiredServer id from Get Servers
typeOptional1 (default) or 2 — the key the server is listed under in Get Servers

Responses

Success (plain text)
ORD_6830abc123_741,224611780001,1200
server missing / not found / inactive
BAD_SERVER
Wallet too low
LOW_BALANCE
No number available right now (nothing charged)
NO_NUMBERS
Could not save the order (charge reversed)
DATABASE_ERROR
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
5. Get Status

Checks whether the code for an order has arrived. Poll every few seconds. Replies in plain text.

Several codes on one number: keep polling after the first code — STATUS_OK always returns the newest code. To read every code received on the number, call action=getOtps&id=ORDER_ID (JSON: {"status":"200","count":2,"otps":[{"code":"222222","service":"...","time":"..."},{"code":"111111",...}]}, newest first). The number stays active until you finish it (setStatus 3/6) or its time runs out; it is then completed automatically. A number that never received a code is cancelled and refunded automatically when the time is over.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getStatus&id=ORDER_ID';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetStatus
idRequiredorder_id from Buy Number (the first value of the CSV reply)

Responses

Waiting — keep polling
STATUS_WAIT_CODE
Code received (plain text)
STATUS_OK:847291
Expired (refunded), cancelled or completed without a code
STATUS_CANCEL
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
6. Get All Codes

One number can receive more than one code while it is active. Get Status always returns the newest code; this call returns every code received on the number, newest first. Replies in JSON.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getOtps&id=ORDER_ID
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$orderId = 'ORDER_ID';
$url = 'https://otpget.com/stubs/cheap_handler.php?api_key=' . $apiKey . '&action=getOtps&id=' . $orderId;
$data = json_decode(file_get_contents($url), true);
foreach ($data['otps'] as $o) echo $o['code'] . PHP_EOL;
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getOtps&id=ORDER_ID"
import requests
url = "https://otpget.com/stubs/cheap_handler.php"
params = {"api_key": "YOUR_KEY", "action": "getOtps", "id": "ORDER_ID"}
for o in requests.get(url, params=params).json()["otps"]:
    print(o["code"])

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetOtps
idRequiredThe order id returned by Buy Number

Response fields

FieldDescription
status"200" when the order was found
idYour order id
numberThe number, without a leading +
statewaiting (no code yet), received (one or more codes) or closed (finished / cancelled / expired)
countHow many codes were received
otpsList of {code, service, time}, newest first

Responses

Two codes received (JSON)
{"status":"200","id":"ORD_6830abc123_741","number":"224611780001","state":"received","count":2,"otps":[{"code":"482913","service":"WhatsApp","time":"2025-01-01 10:04:12"},{"code":"771204","service":"WhatsApp","time":"2025-01-01 10:02:40"}]}
No code yet (JSON)
{"status":"200","id":"ORD_6830abc123_741","number":"224611780001","state":"waiting","count":0,"otps":[]}
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
7. Set Status

Finish an order after the code arrived, or cancel it for a full refund. Replies in plain text. Finishing (3 or 6) stops any further codes on that number; cancelling (8) is only possible while no code has arrived.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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
curl "https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredsetStatus
idRequiredorder_id from Buy Number
statusRequired8 = cancel and refund (only before a code arrived) · 3 or 6 = finish (only after a code arrived)

Responses

Cancelled and refunded (status=8) — also returned if it was already cancelled
ACCESS_READY
Finished (status=3 or 6)
ACCESS_FINISH
Cancel after a code arrived (no refund) / status is not 3, 6 or 8
BAD_STATUS
Finish before any code arrived
NO_SMS_RECEIVED
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Premium API

Temporary numbers where the code arrives by SMS or call. Same idea as the SMS OTP API (pick a country and a service), but a separate endpoint with its own countries/services. A separate endpoint from the SMS OTP and Cheap Numbers APIs — same api_key, different base URL.

https://otpget.com/stubs/premium-handler.php

Required in every request

ParameterRequiredDescription
api_keyRequiredYour API key from the dashboard
actionRequiredThe operation to run (see the table below)
currencyOptionalReturn amounts in this currency instead of PKR — see Currency

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getCurrencies—JSON
getServers—JSON
getServicesserverJSON
getPriceserver, serviceJSON
buyNumberserver, servicePlain text (CSV)
getStatusidPlain text
setStatusid, statusPlain text

Validity and refunds

A bought number is held for a limited time (set by the admin; typically 20 minutes). 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 — it may arrive by SMS or by voice call. Prices and balances are in PKR by default (optional currency parameter — see Currency).

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.

a1b2c3d4e5,923001234567,1200
{"12":"Telegram - Rs90.00","13":"WhatsApp - Rs120.00"}

Typical flow

getServers → getServices → buyNumber → poll getStatus until STATUS_OK → setStatus (status=3 to finish, or 8 to cancel and refund).

1. Get Balance

Your wallet balance in PKR (or in the currency you request with currency). Replies in plain text.

Without currency — default PKR https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getBalance With currency (optional) — e.g. USD https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getBalance&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=getBalance';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getBalance"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).text) # plain text

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetBalance
currencyOptionalReturn the balance in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (plain text)
ACCESS_BALANCE:125.00
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
2. Get Servers

Countries available on Premium, with the cheapest price for each. Use a returned id as server in Get Services and Buy Number.

Without currency — default PKR https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServers With currency (optional) — e.g. USD https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServers&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=getServers';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServers"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getServers"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServers
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (JSON)
{"1":"Pakistan — from Rs90.00","2":"Indonesia — from Rs210.00"}
No countries available
NO_SERVERS
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
3. Get Services

Services and prices for one country. Returns an object keyed by service id; each value is "Name - Rsprice".

Without currency — default PKR https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServices&server=1 With currency (optional) — e.g. USD https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServices&server=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=getServices&server=1';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServices&server=1"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getServices", "server": "1"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetServices
serverRequiredCountry id from Get Servers
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success (JSON)
{"1":"Telegram - Rs90.00","2":"WhatsApp - Rs120.00"}
server missing / not found
BAD_SERVER
No services for this country
NO_SERVICES
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Unknown currency code
BAD_CURRENCY
Get Price

Price of one service: give the server (country) id and the service id — you get the price back. Replies in JSON.

Without currency — default PKR https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service=1 With currency (optional) — e.g. USD https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=getPrice&server=1&service=1';
$data = json_decode(file_get_contents($url), true);
echo $data['price'] . ' ' . $data['currency'];
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service=1"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "server": "1", "service": "1"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetPrice
serverRequiredServer (country) id — from getServers
serviceRequiredService id — from getServices
currencyOptionalReturn the price in this currency instead of PKR (e.g. USD). See Currency

The price returned is the listed price in your account. It is the same figure getServices shows; with currency it is converted using the OTPGet currency converter, without it you always get PKR.

Responses

Success
{"status":"200","server":"1","service_id":"1","service_name":"Telegram","currency":"PKR","price":"120.00"}
Invalid / missing API key
BAD_KEY
Missing server
BAD_SERVER
Missing service
BAD_SERVICE
Service not found for that server
NO_SERVICE
Unknown currency code
BAD_CURRENCY
4. Buy Number

Buys a number. The price is deducted from your wallet immediately. Replies in plain text: order_id,number,validity_seconds.

Without currency — default PKR https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&service=1 With currency (optional) — e.g. USD https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&service=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=buyNumber&server=1&service=1';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&service=1"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "buyNumber", "server": "1", "service": "1"}
print(requests.get(url, params=params).text) # plain text

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredbuyNumber
serverRequiredCountry id from Get Servers
serviceRequiredService id from Get Services

Responses

Success (plain text)
a1b2c3d4e5,923001234567,1200
server missing
BAD_SERVER
service missing / not found
BAD_SERVICE
Wallet too low
LOW_BALANCE
No stock right now (nothing charged)
NO_NUMBERS
Server not configured
PROVIDER_NOT_CONFIGURED
Could not save the order (charge reversed)
DATABASE_ERROR
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
5. Get Status

Checks whether the code for an order has arrived — by SMS or by call. Poll every few seconds. Replies in plain text.

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=getStatus&id=ORDER_ID';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getStatus&id=ORDER_ID"
import requests
url = "https://otpget.com/stubs/premium-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getStatus", "id": "ORDER_ID"}
print(requests.get(url, params=params).text) # plain text

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetStatus
idRequiredOrder id from Buy Number (the first value of the CSV reply)

Responses

Waiting — keep polling
STATUS_WAIT_CODE
Code received — SMS or call (plain text)
STATUS_OK:847291
Expired (refunded) or closed without a code
STATUS_CANCEL
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
6. Set Status

Finish an order after the code arrived, or cancel it for a full refund. Replies in plain text.

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/premium-handler.php?api_key=' . $apiKey . '&action=setStatus&id=ORDER_ID&status=8';
echo file_get_contents($url); // plain text
curl "https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=setStatus&id=ORDER_ID&status=8"
import requests
url = "https://otpget.com/stubs/premium-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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredsetStatus
idRequiredOrder id from Buy Number
statusRequired8 = cancel and refund (only before a code arrived) · 3 or 6 = finish (only after a code arrived)

Responses

Cancelled and refunded (status=8)
ACCESS_READY
Finished (status=3 or 6)
ACCESS_FINISH
Cancel after a code arrived (no refund) / status is not 3, 6 or 8
BAD_STATUS
Finish before any code arrived
NO_SMS_RECEIVED
id missing
BAD_ID
Order not found on this account
NO_ACTIVATION
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
Email OTP API

Temporary email addresses for OTP verification. A separate endpoint from SMS OTP and Rental — same api_key, own base URL and response shape.

https://otpget.com/stubs/email-handler.php

Required in every request

ParameterRequiredDescription
api_keyRequiredYour API key from the dashboard
actionRequiredThe operation to run (see the table below)
currencyOptionalReturn amounts in this currency instead of PKR — see Currency
serverOptional1 (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

ServerFlow
1Service-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.
2Domain + site based — you pick the mailbox domain (gmail.com, mail.com, gmx.com ...) and the site = the website you will use the email on (instagram.com, telegram.com ...). Supports reorderEmail for a fresh code on the same mailbox. Step-by-step example: see Server 2 Guide.

Actions at a glance

ActionServerExtra required parametersReturns
getBalanceBoth—Wallet balance
getCurrenciesBoth—Currency codes + rates
getEmailDomains1 / 2S2: siteS1: domains with stock · S2: domains for a site, with price and stock
getEmailServices1 / 2—S1: services on a domain · S2: domains for a site
getPrice1 / 2—Price of one email product (S1: service_id + domain · S2: domain + site)
buyEmail1 / 2S1: service_id · S2: domainEmail address + email_id
getEmailCodeAutoemail_idVerification code
cancelEmailAutoemail_idCancel + refund
reorderEmail2email_idFresh code on same mailbox
getEmailHistoryBoth—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 by default (optional currency parameter — see Currency).

{ "status": "200", ...action-specific fields }
{ "status": "202", "message": "Waiting for code...", "messages": [] }
{ "status": "402", "message": "Low balance. Need: 120 PKR — Have: 45.5 PKR" }

200 success · 202 still waiting · 300 cancelled · anything else is an error — see Error Codes.

Typical flow

Server 1: getEmailDomains → getEmailServices (domain) → buyEmail (service_id + domain) → poll getEmailCode until 200 (or cancelEmail to refund).

Server 2: getEmailDomains&server=2&site=... or getEmailServices&server=2&site=... (domains for that site, same list) → buyEmail&server=2 (domain + site) → poll getEmailCode until 200 (or cancelEmail to refund) → optionally reorderEmail for another code.

Server 2 Guide — domain + site

On Server 2 you choose two things:

ParameterMeaningExample
domainThe mailbox provider you want the address ongmail.com, mail.com, gmx.com
siteThe website where you will use this email (where you register / receive the code). Stock and price depend on itinstagram.com, telegram.com

Always send the same site in Get Services, Get Price and Buy Email. If you leave site out, telegram.com is used — so the email may not match the website you actually register on. server=2 is required in Get Services, Get Price and Buy Email. After the purchase you only need email_id (the server is detected automatically). A full URL such as https://www.instagram.com/ is accepted and reduced to instagram.com.

Currency: add &currency=USD (any code from getCurrencies) to show prices and balance in that currency. Without it, everything is shown in PKR. Your wallet is always charged in PKR either way.

Step 1 — See which domains are available for your site

Lists every domain with its price and stock for this site. action=getEmailDomains and action=getEmailServices return the same list on Server 2 — use whichever you like.

Without currency — prices in PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=2&site=instagram.com With currency — prices in USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=2&site=instagram.com&currency=USD
Response — without currency
{"status":"200","server":2,"currency":"PKR","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":6.5,"count":340},{"domain":"mail.com","price":3.2,"count":1200}]}
Response — with currency=USD
{"status":"200","server":2,"currency":"USD","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":0.023,"count":340},{"domain":"mail.com","price":0.011,"count":1200}]}

Step 2 — Check the price of one domain (optional)

Same domain + site you will buy with.

Without currency — prices in PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=2&domain=gmail.com&site=instagram.com With currency — prices in USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=2&domain=gmail.com&site=instagram.com&currency=USD
Response — without currency
{"status":"200","server":2,"domain":"gmail.com","site":"instagram.com","count":340,"currency":"PKR","price":6.5}
Response — with currency=USD
{"status":"200","server":2,"domain":"gmail.com","site":"instagram.com","count":340,"currency":"USD","price":0.023}
Domain not available for this site
{"status":"404","message":"Domain \"gmail.com\" not available on Server 2 for site \"instagram.com\""}

Step 3 — Buy the email

Charges your wallet and returns the address. Keep the returned email_id — you need it for the next steps.

Without currency — prices in PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=2&domain=gmail.com&site=instagram.com With currency — prices in USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=2&domain=gmail.com&site=instagram.com&currency=USD
Response — without currency
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Email Activation","domain":"gmail.com","site":"instagram.com","currency":"PKR","price":6.5,"balance":4993.5,"server":2}
Response — with currency=USD
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Email Activation","domain":"gmail.com","site":"instagram.com","currency":"USD","price":0.023,"balance":17.75,"server":2}
Low balance
{"status":"402","message":"Low balance. Need: 6.5 PKR — Have: 2 PKR"}
No stock
{"status":"404","message":"No stock for domain \"gmail.com\" on site \"instagram.com\""}

Step 4 — Use the email, then poll for the code

Enter the email on the website (the same site you bought for), then poll Get Code with the email_id every 3–5 seconds until status is 200. 202 means keep waiting. The code can also contain the full text of the email.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailCode&email_id=7291834
Still waiting
{"status":"202","message":"Waiting for code...","messages":[]}
Code received
{"status":"200","email_id":"7291834","server":2,"messages":[{"email":"temp.abc123@gmail.com","code":"483920"}]}

Step 5 — No code? Cancel and get a refund

Works only while the order is still waiting. Orders with no code after 30 minutes are cancelled and refunded automatically.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834
{"status":"200","message":"Cancelled and refunded","currency":"PKR","refunded":6.5,"balance":5000}

Step 6 — Need another code on the same email? Reorder

Only after you received the first code. It is billed like a new purchase and returns an email_id — poll Get Code with this new id. Add &currency=USD to see the price in USD.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=reorderEmail&email_id=7291834
{"status":"200","message":"Reordered — waiting for a new code","email_id":"7291901","email":"temp.abc123@gmail.com","currency":"PKR","price":6.5,"balance":4987,"server":2}
1. Get Balance

Returns your current wallet balance. Works even if the email service is switched off.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getBalance With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getBalance&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getBalance';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getBalance"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getBalance"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetBalance
currencyOptionalReturn the balance in this currency instead of PKR (e.g. USD). See Currency

Responses

Success
{"status":"200","currency":"PKR","balance":5000.00}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
2. Get Email Domains

Server 1: lists every email domain that currently has stock (gmail.com, icloud.com, mailnestpro.com, hihinail.com, flytempbox.com, mailburstx.com, others). Server 2: lists the domains available for one site (the website you will use the email on) with the price and stock of each. Use a returned domain value in Get Services, Get Price and Buy Email.

Server 1 https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailDomains&server=1
Server 2 — without currency — prices in PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailDomains&server=2&site=instagram.com Server 2 — with currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailDomains&server=2&site=instagram.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailDomains&server=1';
// Server 2: add the site you will use the email on
// $url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailDomains&server=2&site=instagram.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailDomains&server=1"
# Server 2
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailDomains&server=2&site=instagram.com"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailDomains", "server": "1"}
# Server 2: params = {"api_key": "YOUR_KEY", "action": "getEmailDomains", "server": "2", "site": "instagram.com"}
print(requests.get(url, params=params).json())

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetEmailDomains
serverOptional1 (default) or 2
siteServer 2The website you will use the email on, e.g. instagram.com. Stock and price depend on it. If left out, telegram.com is used — send the same site in Get Price and Buy Email.
currencyOptionalServer 2 only (Server 1 has no prices here) — show prices in this currency instead of PKR, see Currency
allOptionalServer 1 only: send 1 to include domains with zero stock

Responses

Success
{"status":"200","server":1,"count":2,"domains":[{"domain":"gmail.com","name":"Gmail","stock":1200,"services":35},{"domain":"icloud.com","name":"iCloud","stock":80,"services":12}]}
Server 2 — without currency
{"status":"200","server":2,"currency":"PKR","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":6.5,"count":340},{"domain":"mail.com","price":3.2,"count":1200}]}
Server 2 — with currency=USD
{"status":"200","server":2,"currency":"USD","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":0.023,"count":340},{"domain":"mail.com","price":0.011,"count":1200}]}
Server 2 — invalid site
{"status":"400","message":"Invalid site. Use a website like instagram.com"}
Service disabled / not configured
{"status":"503","message":"Server 1 email service is disabled"}
Temporarily unavailable
{"status":"500","message":"Server 1 temporarily unavailable. Try again shortly."}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
3. Get Email Services

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.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=1&domain=gmail.com With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=1&domain=gmail.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=1&domain=gmail.com"
import requests
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())

Server 2 example — domains for a site

site = the website where you will use the email. The result lists each domain with its price and stock for that site. Use one of these domain values in Get Price / Buy Email with the same site.

Server 2 — without currency (PKR) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=2&site=instagram.com Server 2 — with currency (e.g. USD) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=2&site=instagram.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getEmailServices&server=2&site=instagram.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=2&site=instagram.com"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getEmailServices", "server": "2", "site": "instagram.com"}
print(requests.get(url, params=params).json())
Server 2 success — without currency
{"status":"200","server":2,"currency":"PKR","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":6.5,"count":340},{"domain":"mail.com","price":3.2,"count":1200}]}
Server 2 success — with currency=USD
{"status":"200","server":2,"currency":"USD","count":2,"site":"instagram.com","domains":[{"domain":"gmail.com","price":0.023,"count":340},{"domain":"mail.com","price":0.011,"count":1200}]}
Invalid site
{"status":"400","message":"Invalid site. Use a website like instagram.com"}
No domains
{"status":"500","message":"No domains available on Server 2 right now. Please try again shortly."}

Request Parameters

ParameterServer 1Server 2Description
api_keyRequiredRequiredYour API key
actionRequiredRequiredgetEmailServices
serverOptionalRequired1 (default) or 2
domainOptionalNot usedServer 1: a domain from Get Email Domains. Default gmail.com. Invalid value returns 400
siteNot usedOptionalServer 2: the website where you will use this email (e.g. instagram.com). Stock and price depend on it — pass the same site in Get Services and Buy. If omitted, telegram.com is used
currencyOptionalOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success — Server 1
{"status":"200","server":1,"currency":"PKR","count":2,"domain":"gmail.com","services":[{"service_code":"ig","service_name":"Instagram","price":120.00,"count":48},{"service_code":"tg","service_name":"Telegram","price":95.00,"count":120}]}
Success — Server 2
{"status":"200","server":2,"currency":"PKR","count":2,"site":"telegram.com","domains":[{"domain":"gmail.com","price":15.60,"count":82000},{"domain":"mail.com","price":1.17,"count":990125}]}
Invalid domain (Server 1)
{"status":"400","message":"Invalid domain. Use action=getEmailDomains for the list"}
Service disabled / not configured
{"status":"503","message":"Server 2 email service is disabled"}
Connection / upstream error
{"status":"500","message":"Server 1 temporarily unavailable. Try again shortly."}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
Get Price

Price of one email product. Server 1: service_id + domain. Server 2: domain + site. Prices come live from the server, so the figure is the current price. Replies in JSON.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service_id=ig&domain=gmail.com With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service_id=ig&domain=gmail.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getPrice&server=1&service_id=ig&domain=gmail.com';
$data = json_decode(file_get_contents($url), true);
echo $data['price'] . ' ' . $data['currency'];
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=1&service_id=ig&domain=gmail.com"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "server": "1", "service_id": "ig", "domain": "gmail.com"}
print(requests.get(url, params=params).json())

Server 2 example — price of one domain on a site

Needs both domain and site. The price is for that exact pair; no money is charged.

Server 2 — without currency (PKR) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=2&domain=gmail.com&site=instagram.com Server 2 — with currency (e.g. USD) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=2&domain=gmail.com&site=instagram.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=getPrice&server=2&domain=gmail.com&site=instagram.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getPrice&server=2&domain=gmail.com&site=instagram.com"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "getPrice", "server": "2", "domain": "gmail.com", "site": "instagram.com"}
print(requests.get(url, params=params).json())
Server 2 success — without currency
{"status":"200","server":2,"domain":"gmail.com","site":"instagram.com","count":340,"currency":"PKR","price":6.5}
Server 2 success — with currency=USD
{"status":"200","server":2,"domain":"gmail.com","site":"instagram.com","count":340,"currency":"USD","price":0.023}
domain missing
{"status":"400","message":"domain is required for Server 2"}
Domain not available for this site
{"status":"404","message":"Domain \"gmail.com\" not available on Server 2 for site \"instagram.com\""}

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetPrice
serverOptional1 (default) or 2
service_idOptionalServer 1: service code — from getEmailServices (e.g. ig)
domainOptionalServer 1: default gmail.com. Server 2: required — from getEmailServices&server=2
siteOptionalServer 2 only: the website where you will use this email (e.g. instagram.com). Use the same value you used in Get Services. If omitted, telegram.com is used
currencyOptionalReturn the price in this currency instead of PKR (e.g. USD). See Currency

The price returned is the listed price in your account. It is the same figure getEmailServices shows; with currency it is converted using the OTPGet currency converter, without it you always get PKR.

Responses

Success (Server 1)
{"status":"200","server":1,"service_id":"ig","service_name":"Instagram","domain":"gmail.com","count":42,"currency":"PKR","price":120.00}
Success (Server 2)
{"status":"200","server":2,"domain":"gmail.com","site":"telegram.com","count":10,"currency":"PKR","price":1.17}
Missing / invalid parameter
{"status":"400","message":"service_id is required for Server 1 (e.g. ig, tg, fb)"}
Not available
{"status":"404","message":"Service \"ig\" not available for domain \"gmail.com\""}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
4. Buy Email

Purchases a temporary email address. The price is deducted from your wallet immediately. If no code arrives, cancel the order to get a refund.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=1&service_id=ig&domain=gmail.com With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=1&service_id=ig&domain=gmail.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=1&service_id=ig&domain=gmail.com"
import requests
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())

Server 2 example — buy an email (domain + site)

Send domain and the site where you will use the email — the same pair you checked in Get Services / Get Price. Save the returned email_id: it is used in Get Code, Cancel and Reorder. Your wallet is charged in PKR; currency only changes how the price/balance are shown.

Server 2 — without currency (PKR) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=2&domain=gmail.com&site=instagram.com Server 2 — with currency (e.g. USD) https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=2&domain=gmail.com&site=instagram.com&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$url = 'https://otpget.com/stubs/email-handler.php?api_key=' . $apiKey . '&action=buyEmail&server=2&domain=gmail.com&site=instagram.com';
$data = json_decode(file_get_contents($url), true);
print_r($data);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=2&domain=gmail.com&site=instagram.com"
import requests
url = "https://otpget.com/stubs/email-handler.php"
params = {"api_key": "YOUR_KEY", "action": "buyEmail", "server": "2", "domain": "gmail.com", "site": "instagram.com"}
print(requests.get(url, params=params).json())
Server 2 success — without currency
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Email Activation","domain":"gmail.com","site":"instagram.com","currency":"PKR","price":6.5,"balance":4993.5,"server":2}
Server 2 success — with currency=USD
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Email Activation","domain":"gmail.com","site":"instagram.com","currency":"USD","price":0.023,"balance":17.75,"server":2}
domain missing
{"status":"400","message":"domain is required for Server 2"}
Domain not available for this site
{"status":"404","message":"Domain \"gmail.com\" not available on Server 2 for site \"instagram.com\""}
No stock
{"status":"404","message":"No stock for domain \"gmail.com\" on site \"instagram.com\""}
Low balance
{"status":"402","message":"Low balance. Need: 6.5 PKR — Have: 2 PKR"}
Provider has no email
{"status":"500","message":"No email available for this domain right now. Please try a different domain or try again shortly."}

Request Parameters

ParameterServer 1Server 2Description
api_keyRequiredRequiredYour API key
actionRequiredRequiredbuyEmail
serverOptionalRequired1 (default) or 2
service_idRequiredNot usedServer 1: service_code from Get Email Services (e.g. ig, tg, fb)
domainOptionalRequiredServer 1: default gmail.com, must be a valid domain. Server 2: a domain from Get Email Services
siteNot usedOptionalServer 2: the website where you will use this email (e.g. instagram.com). Stock and price depend on it — pass the same site in Get Services and Buy. If omitted, telegram.com is used
currencyOptionalOptionalReturn the charged price (and balance) in this currency instead of PKR. Your wallet is still charged in PKR. See Currency

Responses

Success — Server 1
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Instagram","domain":"gmail.com","currency":"PKR","price":120.00,"balance":4880.00,"server":1}
Success — Server 2
{"status":"200","message":"Email activated successfully","email_id":"5501298","email":"temp.xyz789@mail.com","service":"Email Activation","domain":"mail.com","site":"telegram.com","currency":"PKR","price":1.17,"balance":4998.83,"server":2}
Missing parameter
{"status":"400","message":"service_id is required for Server 1 (e.g. ig, tg, fb)"}
Invalid domain (Server 1)
{"status":"400","message":"Invalid domain. Use action=getEmailDomains for the list"}
Low balance
{"status":"402","message":"Low balance. Need: 120 PKR — Have: 45.5 PKR"}
Not available / no stock
{"status":"404","message":"Service \"ig\" not available for domain \"gmail.com\""}
No email issued
{"status":"500","message":"No email available for this domain right now. Please try a different domain or try again shortly."}
Service disabled / not configured
{"status":"503","message":"Server 1 email service is disabled"}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
5. Get Email Code

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.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailCode&email_id=7291834
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailCode&email_id=7291834"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetEmailCode
email_idRequiredemail_id returned by Buy Email

Responses

Waiting — keep polling
{"status":"202","message":"Waiting for code...","messages":[]}
Code received
{"status":"200","email_id":"7291834","server":1,"messages":[{"email":"temp.abc123@gmail.com","code":"740279"}]}
Cancelled
{"status":"300","message":"Activation was cancelled"}
Cancelled automatically (refunded)
{"status":"300","message":"Cancelled by provider — refunded"}
Missing parameter
{"status":"400","message":"email_id is required"}
Unknown email_id
{"status":"404","message":"Email activation not found"}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
6. Cancel Email

Cancels an activation and refunds your wallet. If the code has already arrived, the order is completed instead and nothing is refunded.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834 With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredcancelEmail
email_idRequiredemail_id returned by Buy Email
currencyOptionalReturn the refunded amount (and balance) in this currency instead of PKR. See Currency

Responses

Cancelled and refunded
{"status":"200","message":"Cancelled and refunded","currency":"PKR","refunded":120.00,"balance":5000.00}
Code already received (completed)
{"status":"200","message":"Completed — OTP already received","code":"740279","email":"temp.abc123@gmail.com"}
Already cancelled
{"status":"200","message":"Already cancelled"}
Missing parameter
{"status":"400","message":"email_id is required"}
Unknown email_id
{"status":"404","message":"Email activation not found"}
Cancel could not be completed
{"status":"500","message":"Cancel could not be completed right now. Please try again shortly."}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
7. Reorder Email (Server 2 only)

Requests a fresh code on the same mailbox. It is billed like a new purchase and opens a new order that waits for the new code. Allowed only after the code of the current order was received. The response contains a (possibly new) email_id — poll getEmailCode with that id. Server 2 orders only; the server is detected from the email_id.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=reorderEmail&email_id=7291834 With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=reorderEmail&email_id=7291834&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=reorderEmail&email_id=7291834"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredreorderEmail
email_idRequiredemail_id of a Server 2 order
currencyOptionalReturn the charged price (and balance) in this currency instead of PKR. Your wallet is still charged in PKR. See Currency

Responses

Success
{"status":"200","message":"Reordered — waiting for a new code","email_id":"7291901","email":"temp.abc123@mail.com","currency":"PKR","price":1.17,"balance":4998.83,"server":2}
Missing parameter
{"status":"400","message":"email_id is required"}
Server 1 order
{"status":"400","message":"Reorder is only available for Server 2 emails"}
Order cancelled
{"status":"400","message":"Order was cancelled — cannot reorder"}
Code not received yet
{"status":"400","message":"You can reorder once the code has been received on this order."}
Low balance
{"status":"402","message":"Low balance. Need: 1.17 PKR — Have: 0.5 PKR"}
Unknown email_id
{"status":"404","message":"Email activation not found"}
Reorder failed
{"status":"500","message":"Reorder could not be completed right now. Please try again in a moment."}
Service disabled / not configured
{"status":"503","message":"Server 2 email service is disabled"}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
8. Get Email History

Your past email purchases, newest first. 20 per page.

Without currency — default PKR https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailHistory&page=1 With currency (optional) — e.g. USD https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailHistory&page=1&currency=USD
PHP
cURL
Python
$apiKey = 'YOUR_KEY';
$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);
curl "https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailHistory&page=1"
import requests
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

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetEmailHistory
pageOptionalPage number, default 1
currencyOptionalReturn prices in this currency instead of PKR (e.g. USD). See Currency

Responses

Success
{"status":"200","currency":"PKR","total":42,"page":1,"per_page":20,"history":[{"email_id":"7291834","email_address":"temp.abc123@gmail.com","service_id":"ig","service_name":"Instagram","domain":"gmail.com","status":"received","code":"740279","price":120.00,"server":1,"created_at":"2026-09-02 12:00:00"}]}
Order status values
active = waiting for code · received = code delivered · cancelled = cancelled / refunded
401 — invalid key
{"status":"401","message":"BAD_KEY"}
Unknown currency code
{"status":"400","message":"Invalid currency. Use action=getCurrencies for the list of supported codes."}
Security & Limits

Your API key spends your wallet, so treat it like a password. These protections apply to every API on this page.

Protect your key

  • Never put the key in a website, app or public repository. Call the API from your own server only. Anything in browser or app code can be read by anyone.
  • Allowed IPs — Dashboard → API Tool → API Access Control. Add the IP address(es) of your server (one per line, or a range like 203.0.113.0/24). Requests from any other IP are refused with IP_NOT_ALLOWED, so a leaked key is useless. Empty = any IP.
  • Daily buy limit — the most buy requests (getNumber, buyNumber, buyEmail, reorderEmail, rentNumber, renewRental) your key may send per rolling 24 hours, across all APIs. 0 = unlimited.
  • Recent API activity — the same page lists the IPs that used your key. If one is not yours, generate a new key at once.
  • Changing these settings or viewing your key needs your email code or password, so a stolen key alone cannot switch them off.

Limits

LimitValueReply when exceeded
Requests per key3000 per minuteRATE_LIMITED (HTTP 429)
Buy requests per key300 per minuteRATE_LIMITED (HTTP 429)
Wrong / missing keys per IP60 per 10 minutesRATE_LIMITED (HTTP 429) for every request from that IP until the window ends
Your daily buy limitset by youDAILY_LIMIT_REACHED (HTTP 429)
IP not in your list—IP_NOT_ALLOWED (HTTP 403)

Text APIs return the code as plain text; JSON APIs return {"status":"429","message":"RATE_LIMITED"}. On HTTP 429 wait for the Retry-After seconds and slow your polling (every 3–5 seconds is plenty for getStatus). Sandbox keys are not affected by the IP list or the buy limit.

Error 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.

CodeDescription
BAD_KEYMissing or invalid API key.
ACCOUNT_BLOCKEDThis account is suspended.
ACCOUNT_NOT_VERIFIEDThe account owning this key has no verified email or no phone number yet. Complete it once at /complete-account.
BAD_COUNTRY / BAD_SERVICE / BAD_TYPE / BAD_ID / BAD_STATUSA required parameter is missing, invalid, or has no matching record.
NO_SERVICEgetPrice: that service does not exist for the given server and country.
NO_BALANCEInsufficient 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_NUMBERSNo numbers currently available for that country/service.
NO_ACTIVATIONNo activation found for this id on this account.
EARLY_CANCEL_DENIEDNumbers can only be cancelled 2 minutes after purchase, and only if the server accepts it — nothing is refunded.
NO_SMS_RECEIVEDCannot finish the order — no SMS/code received yet.
STATUS_ALREADY_CHANGEDThis activation was already finalized (finished or cancelled), or the server had already delivered the code. Check it with getStatus.
ERROR_PROVIDER_1-5:Server N errorThe server for that type (the number in the code) had a problem, e.g. ERROR_PROVIDER_2:Server 2 error or ERROR_PROVIDER_2:Server 2 is temporarily unavailable. Nothing is charged — try again shortly or use another server.
BAD_CURRENCYThe currency value is not a supported code — see Get Currencies. Only returned by actions that return amounts; nothing is charged.

Rental API — /stubs/rental-handler.php

statusExample messageWhen it happens
401Invalid API key. / API key is required.Missing or invalid api_key
403Account is blocked or inactive.Account suspended
400country_code is required. / provider is required. Use 1 or 2. / Invalid currency. / 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
402Insufficient balance.Wallet balance too low
404No pricing found… / Rental not found… / Order not found or access denied.No pricing for that country/duration, or wrong rental_id / order_id
502Server 1 error / Server 2 errorThe upstream server had a problem — try again shortly. Nothing is charged
503Server 1 is currently unavailable/disabled.Server switched off in admin settings
500Database error. Please try again.DB transaction failed — balance not deducted

Cheap Numbers API — /stubs/cheap_handler.php

Returned as literal plain text (not JSON).

CodeDescription
BAD_KEYMissing or invalid API key.
ACCOUNT_BLOCKEDThis account is suspended.
ACCOUNT_NOT_VERIFIEDThe account owning this key has no verified email or no phone number yet. Complete it once at /complete-account.
BAD_CURRENCYcurrency is not a supported code (see getCurrencies). Only returned by actions that return amounts.
BAD_ACTIONUnknown or missing action.
BAD_SERVERserver is missing, or that server does not exist / is inactive.
NO_SERVERSgetServers: no server is currently available.
NO_SERVICESgetServices: the server was not found or is inactive.
LOW_BALANCEInsufficient wallet balance for this purchase. Nothing is charged.
NO_NUMBERSNo number could be allocated right now. Nothing is charged — try again shortly.
DATABASE_ERRORThe order could not be saved. The charge is reversed.
BAD_IDid is missing.
NO_ACTIVATIONNo order found for this id on this account.
BAD_STATUSstatus is not 3, 6 or 8, or you tried to cancel an order that already received a code.
NO_SMS_RECEIVEDCannot finish the order — no code received yet.
STATUS_CANCELgetStatus: 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).

CodeDescription
BAD_KEYMissing or invalid API key.
ACCOUNT_BLOCKEDThis account is suspended.
ACCOUNT_NOT_VERIFIEDThe account owning this key has no verified email or no phone number yet. Complete it once at /complete-account.
BAD_CURRENCYcurrency is not a supported code (see getCurrencies). Only returned by actions that return amounts.
BAD_ACTIONUnknown or missing action.
BAD_SERVERserver is missing, or that country does not exist / is inactive.
BAD_SERVICEservice is missing, or not available for that country.
NO_SERVICEgetPrice: that service does not exist for the given server.
NO_SERVERSgetServers: no country is currently available.
NO_SERVICESgetServices: no services found for that country.
LOW_BALANCEInsufficient wallet balance for this purchase. Nothing is charged.
NO_NUMBERSNo number could be allocated right now. Nothing is charged — try again shortly.
PROVIDER_NOT_CONFIGUREDPremium is not set up or is currently disabled.
DATABASE_ERRORThe order could not be saved. The charge is reversed.
BAD_IDid is missing.
NO_ACTIVATIONNo order found for this id on this account.
BAD_STATUSstatus is not 3, 6 or 8, or you tried to cancel an order that already received a code.
NO_SMS_RECEIVEDCannot finish the order — no code received yet.
STATUS_CANCELgetStatus: the order expired (refunded) or was closed without a code — stop polling.

Email OTP API — /stubs/email-handler.php

statusWhen it happensExample message
200Success (all actions){"status":"200", ...}
202getEmailCode: no code yet — keep pollingWaiting for code...
300Activation was cancelled (by you or automatically). Any charge is refundedActivation was cancelled
400Missing/unknown action, a required parameter is missing (service_id, domain, email_id), invalid Server 1 domain, or the action is not allowed for that orderInvalid domain. Use action=getEmailDomains for the list
401Invalid or missing api_keyBAD_KEY
402Wallet balance too low for the purchaseLow balance. Need: 120 PKR — Have: 45.5 PKR
403Account suspendedACCOUNT_BLOCKED
404Service/domain not available, no stock, or email_id not foundEmail activation not found
500Upstream connection error or database error — nothing is charged when a purchase failsDatabase error. Try again.
503Email service disabled or not configuredServer 1 email service is disabled
REST API V2.0Quick Ref
Are you a developer?SMS, Rental, Cheap & Email OTP API