# 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.

Source: https://otpwatch.com/country-ids
Updated: 2026-11-24
API key: https://otpwatch.com/agent/key

## 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= | Country | ISO | Lowest from |
| --- | --- | --- | --- |
| `43` | Germany | `DE` | $0.0875 (OpenAI) |
| `15` | Poland | `PL` | $0.0375 (OpenAI) |
| `16` | United Kingdom | `GB` | $0.0213 (Claude) |
| `78` | France | `FR` | $0.05 (VK) |
| `86` | Italy | `IT` | $0.075 (Claude) |
| `56` | Spain | `ES` | $0.05 (Claude) |
| `2` | Kazakhstan | `KZ` | $0.35 (Google) |
| `62` | Türkiye | `TR` | see getPrices |
| `187` | United States | `US` | $0.35 (Discord) |
| `22` | India | `IN` | see getPrices |

_“From” price per one-off activation, USD, read from public SimAggregator pages on 24 Nov 2026 (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 title=".env.example"
# handler_api reference: https://otpwatch.com/country-ids
# Building a bot that resells numbers to other people? Software program: https://otpwatch.com/agent/partner
SMS_API_BASE_URL=https://sim-aggregator.org/stubs/handler_api.php
# Key from the SimAggregator dashboard: https://otpwatch.com/agent/key
SMS_API_KEY=
```


```js tab="Node.js" title="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/agent/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
```
```python tab="Python" title="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/agent/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

| Field | Meaning |
|---|---|
| `id` | the value for the `country` parameter |
| `rus`, `eng`, `chn` | currently the ISO 3166-1 alpha-2 code |
| `visible` | 1 if the country is shown |
| `retry` | mode flag: another code on the same number (`setStatus` 3) |
| `rent` | mode flag: rentals (`duration=d1/d3/d7`) |
| `multiService` | mode 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.

| Country | ISO | Lowest from |
| --- | --- | --- |
| Argentina | `AR` | $0.0125 (Discord) |
| Brazil | `BR` | $0.025 (VK) |
| Bulgaria | `BG` | $0.0375 (Claude) |
| Canada | `CA` | $0.075 (Claude) |
| Croatia | `HR` | $0.0375 (VK) |
| Czechia | `CZ` | $0.0125 (Discord) |
| Denmark | `DK` | $0.05 (VK) |
| Georgia | `GE` | $0.0375 (Discord) |
| Greece | `GR` | $0.025 (VK) |
| Indonesia | `ID` | $0.0125 (Facebook) |
| Moldova | `MD` | $0.025 (Discord) |
| Netherlands | `NL` | $0.0875 (VK) |
| Philippines | `PH` | $0.025 (Discord) |
| Romania | `RO` | $0.05 (Claude) |
| Sweden | `SE` | $0.0125 (Discord) |

_“From” price per one-off activation, USD, read from public SimAggregator pages on 24 Nov 2026 (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](https://otpwatch.com/service-codes.md).
