World Data
World Data is reference data: facts that are the same for every caller and change a few times a year. Today that is the country dial-code registry.
It exists so a phone-number input does not need its own copy of the list. A hard-coded table goes stale silently — nobody notices a missing country until someone from it cannot sign up.
| Action | Route |
|---|---|
| List country codes | GET /worlddata/countries |
Also accepts a publishable key
A dial-code registry is the same for every caller and grants nothing, so this is the one surface that also admits a browser-safe publishable key (pk_…) from an Origin that key is locked to. It uses the API-Key header instead.
List country dial codes
GET /worlddata/countries?page=1&limit=100
API-Key: $ME_API_KEY{
"object": "list",
"data": [
{ "code": "TH", "dial_code": "+66", "name": "Thailand" },
{ "code": "SG", "dial_code": "+65", "name": "Singapore" }
],
"page": 1,
"limit": 100,
"total_items": 230,
"total_pages": 3
}| Field | Meaning |
|---|---|
code | ISO-3166 alpha-2, uppercase |
dial_code | E.164 calling code, leading + included |
name | English display name |
Paging
page is 1-based and both values are echoed back, so a client can walk total_pages without tracking its own cursor.
| Input | Behaviour |
|---|---|
limit above 250 | Capped at 250 |
limit or page junk | Falls back to the default (page 1, limit 100) |
page past the end | Empty data, still 200 |
A page past the end returns an empty list rather than 404 so a client walking to the end needs no special case for the row after the last one.
NANP territories keep their full prefix
Countries in the North American Numbering Plan share country code 1 but have distinct prefixes — American Samoa is +1684, Anguilla +1264. Do not truncate these to +1; the resulting numbers are unroutable.
Caching
This registry changes a few times a year. Cache it for as long as suits you and refresh on deploy — there is no need to fetch it per request.
