API Documentation
Build powerful applications with OTPSims API. Rent virtual numbers, receive SMS, and automate OTP verification.
REST API
JSON
SSL Secured
Getting Started
Our API is designed to be simple and intuitive. Every request requires an API key which you can obtain from your dashboard.
Base URL
https://api.otpsims.com/v1
Authentication
Include your API key in the request header.
Authorization: Bearer YOUR_API_KEY
Endpoints
GET
/numbers
List available numbers
Returns a list of available virtual numbers filtered by country and service.
Query Parameters:
country - ISO country code (e.g., US, GB, DE)service - Service name (whatsapp, telegram, google){
"success": true,
"data": [
{
"id": "num_12345",
"number": "+12025550123",
"country": "US",
"service": "whatsapp",
"price": 2.99,
"available": true
}
]
}
POST
/numbers/rent
Rent a virtual number
Rent a virtual number for OTP verification.
Request Body:
{
"number_id": "num_12345",
"duration_days": 30
}
{
"success": true,
"rental_id": "rent_67890",
"number": "+12025550123",
"expires_at": "2025-02-15T00:00:00Z"
}
GET
/sms/{numberId}
Retrieve received SMS
Fetch all SMS messages received on a rented number.
{
"success": true,
"messages": [
{
"id": "msg_001",
"from": "+447911123456",
"message": "Your verification code is 284739",
"received_at": "2025-01-15T14:32:00Z"
}
]
}
DELETE
/numbers/{id}
Release a rented number
Release a virtual number before its rental period ends.
{
"success": true,
"message": "Number released successfully"
}
Code Examples
cURL
curl -X GET "https://api.otpsims.com/v1/numbers?country=US" \
-H "Authorization: Bearer YOUR_API_KEY"
Python
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.get(
"https://api.otpsims.com/v1/numbers?country=US",
headers=headers
)
print(response.json())
JavaScript (Node.js)
const response = await fetch(
"https://api.otpsims.com/v1/numbers?country=US",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
const data = await response.json();
console.log(data);
Webhooks
Configure webhooks to receive real-time notifications when new SMS arrive.
POST https://your-server.com/webhook
{
"event": "sms.received",
"data": {
"number_id": "num_12345",
"from": "+447911123456",
"message": "Your verification code is 284739",
"received_at": "2025-01-15T14:32:00Z"
}
}
Error Codes
401Invalid or missing API key
402Insufficient balance
404Number not found or already rented
429Rate limit exceeded
500Internal server error
Official SDKs
otpsims-python
pip install otpsimsotpsims-node
npm install otpsimsotpsims-go
go get github.com/otpsims/go-sdkotpsims-java
Maven CentralTry the API Now
Get your free API key and start building in minutes.