API

SMS activation API

Buy numbers and read codes from your own scripts. The API uses the common SMS activation format, so most existing clients work by changing the base address and the key.

Create your API key on the API key page of the console. It is shown once.

Base address and key

Send GET or POST requests to the base address with api_key and action. Create the key on the API key page of the console; it is shown once.

https://snsactivate.com/stubs/handler_api.php?api_key=YOUR_KEY&action=getBalance

Service codes are the names on our service pages (for example whatsapp, telegram, google). Country codes are ISO codes in lower case (us, gb, in). Limit: 300 requests per minute per key. Each activation has a 20 minute window, the same as in the console.

getBalance

Your credit in USD.

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getBalance
ACCESS_BALANCE:12.50

getServicesList

Service codes you can buy (JSON).

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getServicesList
{"status":"success","services":[{"code":"whatsapp","name":"WhatsApp"}]}

getCountries

Country codes (ISO, lower case) and dial codes (JSON).

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getCountries
{"us":{"name":"United States","dial":"1"}}

getPrices

Prices in USD and stock counts per country and service. Both filters are optional.

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getPrices&service=whatsapp&country=us
{"us":{"whatsapp":{"cost":0.18,"count":130598}}}

getNumber

Buys an activation. Returns the activation id and the number with its country code.

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getNumber&service=whatsapp&country=us
ACCESS_NUMBER:AC-7K2M9QX4PB:13475550182

getStatus

STATUS_WAIT_CODE (no code yet), STATUS_OK:<code>, STATUS_WAIT_RETRY:<last code> (another code requested), STATUS_CANCEL (canceled or refunded).

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=getStatus&id=AC-7K2M9QX4PB
STATUS_OK:482913

setStatus

status=1 ready (ACCESS_READY), 3 another code (ACCESS_RETRY_GET), 6 finish (ACCESS_ACTIVATION), 8 cancel with full refund while no code arrived (ACCESS_CANCEL).

GET https://snsactivate.com/stubs/handler_api.php?api_key=KEY&action=setStatus&id=AC-7K2M9QX4PB&status=3
ACCESS_RETRY_GET

Typical flow

  1. getNumber with the service and country. Save the id.
  2. Enter the number in the app and request the SMS.
  3. Call getStatus every 5 to 10 seconds until STATUS_OK.
  4. Need another SMS? setStatus 3, then getStatus again. Done: setStatus 6.
  5. No code? setStatus 8 cancels with a full refund. Without a call, the refund happens by itself when the window ends.

Errors

BAD_KEYMissing or wrong API key.
BAD_ACTIONUnknown action.
BAD_SERVICEUnknown service code.
BAD_COUNTRYThe service is not sold in that country.
NO_BALANCENot enough credit.
NO_NUMBERSNo number available right now. Try again in a moment.
NO_ACTIVATIONUnknown activation id, or not yours.
EARLY_CANCEL_DENIEDA code has already arrived, so the activation cannot be canceled.
TOO_MANY_REQUESTSMore than 300 requests in a minute.
NO_ACTIVATIONS20 activations are already open.
SMS Activation API: getNumber, getStatus, setStatus