LibOTP API Gateway · Developer reference

API Docs

Prepaid wallet billing. The script sends the key in a header. Responses are plain text. Same steps as the in-app API Gateway.

  1. After login, copy the key at /app/api.
  2. Every request puts that key in the header X-Api-Key.
  3. Do not add api_key to the URL. Opening the base URL in a browser does not call the API.
  4. Buy with getNumber. Read the OTP with getStatus. Cancel with setStatus and status=8.
live

Generate your key after login at /app/api. Keys are never shown on this public page.

Base URL

Method: GET. This is the API address. Do not open it in the browser. A browser click has no X-Api-Key header, so the API cannot run. Copy a curl example below and put your key in that header. action stays in the URL. Cancel uses action=setStatus&status=8.

Authentication

Send your key in the X-Api-Key header. Query params api_key, apiKey, and key are ignored. 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. Every code starts with s1_ (Server 01). There is no second server and no s2_ list. Copy the code from the list below — for example s1_whatsapp, s1_jiomart, s1_myjio. Do not send a short name such as whatsapp. s2_myjio is only an old alias for Server 01 My Jio (s1_myjio). It is not a second server.

Request


                
              

Full service codes (live)

Loading…
Loading service codes…
GET

getPrices

Live sell prices (INR) for a country. Lines: serviceCode:price. Pass service=s1_jiomart for one code. Replies are plain text. format=json is the only way to get JSON, and only on this action.

Request


              
            

Response

s1_jiomart:16.08
s1_whatsapp:12.5
s1_myjio:24.06
…

Prices browser (IN)

Loading…
Loading prices…
GET

getNumber

Buy a temporary number. Debits the wallet. Each API number stays active for about 21 minutes.

Param Required Notes
service yes From getServices (for example s1_whatsapp, s1_jiomart, s1_myjio). Do not send s2_ codes. s2_myjio is only an old alias for s1_myjio.
country no Default IN
operator no Optional opaque pin s1, s2, s3… These are operators on Server 01, not a second product server. If omitted, the API tries live operators cheapest-first. A raw operator number is rejected (WRONG_OPERATOR).
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.

Unable to connect at service provider

Some software shows this when the call never reaches a real API result. The API is working when getBalance returns plain text ACCESS_BALANCE: plus your balance.

Wrong URL

Use only https://libotp.online/api/gateway. The website home page is not the API. Do not paste another service provider's URL, and do not add ?api_key= on the end.

Missing or invalid key

Send the key only in the header X-Api-Key. A missing key, a cut-off key, extra spaces, or a rotated key returns BAD_KEY. Many apps show that as this connection error. Create or rotate the key at /app/api. api_key, apiKey, and key in the URL are ignored. A browser tab does not send the header, so it cannot prove the connection.

Wrong country or endpoint

Use country codes from getCountries, such as IN or US. A numeric id like 22 returns WRONG_COUNTRY. Use service codes from getServices, such as s1_whatsapp. Do not send s2_ codes. s2_myjio is only an old alias for Server 01 My Jio (s1_myjio). Do not call /api/v1.

Firewall

The machine running the software must be allowed to open HTTPS to https://libotp.online on port 443. A firewall, VPN, or host that blocks outbound HTTPS shows the same error. If curl on your computer returns ACCESS_BALANCE: and the software does not, the block is on the software's network.

Mixing an old provider URL

Delete any URL saved for a previous service provider. Paste only https://libotp.online/api/gateway. Do not mix two provider addresses in one field. NO_BALANCE and NO_NUMBERS are not connection errors.

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
Cancel not ready yet — try again shortly Cancel was not accepted yet. Retry the same id
DISABLED API access turned off by admin