Authentication
All API requests require an API key for authentication. Your API key uniquely identifies your account and should be kept secure.
Get Your API Key
Sign up for a free account to get your API key. No credit card required. You can generate and manage API keys from your dashboard.
Include your API key as a query parameter in every request. The API key must be included in the api_key parameter.
<?php
$apiKey = 'YOUR_API_KEY';
$url = "https://shadowotp.com/stubs/handler_api.php?api_key=$apiKey&action=getBalance";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Base URLs
Different services use different base endpoints. Choose the appropriate base URL for the API you're using.
SMS OTP API
For temporary phone numbers and SMS verification
Rental Number API
For long-term number rentals
Temporary Email API
For temporary email addresses
Free Number API
For free phone numbers with lifetime subscription
Virtual Numbers API
Purchase temporary phone numbers for one-time SMS verification. Perfect for account verification, testing workflows, and OTP-based authentication.
Understanding Server IDs
Different server IDs (1-4) represent different SMS providers. Each server may have different countries, services, pricing, and availability. Always check the available options for each server before making requests.
Get Balance
Retrieve your account balance in real-time in PKR currency.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "getBalance" |
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getBalance
Get Countries
Retrieve all available countries organized by server/provider.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getCountries" |
| server | Integer | No | Server ID (1-4). Empty for all servers. |
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getCountries&server=1
Get Services
Get available services and pricing for a specific country and server.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getServices" |
| country | String/Integer | Yes | Country ID (e.g., "0" for Russia) |
| server | Integer | Yes | Server ID (1-4) |
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getServices&country=0&server=1
Get Number
Purchase a temporary phone number to receive SMS verification codes.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getNumber" |
| service | String | Yes | Service ID (e.g., "tg", "wa", "go") |
| country | String/Integer | Yes | Country ID |
| server | Integer | Yes | Server ID (1-4) |
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getNumber&service=tg&country=0&server=1
Important
Balance is deducted automatically upon successful purchase. Save the order_id for checking status.
Get Status
Check SMS status and retrieve verification codes for an order. Returns plain text responses.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getStatus" |
| id | String/Integer | Yes | Order ID from getNumber |
| server | Integer | Yes | Server ID used when purchasing |
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=getStatus&id=12345678&server=1
Polling Strategy
Call this endpoint every 5-10 seconds until you receive STATUS_OK or an error. Typical timeout is 15-20 minutes.
Set Status
Cancel order, request new SMS, or mark as complete.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "setStatus" |
| id | String/Integer | Yes | Order ID |
| status | Integer | Yes | Status code (3=Retry, 6=Complete, 8=Cancel) |
| server | Integer | Yes | Server ID |
Request Another SMS
Request a new SMS code if previous one timed out
Complete Activation
Mark the order as successfully completed
Cancel & Refund
Cancel and refund if no SMS received
GET https://shadowotp.com/stubs/handler_api.php?api_key=YOUR_API_KEY&action=setStatus&id=12345678&status=3&server=1
Rental Numbers API
Rent long-term phone numbers to receive multiple SMS messages over an extended period. Perfect for business accounts and applications requiring extended SMS reception.
Get Rental Countries
List all countries available for long-term number rental.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getRentalCountries" |
| server | Integer | No | Server ID (1-4) |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=getRentalCountries&server=1
Get Rental Pricing
Get available rental durations and pricing for a specific country.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getRentalPricing" |
| country_code | String | Yes | Country code (e.g., "US", "PK") |
| server | Integer | No | Server ID (1-4) |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=getRentalPricing&country_code=US&server=1
Get Available Rentals
Check real-time stock of rental numbers for a specific country.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getAvailableRentals" |
| country_code | String | Yes | Country code (e.g., "US", "PK") |
| server | Integer | No | Server ID (1-4) |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=getAvailableRentals&country_code=US&server=1
Rent Number
Purchase a long-term rental number using a pricing_id.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "rentNumber" |
| pricing_id | String/Integer | Yes | Pricing ID from getRentalPricing |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=rentNumber&pricing_id=101
Get My Rentals
List all your rental numbers (both active and expired).
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getMyRentals" |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=getMyRentals
Get Rental SMS
Fetch all SMS messages received on a rented number.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getRentalSMS" |
| order_id | String | Yes | Order ID from rentNumber |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=getRentalSMS&order_id=abc123
Renew Rental
Extend an active rental number's expiry by adding more time.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "renewRental" |
| rental_id | String | Yes | Rental ID or Order ID |
| duration | Integer | Yes | Hours to add (e.g., 12, 24, 72) |
GET https://shadowotp.com/stubs/rental_handler.php?api_key=YOUR_API_KEY&action=renewRental&rental_id=abc123&duration=24
Temporary Email API
Purchase temporary email addresses for OTP verification. Each email is linked to a specific service and domain.
Get Email Services
Get list of available email services with pricing and stock.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getEmailServices" |
| domain | String | Yes | Email domain (e.g., "gmail.com") |
GET https://shadowotp.com/stubs/email_handler.php?api_key=YOUR_API_KEY&action=getEmailServices&domain=gmail.com
Buy Email
Purchase a temporary email address for OTP verification.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "buyEmail" |
| service_id | String | Yes | Service ID (e.g., "ig", "fb") |
| domain | String | Yes | Email domain |
GET https://shadowotp.com/stubs/email_handler.php?api_key=YOUR_API_KEY&action=buyEmail&service_id=ig&domain=gmail.com
Get Email Code
Poll this endpoint to retrieve the verification code sent to the purchased email.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getEmailCode" |
| email_id | String/Integer | Yes | Email ID from buyEmail |
GET https://shadowotp.com/stubs/email_handler.php?api_key=YOUR_API_KEY&action=getEmailCode&email_id=7291834
Cancel Email
Cancel an email activation. Refund if no OTP received yet.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "cancelEmail" |
| email_id | String/Integer | Yes | Email ID from buyEmail |
GET https://shadowotp.com/stubs/email_handler.php?api_key=YOUR_API_KEY&action=cancelEmail&email_id=7291834
Get Email History
Retrieve paginated history of all your email purchases.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your API key |
| action | String | Yes | Must be "getEmailHistory" |
| page | Integer | No | Page number for pagination (default: 1) |
GET https://shadowotp.com/stubs/email_handler.php?api_key=YOUR_API_KEY&action=getEmailHistory&page=1
Free Numbers API
Access free phone numbers for SMS verification with a lifetime subscription. Purchase the subscription once and use the API indefinitely without per-message charges. Perfect for developers and businesses requiring cost-effective OTP verification.
Lifetime Subscription Required
To use the Free Number API, you need to purchase a lifetime subscription for PKR 500.00. Once purchased, you can access unlimited free numbers without any additional charges.
Get Balance
Retrieve your account balance in PKR currency. Check your available funds before purchasing numbers.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "getBalance" |
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=getBalance
Get Services
Get list of available services with pricing and details. Each service corresponds to a different platform with different prices.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "getServices" |
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=getServices
Buy Number
Purchase a temporary phone number to receive SMS verification codes for a specific service. Your balance will be deducted automatically.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "buyNumber" |
| server | String | Yes | Server ID from getServices (e.g., "1", "2", "3") |
| type | String | No | Type parameter (default: "1") |
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=buyNumber&server=1&type=1
Get Status
Check SMS status and retrieve verification codes for a specific order. Returns plain text responses. Poll every 5-10 seconds.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "getStatus" |
| id | String/Integer | Yes | Order ID from buyNumber |
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=getStatus&id=123456789
Polling Strategy
Call this endpoint every 5-10 seconds until you receive STATUS_OK or an error. Typical timeout is 15-20 minutes. If STATUS_WAIT_RETRY appears, use setStatus with status=3.
Set Status
Manage your activation order by setting its status. Cancel, request new SMS, or mark as complete.
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | Your unique API key |
| action | String | Yes | Must be "setStatus" |
| id | String/Integer | Yes | Order ID from buyNumber |
| status | Integer | Yes | Status code (3=Retry, 6=Complete, 8=Cancel) |
Request Another SMS
Request a new SMS code if previous one timed out
Complete Activation
Mark the order as successfully completed
Cancel & Refund
Cancel and refund if no SMS received (after 2 minutes)
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=setStatus&id=123456789&status=3
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=setStatus&id=123456789&status=6
GET https://shadowotp.com/stubs/free_handler.php?api_key=YOUR_API_KEY&action=setStatus&id=123456789&status=8
Important Notes
Status 8 (Cancel) only refunds if NO SMS was received. Cancel is only allowed after 2 minutes from purchase. Always use Status 6 (Complete) after successfully using the code.
Error Codes
Common error codes that may be returned by any endpoint. Handle these errors gracefully in your application.
Not Found
Order ID not found or doesn't belong to your account
Invalid Action
Invalid action parameter or malformed request
Insufficient Balance
Not enough balance to complete this purchase
No Numbers Available
No numbers available for this country/service
Invalid API Key
API key is invalid or expired
Database Error
A database error occurred on the server
Invalid Service
The specified service ID is not valid
Server Error
An unexpected server error occurred
Free Number API Specific Errors
The Free Number API may return additional error codes such as BAD_SERVER, ERROR_PROVIDER, ACCOUNT_BLOCKED, EARLY_CANCEL_DENIED. Refer to your dashboard for complete error documentation.
Need Help?
Our support team is available 24/7 to help you with any questions or issues.
24/7 Support
Contact us via WhatsApp, Email, or Live Chat. Urdu & English support available.