OT
OtpGet
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
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, Telegram and Email OTP always reply in JSON with a status field — the SMS OTP API is the one endpoint with the mixed plain-text/JSON behaviour described above, kept for backward compatibility.

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)

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getServers—JSON
getCountries— (type optional)JSON
getServicescountry (+ type for servers 2–7)JSON
getNumberservice, country (+ type for servers 2–7)Plain text
getStatusidPlain text
setStatusid, statusPlain text

Response format

Plain-text replies are a single line, fields separated by :. Compare the raw body against the values shown for each action. Prices and balances are in PKR. The type parameter selects the server (1–7); call getServers to see which are active.

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. Replies in plain text.

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance
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

Responses

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

Lists every server type (1–7) 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":7,"servers":[{"id":"1","active":true},{"id":"2","active":true},{"id":"3","active":true},{"id":"4","active":true},{"id":"5","active":false},{"id":"6","active":true},{"id":"7","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–7. 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":[...],"6":[...],"7":[...]}
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".

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=COUNTRY_ID&type=1
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–7, default 1. Must match the server the country came from

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

https://otpget.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=SERVICE_ID&country=COUNTRY_ID&type=1
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–7, default 1. Must match the server used for Get Countries / Get Services

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:<detail>
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
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
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 within 2 minutes of purchase
EARLY_CANCEL_DENIED
Complete before any SMS arrived
NO_SMS_RECEIVED
Already finished or cancelled
STATUS_ALREADY_CHANGED
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
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)

Actions at a glance

ActionExtra required parametersReturns
getRentalCountries— (provider optional)Countries
getRentalPricingcountry_code, providerDurations + prices
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.

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.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&country_code=ca&provider=1
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

Responses

Success
{"status":"200","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."}
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.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=rentNumber&country_code=ca&provider=1&duration_hours=720
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

Responses

Success
{"status":"200","message":"Number rented successfully","phone":"+15551234567","order_id":"ord_8f3a91","server":"Server 1","duration_hours":720,"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."}
5. Get My Rentals

All rentals on your account.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=getMyRentals
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

Responses

Success
{"status":"200","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."}
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.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=renewRental&rental_id=12&duration_hours=720
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

Responses

Success
{"status":"200","message":"Renewed successfully","rental_id":12,"phone_number":"+15551234567","duration_hours":720,"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":"Provider 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."}
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.

https://otpget.com/stubs/rental-handler.php?api_key=YOUR_API_KEY&action=cancelRental&rental_id=12
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

Responses

Success
{"status":"200","message":"Rental cancelled successfully","rental_id":12,"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."}
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)

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getServers— (type optional)JSON
getServicesserver (+ 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.

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. Replies in plain text.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getBalance
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

Responses

Success (plain text)
ACCESS_BALANCE:125.00
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
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.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServers
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

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
3. Get Services

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

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=getServices&server=1
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

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
4. Buy Number

Buys a number on a server. The price is deducted from your wallet immediately and the number is held for 20 minutes. Replies in plain text: order_id,number,validity_seconds.

https://otpget.com/stubs/cheap_handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1
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.

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. Set Status

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

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)

Actions at a glance

ActionExtra required parametersReply
getBalance—Plain text
getServers—JSON
getServicesserverJSON
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.

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. Replies in plain text.

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getBalance
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

Responses

Success (plain text)
ACCESS_BALANCE:125.00
Invalid / missing API key
BAD_KEY
Account suspended
ACCOUNT_BLOCKED
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.

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServers
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

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
3. Get Services

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

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=getServices&server=1
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

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
4. Buy Number

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

https://otpget.com/stubs/premium-handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&service=1
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)
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-based — e.g. gmail.com, mail.com, gmx.com. Buy with domain + site. Supports reorderEmail for a fresh code on the same mailbox.

Actions at a glance

ActionServerExtra required parametersReturns
getBalanceBoth—Wallet balance
getEmailDomains1—Domains with stock
getEmailServices1 / 2—S1: services on a domain · S2: domains for a 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.

{ "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

getEmailDomains → getEmailServices → buyEmail → poll getEmailCode until 200 (or cancelEmail to refund).

1. Get Balance

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

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getBalance
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

Responses

Success
{"status":"200","balance":5000.00}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
2. Get Email Domains

Server 1 only. Lists every email domain that currently has stock (gmail.com, icloud.com, mailnestpro.com, hihinail.com, flytempbox.com, mailburstx.com, others). Use a returned domain value in Get Services and Buy Email.

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

Request Parameters

ParameterRequiredDescription
api_keyRequiredYour API key
actionRequiredgetEmailDomains
serverOptional1 (default). 2 is rejected — Server 2 lists domains through Get Services
allOptionalSend 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 requested
{"status":"400","message":"getEmailDomains is Server 1 only — for Server 2 use getEmailServices&server=2&site=..."}
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.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailServices&server=1&domain=gmail.com
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())

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: website you are registering on. Default telegram.com

Responses

Success — Server 1
{"status":"200","server":1,"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,"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"}
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.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=buyEmail&server=1&service_id=ig&domain=gmail.com
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())

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: website you are registering on. Default telegram.com

Responses

Success — Server 1
{"status":"200","message":"Email activated successfully","email_id":"7291834","email":"temp.abc123@gmail.com","service":"Instagram","domain":"gmail.com","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","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 right now. Try again shortly."}
Service disabled / not configured
{"status":"503","message":"Server 1 email service is disabled"}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
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.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834
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

Responses

Cancelled and refunded
{"status":"200","message":"Cancelled and refunded","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 failed. Try again shortly."}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
7. Reorder Email (Server 2 only)

Requests a fresh code on the same mailbox. The order stays open and returns to “waiting”, so you can poll getEmailCode again. Works only for orders bought on Server 2 and not cancelled. The server is detected from the email_id.

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=reorderEmail&email_id=7291834
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

Responses

Success
{"status":"200","message":"Reordered — waiting for a new code","email_id":"7291834","email":"temp.abc123@mail.com","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"}
Unknown email_id
{"status":"404","message":"Email activation not found"}
Reorder failed
{"status":"500","message":"Reorder failed. Try again shortly."}
Service disabled / not configured
{"status":"503","message":"Server 2 email service is disabled"}
401 — invalid key
{"status":"401","message":"BAD_KEY"}
8. Get Email History

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

https://otpget.com/stubs/email-handler.php?api_key=YOUR_API_KEY&action=getEmailHistory&page=1
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

Responses

Success
{"status":"200","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"}

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.
BAD_COUNTRY / BAD_SERVICE / BAD_TYPE / BAD_ID / BAD_STATUSA required parameter is missing, invalid, or has no matching record.
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.
NO_SMS_RECEIVEDCannot finish the order — no SMS/code received yet.
STATUS_ALREADY_CHANGEDThis activation was already finalized (finished or cancelled).
ERROR_PROVIDER_1-7:<detail>The server for that type returned an error — the text after the colon is the detail. Nothing is charged.

Rental API — /stubs/rental-handler.php

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. / 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 error: …Upstream error — see message. Nothing is charged
503Server 1 is currently unavailable/disabled.Server switched off in admin settings
500Database error: …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.
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.
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_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