single-service activations

Tariffs for single-service activations

GEThttps://onlinesim.io/api/getTariffs.php

Countries and, for the selected country, the services with their price and the number of available numbers — the service list of the "Buy a number" section of the dashboard. POST with the same parameters works too.

Public method: no key is needed. A key that is sent is still checked (an invalid one gives HTTP 456); an OAuth token, if sent, must carry sms-scope.

  • Services are split into pages: count per page, page from 1.
  • Prices are in USD. With locale_price they are converted to the currency of the lang language (ru — RUB, zh — CNY, fr and de — EUR, en — USD), not to the currency of your balance.
  • With a key, the favourite countries and services of the profile come in favorite_countries and favorite_services and are removed from countries and services.
  • The lists are cached for 60 seconds.

Service list

Parameters

query8
NameTypeDescription
countryinteger

Country whose services are listed. An unknown code gives an empty services

Default:1
countinteger
≥ 1

Services per page. Values below 1 become 1

Default:30
pageinteger
≥ 1

Page of the service list, from 1. Values below 1 become 1

Default:1
filter_countrystring

Keeps only the countries whose name or code starts with this value. The value is lowercased and a leading + is removed, so in practice it matches original or code. The selected country is always kept; with filter_service, the countries that offer a matching service are kept too

filter_servicestring

Keeps only the services whose slug or name contains this value (case-insensitive). It also filters the favourite services and leaves in countries only those that offer such a service (plus the selected country)

filterstring

Default for both filter_country and filter_service; returned in filter

locale_priceinteger

1 — prices in the currency of the lang language instead of USD. Read as a boolean: 1, true, on, yes turn it on; 0, false, off, no, an empty or any other value leave it off

Enum:01Default:0
langstring

Language of the texts in the answer (country and service names, status texts): fr, de, ru, en or zh. Every method accepts it; methods without such texts answer the same in any language. Field names, error codes and other fixed values stay in English. Without the parameter: ru for getTariffs, getNumbersStats and getFreeList; otherwise the language of the profile for requests with a key, English for requests without one. An unsupported value falls back to the default language

Enum:frderuenzh

Responses

200Tariffs or an error
Content-Typeapplication/json
Schema
schemaoneOf
One Of
[0]object
[1]object
[2]object

Examples

success34 lines

Tariffs for Russia, no key

favorite_countries and favorite_services are {} here and are left out of the example

{
  "response": "1",
  "countries": {
    "_7": {
      "name": "Russia",
      "original": "russia",
      "code": 7,
      "pos": 0,
      "other": false,
      "new": false,
      "enable": true
    }
  },
  "services": {
    "_vkcom": {
      "id": 1,
      "count": 3721,
      "price": "0.55",
      "service": "VKontakte",
      "slug": "vkcom"
    },
    "_telegram": {
      "id": 2,
      "count": "?",
      "price": "1.20",
      "service": "Telegram",
      "slug": "telegram"
    }
  },
  "page": 1,
  "country": 7,
  "filter": "",
  "end": false
}
INTERVAL_CONCURRENT_REQUESTS_ERROR

Too many requests

{
  "response": "INTERVAL_CONCURRENT_REQUESTS_ERROR"
}
429HTTP 429: more than 400 requests per minute from one profile (from one IP for requests without a key), or more than 200 requests per minute from one profile to getNum, getPrice, getState and setOperationOk together
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Rate limit

Request rate limit exceeded

{
  "response": "TRY_AGAIN_LATER"
}
456HTTP 456: the API key is invalid or the OAuth token has expired. Public methods answer the same way when an invalid key is sent
Content-Typeapplication/json
Schema
schemaobject
responsestringRequired
Error code. The codes any method can return are listed in the introduction; each method lists its own. The list is not closed: treat an unknown code as a generic error and log it.

Examples

Invalid key

Invalid API key or expired token

{
  "response": "ERROR_WRONG_KEY"
}

Code Samples

Generating examples...