API Docs

Developer reference · LibOTP wallet

Balance —

Your API key

Prepaid wallet billing. Pass api_key + action as query params. Responses are plain text.

live

API discount

—

On getNumber

Base URL

Either path hits the same handler. Method: GET.

Authentication

Send your key as api_key (also apiKey, key, or header X-Api-Key). Invalid key → BAD_KEY.

GET

getBalance

Returns your wallet balance in INR.

Request


                
              

Response

ACCESS_BALANCE:123.45
GET

getCountries

List country codes. Use codes like IN, US — never numeric ids.

Request


                
              

Response

IN:India
US:United States
…
Loading…
Loading country codes…
GET

getServices

Live service list. Prefixes: s1_ Server 01 · s2_ Server 02 (New Stock). Same app name can exist on both — e.g. s1_jiomart vs s2_jiomart. Full list below (searchable) — same data as the API.

Request


                
              

Full service codes (live)

Loading…
Loading service codes…
GET

getPrices

Live sell prices (INR) for a country. Returns one line per priced service: serviceCode:price. Server 01 is complete; New Stock includes popular apps by default — pass full=1 or server=2 for all S02, or service=s2_jiomart for one code. Optional format=json.

Param Required Notes
country no Default IN
service no Price one opaque code only
server no 1 = Server 01 · 2 = New Stock
full no 1 = price all New Stock services (slower, cached)

Request


                
              

Response

s1_jiomart:16.08
s2_jiomart:19.31
s2_whatsapp:12.5
…

Prices browser (IN)

Loading…
Loading prices…
GET

getNumber

Buy a temporary number. Debits wallet (API discount applied if set). Live tester: /api-lab.

Param Required Notes
service yes From getServices (e.g. s2_whatsapp, s2_jiomart, s1_jiomart)
country no Default IN
operator no Optional pin (e.g. 4). If omitted, API auto-tries live operators by price until one returns a number. Website “Server N” on New Stock = operator N. Alias param: server.
maxPrice no INR sell cap. Values of 1 or below are ignored (common script default).

Request


                
              

Response

ACCESS_NUMBER:<activationId>:<phoneDigits>
GET

getStatus

Poll for SMS / OTP. Call every 3–5 seconds.

Param Required Notes
id yes Activation id from getNumber

Request


                
              

Response

STATUS_WAIT_CODE
STATUS_OK:123456
STATUS_CANCEL
GET

setStatus

Cancel, finish, or request the next SMS on an activation.

status Meaning
8 Cancel (refund when eligible)
6 Finish
3 Request next SMS

Request


                
              

Recommended flow

  1. getBalance — check wallet
  2. getNumber — parse ACCESS_NUMBER:id:phone
  3. Poll getStatus every 3–5s until STATUS_OK:code
  4. Optional: cancel with setStatus=8

API discount (if assigned by admin) applies automatically on getNumber.

Common errors

Code Meaning
BAD_KEY Invalid or missing API key
NO_BALANCE Wallet too low
NO_NUMBERS No stock for that service/country
MAX_PRICE Sell price is above the maxPrice you sent
WRONG_SERVICE Unknown service code
WRONG_COUNTRY Unknown country code
EARLY_CANCEL_DENIED Cancel too early — wait about 2 minutes and retry
DISABLED API access turned off by admin