otpwatch handler_api.php recipes
Get API key

Price control: getPrices, maxPrice and a budget that holds

Suppliers set their own prices and change them. Two parameters keep that from turning into a surprise: getPrices tells you the current price before you order, and maxPrice on getNumber refuses any order above the number you chose.

Get an API key Opens sign-up on SimAggregator, the marketplace this API belongs to. Key in the dashboard, balance in USD.

Read the price first

request → reply
# handler_api reference: https://otpwatch.com/price-control
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
?action=getPrices&api_key=KEY&country=16&service=tg
{ "16": { "tg": { "cost": 1.38, "count": 280 } } }

cost is the current price per one-off activation in USD and count the number of free numbers. Always pass both country and service: without filters the reply is the whole price list. Refresh it on a schedule (every few minutes for a bot, once per run for a test suite) rather than before every order.

Cap every order

request → reply
# handler_api reference: https://otpwatch.com/price-control
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
?action=getNumber&api_key=KEY&country=16&service=tg&maxPrice=1.50
ACCESS_NUMBER:12345:447700900123      price was at or below 1.50
WRONG_MAX_PRICE:1.62                  price is above the cap; 1.62 is the lowest now
  • With maxPrice set, the platform will not buy above it. You get either a number at or below the cap, or a refusal that tells you the current lowest price. Nothing is charged or held on a refusal.
  • WRONG_MAX_PRICE:<price> is for one-off activations. A rental above the cap answers NO_NUMBERS without a price.
  • BAD_MAX_PRICE means the value is not a number above zero. Send a dot decimal (1.50), never a locale-formatted 1,50.

Starting caps

The cheapest country with a documented id for each documented service, and a cap with 25% headroom over that price. Use it as a first value, then tune it from your own getPrices reads.

ServicePairCountryFrommaxPrice to start
WhatsAppservice=wa&country=43Germany$1.0251.29
Telegramservice=tg&country=43Germany$1.1251.41
VKservice=vk&country=78France$0.050.07
Googleservice=go&country=16United Kingdom$0.18750.24
Facebookservice=fb&country=43Germany$0.15980.20
TikTokservice=lf&country=15Poland$0.14950.19
Discordservice=ds&country=56Spain$0.06250.08
OpenAIservice=dr&country=15Poland$0.03750.05
Claudeservice=acz&country=16United Kingdom$0.02130.03

“From” price per one-off activation, USD, read from public SimAggregator pages on (UTC). Prices move; getPrices gives the live figure.

Countries without a documented id can be cheaper; their ids come from getCountries (country ids).

Handling the refusal

order-with-cap.mjs
// handler_api reference: https://otpwatch.com/price-control
// Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
// Try the preferred pair; if it is above the cap, decide by rule instead of by surprise.
export async function orderWithCap(client, { service, countries, maxPrice, stretch = 1.1 }) {
  for (const country of countries) {
    try {
      return await client.order({ service, country, maxPrice });
    } catch (e) {
      if (e.code === "WRONG_MAX_PRICE") {
        const lowest = Number(e.reply.split(":")[1]);
        if (lowest <= maxPrice * stretch) return client.order({ service, country, maxPrice: lowest });
        continue; // too expensive here, try the next country
      }
      if (e.code === "NO_NUMBERS") continue;
      throw e; // NO_BALANCE, BAD_KEY, BAD_SERVICE...: not a price problem
    }
  }
  throw new Error(`no number for ${service} within ${maxPrice} in ${countries.join(", ")}`);
}

// await orderWithCap(client, { service: "tg", countries: [16, 43, 187], maxPrice: 2 });

client is the Node.js client; its errors carry code and reply. The stretch factor makes the "accept a small increase" rule explicit and reviewable instead of a manual bump at 3 a.m.

Budget for parallel runs

An open order holds its price until it closes. On a run with many orders in flight, the balance you need is set by the peak, not the average:

peak balance
# handler_api reference: https://otpwatch.com/price-control
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
N  = orders opened per minute at peak
T  = minutes an order can stay open (the activation window; currently 60)
P  = your maxPrice
peak hold ≤ N × T × P

Five orders a minute with a 60-minute window and a $2 cap can hold up to $600 if nothing closes. Two habits cut that by orders of magnitude: close each order as soon as the test is done with it (finish with 6, cancel with 8), and open orders in waves instead of all at once. With prompt closing, the real hold is roughly N × (minutes until you close) × P.

The same peak also has to fit under the account's limit of simultaneous orders, and the request budget of 600 per minute per key. If either is the tighter limit, more balance does not help.

Prices on

The "from" prices behind the table above, per service, came from public SimAggregator pages on . Telegram started at $0.1875 (Indonesia), WhatsApp at $0.1875 (Indonesia), Google at $0.025, OpenAI at $0.025, Claude at $0.0213. Service codes lists the cheapest countries per service.

ready to run it?

Put a maxPrice on every order; it is the cheapest line of code on this site.

Get an API key

Install for your coding agent

terminal
# Agent skills index: https://otpwatch.com/.well-known/agent-skills/index.json
npx skills add https://otpwatch.com

Two skills: receiving an SMS code in your own app or test, and building a bot that sells numbers. Index: /.well-known/agent-skills/index.json

Updated · prices from the 24 Nov 2026 snapshot