otpwatch handler_api.php recipes
Get API key

Country ids for the country parameter

The country parameter takes a number, not an ISO code: 16 is the United Kingdom, 43 is Germany, 187 is the United States. Ten ids are listed in the public docs; the full set comes from getCountries, which conveniently returns the ISO code next to every id.

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

Documented ids

The ten ids named in the public API docs, with the lowest current "from" price among the documented services in each country.

country=CountryISOLowest from
43GermanyDE$0.0875 OpenAI
15PolandPL$0.0375 OpenAI
16United KingdomGB$0.0213 Claude
78FranceFR$0.05 VK
86ItalyIT$0.075 Claude
56SpainES$0.05 Claude
2KazakhstanKZ$0.35 Google
62TürkiyeTRsee getPrices
187United StatesUS$0.35 Discord
22IndiaINsee getPrices

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

Where the price column says "see getPrices", none of the documented services had stock there in the snapshot; getPrices has the live answer for that id.

Do not hardcode the rest: look them up

getCountries returns every country the endpoint knows. Its rus, eng and chn fields currently carry the two-letter ISO code rather than a name, which makes the reply a ready-made ISO-to-id map.

.env.example
# handler_api reference: https://otpwatch.com/country-ids
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
SMS_API_BASE_URL=https://sim-aggregator.org/stubs/handler_api.php
# Key from the SimAggregator dashboard: https://otpwatch.com/key
SMS_API_KEY=
country-ids.mjs
// handler_api reference: https://otpwatch.com/country-ids
// Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
const API = process.env.SMS_API_BASE_URL ?? "https://sim-aggregator.org/stubs/handler_api.php";

export async function countryIds(apiKey) {
  const body = await (await fetch(`${API}?action=getCountries&api_key=${apiKey}`)).text();
  if (!body.trim().startsWith("{")) throw new Error(`getCountries: ${body}`);
  const byIso = {};
  for (const c of Object.values(JSON.parse(body))) if (c.visible) byIso[c.eng.toUpperCase()] = c.id;
  return byIso; // { GB: 16, DE: 43, US: 187, ... }
}

// const ids = await countryIds(process.env.SMS_API_KEY); ids.GB === 16
country_ids.py
# handler_api reference: https://otpwatch.com/country-ids
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/partner
import json
import os

import requests

API = os.getenv("SMS_API_BASE_URL", "https://sim-aggregator.org/stubs/handler_api.php")


def country_ids(api_key: str) -> dict:
    body = requests.get(API, params={"action": "getCountries", "api_key": api_key}, timeout=30).text
    if not body.lstrip().startswith("{"):
        raise RuntimeError(f"getCountries: {body}")
    return {c["eng"].upper(): c["id"] for c in json.loads(body).values() if c.get("visible")}

Cache the map for a day. Country lists change rarely, and one call at startup is cheaper than a wrong hardcoded id that orders a number in the wrong country.

What the other fields mean

FieldMeaning
idthe value for the country parameter
rus, eng, chncurrently the ISO 3166-1 alpha-2 code
visible1 if the country is shown
retrymode flag: another code on the same number (setStatus 3)
rentmode flag: rentals (duration=d1/d3/d7)
multiServicemode flag: several services on one number

Countries in stock without a documented id

These countries had stock for at least one documented service on the snapshot date. Their ids are not in the docs table, so get them from getCountries with the code above.

CountryISOLowest from
ArgentinaAR$0.0125 Discord
BrazilBR$0.025 VK
BulgariaBG$0.0375 Claude
CanadaCA$0.075 Claude
CroatiaHR$0.0375 VK
CzechiaCZ$0.0125 Discord
DenmarkDK$0.05 VK
GeorgiaGE$0.0375 Discord
GreeceGR$0.025 VK
IndonesiaID$0.0125 Facebook
MoldovaMD$0.025 Discord
NetherlandsNL$0.0875 VK
PhilippinesPH$0.025 Discord
RomaniaRO$0.05 Claude
SwedenSE$0.0125 Discord

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

Choosing a country for a test

  • Match the form. If the sign-up form defaults to a country, pick the number from the same country or switch the form. A pasted full number in a field that already has a country prefix becomes a doubled prefix.
  • Match what you are testing. Testing regional behaviour (language, number formatting, extra checks) needs a number from that region. Testing a generic flow does not; the cheaper country is fine.
  • Keep the pair stable in CI. Changing country between runs changes two variables at once. Pin SMS_COUNTRY and change it on purpose.
  • Service codes for the service parameter are on service codes.

ready to run it?

Look ids up at startup with getCountries; keep this table for reading logs.

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