Jump toGetting started
API reference
Buy virtual numbers, rentals, Google Voice numbers and gift cards from your own code. Every call is a GET request with your key in the query, paid from the same wallet you use on the site.
https://smsonline.io/api/v1Prefer clicking through? Postman collection has every call ready to send.
Responses and errors
Successful calls return "status": 1 with the result in data. Anything else means the call did nothing: read msg for the reason.
- 1
- Success
- -1
- Failed. Nothing was charged unless msg says so
- -2
- SMS not received yet. Keep polling
{
"status": -1,
"error": "missing parameter",
"msg": ["Insufficient inventory"]
}Account
Check the wallet that every purchase is paid from.
GET/get-balance
Returns the current wallet balance in USD.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/get-balance" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": { "balance": "24.60" }
}Virtual numbers
One-time numbers for SMS verification. Find a product, buy it, then poll for the code.
GET/virtual-number/get-countries
Every country you can buy a number in. Use its id as countryId.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/virtual-number/get-countries" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": [
{ "id": 1, "name": "United States", "image": "https://…/us.png" },
{ "id": 7, "name": "United Kingdom", "image": "https://…/gb.png" }
]
}GET/virtual-number/get-services
Every app you can receive a code for. Use its id as serviceId.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/virtual-number/get-services" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": [
{ "id": 2, "name": "Telegram", "image": "https://…/telegram.png" },
{ "id": 5, "name": "WhatsApp", "image": "https://…/whatsapp.png" }
]
}GET/virtual-number/get-products
Prices for one app in one country, one row per operator. Pick a row and keep its operatorId.
Query parameters
apiKeyrequiredYour API keycountryIdrequiredCountry id from List countriesserviceIdrequiredService id from List services
curl -G "https://smsonline.io/api/v1/virtual-number/get-products" \
-d apiKey=YOUR_API_KEY \
-d countryId=1 \
-d serviceId=2{
"status": 1,
"data": [
{ "countryId": 1, "serviceId": 2, "operatorId": 3, "price": "0.42" },
{ "countryId": 1, "serviceId": 2, "operatorId": 6, "price": "0.55" }
]
}Buy a number
Charges your walletGET/virtual-number/buy-service
Buys a number and charges your wallet. The number stays live for 10 minutes.
Query parameters
apiKeyrequiredYour API keycountryIdrequiredCountry idserviceIdrequiredService idoperatorIdrequiredOperator id from List products
curl -G "https://smsonline.io/api/v1/virtual-number/buy-service" \
-d apiKey=YOUR_API_KEY \
-d countryId=1 \
-d serviceId=2 \
-d operatorId=3{
"status": 1,
"data": {
"order_id": 918273,
"Number": "+14155550132",
"country_name": "United States",
"service_name": "Telegram",
"country_image": "https://…/us.png",
"service_image": "https://…/telegram.png"
}
}GET/virtual-number/get-sms
Poll every few seconds until the code arrives. status: -2 means not yet. If no SMS arrives in time the order fails and the price goes back to your wallet.
Query parameters
apiKeyrequiredYour API keyorderIdrequiredorder_id from Buy a number
curl -G "https://smsonline.io/api/v1/virtual-number/get-sms" \
-d apiKey=YOUR_API_KEY \
-d orderId=918273{
"status": 1,
"code": "48213"
}
// still waiting
{ "status": -2, "error": "Sms not received", "msg": ["sms for this number is not received"] }Google Voice
Ready-made US Google Voice numbers with their Google account.
GET/google-voice/get-numbers
The numbers in stock right now, with their price.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/google-voice/get-numbers" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": [
{ "id": 3321, "number": "+1 (628) 555-0147", "price": "4.90", "type": 1, "country_name": "USA" }
]
}GET/google-voice/get-number
One number from the list, by its id.
Query parameters
apiKeyrequiredYour API keyidrequiredNumber id from List numbers
curl -G "https://smsonline.io/api/v1/google-voice/get-number" \
-d apiKey=YOUR_API_KEY \
-d id=3321{
"status": 1,
"data": { "id": 3321, "number": "+1 (628) 555-0147", "price": "4.90", "type": 1, "country_name": "USA" }
}Buy a number
Charges your walletGET/google-voice/buy-number
Buys the number, creates the order and charges your wallet.
Query parameters
apiKeyrequiredYour API keyidrequiredNumber id from List numbers
curl -G "https://smsonline.io/api/v1/google-voice/buy-number" \
-d apiKey=YOUR_API_KEY \
-d id=3321{
"status": 1,
"data": { "order_id": 918274, "number": "+1 (628) 555-0147" }
}Rent a number
Keep one number for hours, days, weeks or months and receive every SMS sent to it.
GET/rent-number/get-durations
The rental periods you can choose and the amounts allowed for each.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/rent-number/get-durations" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": [
{ "type": "hour", "time": [1, 2, 4, 8, 12] },
{ "type": "day", "time": [1, 2, 3, 4, 5, 6, 7] }
]
}GET/rent-number/get-countries
Countries you can rent in, priced for the period you ask for.
Query parameters
apiKeyrequiredYour API keytyperequiredhour, day, week or monthtimerequiredHow many of that period
curl -G "https://smsonline.io/api/v1/rent-number/get-countries" \
-d apiKey=YOUR_API_KEY \
-d type=day \
-d time=3{
"status": 1,
"type": "day",
"time": "3",
"data": [ { "id": 1, "name": "United States", "price": "2.85" } ]
}Rent a number
Charges your walletGET/rent-number/buy-number
Creates a pending rental and charges your wallet. The number is attached when the order completes.
Query parameters
apiKeyrequiredYour API keycountryIdrequiredCountry id from List countriestyperequiredhour, day, week or monthtimerequiredHow many of that period
curl -G "https://smsonline.io/api/v1/rent-number/buy-number" \
-d apiKey=YOUR_API_KEY \
-d countryId=1 \
-d type=day \
-d time=3{
"status": 1,
"data": { "order_id": 918275, "status": "pending", "type": "day", "time": "3" }
}Gift cards
Codes for games, stores and streaming. Orders are confirmed by our team, then the code appears.
GET/giftcard/get-list
All gift cards on sale.
Query parameters
apiKeyrequiredYour API key
curl -G "https://smsonline.io/api/v1/giftcard/get-list" \
-d apiKey=YOUR_API_KEY{
"status": 1,
"data": [
{ "id": 12, "brand": "Steam", "name": "Steam $20 US", "face_value": "20.00",
"selling_price": "21.40", "currency_code": "USD", "category_name": "Games" }
]
}GET/giftcard/get-detail
Full details of one gift card.
Query parameters
apiKeyrequiredYour API keyidrequiredGift card id from List gift cards
curl -G "https://smsonline.io/api/v1/giftcard/get-detail" \
-d apiKey=YOUR_API_KEY \
-d id=12{
"status": 1,
"data": { "id": 12, "brand": "Steam", "name": "Steam $20 US", "selling_price": "21.40" }
}Buy a gift card
Charges your walletGET/giftcard/buy
Creates a pending order and charges your wallet. The code is added once the order is confirmed.
Query parameters
apiKeyrequiredYour API keyidrequiredGift card id
curl -G "https://smsonline.io/api/v1/giftcard/buy" \
-d apiKey=YOUR_API_KEY \
-d id=12{
"status": 1,
"data": { "order_id": 918276, "order_status": "pending" }
}GET/giftcard/order-status
Poll an order. When order_status is complete, the code and serial are included.
Query parameters
apiKeyrequiredYour API keyorderIdrequiredorder_id from Buy a gift card
curl -G "https://smsonline.io/api/v1/giftcard/order-status" \
-d apiKey=YOUR_API_KEY \
-d orderId=918276{
"status": 1,
"data": { "order_id": 918276, "order_status": "complete", "code": "XXXX-XXXX-XXXX", "serial": "8812…" }
}