region enum Only return entries in this lowercase UN M49 geographic region; any keeps every region.
All 249 ISO 3166-1 countries and territories: codes, capitals, currencies, languages, area in km², continent, ccTLD, calling codes, flags and map points.
Authoritative reference data or standards computation
Returns the full 249-entry alphabetical table by default. Region, continent, area-bound and search filters all compose; sort reorders the result and count limits it.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
region | enum | default: any allowed: any | africa | americas | asia | europe | oceania | antarctic example: europe | Only return entries in this lowercase UN M49 geographic region; any keeps every region. |
continent | enum | default: any allowed: any | AF | AN | AS | EU | NA | OC | SA example: SA | Only return entries on this GeoNames physical continent (AF, AN, AS, EU, NA, OC, SA); any keeps every continent. Distinct from region: Cyprus is region asia but continent EU. |
search | string | allowed: 1 – 100 example: united | Case- and diacritic-insensitive substring match against the common English name (aland finds Åland Islands). |
minArea | float | allowed: ≥ 0 example: 1000000 | Only return entries whose areaSqKm is at least this many square kilometres. The entry with no published area is excluded whenever this or maxArea is set. |
maxArea | float | allowed: ≥ 0 example: 500 | Only return entries whose areaSqKm is at most this many square kilometres. Must be ≥ minArea when both are given; the entry with no published area is excluded whenever either bound is set. |
sort | enum | default: name allowed: name | area-desc | area-asc example: area-desc | Ordering of the filtered list: name is the default alphabetical order; area-desc and area-asc sort by areaSqKm, breaking ties alphabetically and placing unknown-area entries last in both directions. |
region enum Only return entries in this lowercase UN M49 geographic region; any keeps every region.
continent enum Only return entries on this GeoNames physical continent (AF, AN, AS, EU, NA, OC, SA); any keeps every continent. Distinct from region: Cyprus is region asia but continent EU.
search string Case- and diacritic-insensitive substring match against the common English name (aland finds Åland Islands).
minArea float Only return entries whose areaSqKm is at least this many square kilometres. The entry with no published area is excluded whenever this or maxArea is set.
maxArea float Only return entries whose areaSqKm is at most this many square kilometres. Must be ≥ minArea when both are given; the entry with no published area is excluded whenever either bound is set.
sort enum Ordering of the filtered list: name is the default alphabetical order; area-desc and area-asc sort by areaSqKm, breaking ties alphabetically and placing unknown-area entries last in both directions.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
count | int | default: all matches allowed: 1 – 100 example: 3 | Limit the number of returned records (1–100). Defaults to all matches. |
fields | list | example: name,code | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: languageTags | Return all fields except these (comma-separated). |
format | enum | default: json allowed: json | ndjson | csv example: csv | Response format: json envelope, ndjson (one record per line) or csv. |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
count int Limit the number of returned records (1–100). Defaults to all matches.
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
format enum Response format: json envelope, ndjson (one record per line) or csv.
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
name | string | Common English country or territory name. | Denmark |
code | string | ISO 3166-1 alpha-2 code. | DK |
alpha3 | string | ISO 3166-1 alpha-3 code. | DNK |
numeric | string | Three-digit ISO 3166-1 numeric code, kept as text to preserve leading zeroes. | 208 |
capital nullable | string | Capital; multiple official seats are separated by semicolons. Null for territories without a capital. | Copenhagen |
region | string | Lowercase geographic region: africa, americas, asia, europe, oceania or antarctic. | europe |
subregion nullable | string | UN M49 geographic subregion where assigned; otherwise null. | Northern Europe |
currencyCode nullable | string | Primary active ISO 4217 currency code. Null where no single active ISO currency is assigned. | DKK |
languages | string[] | English labels normalized to the LOC ISO 639 Set 1 registry; Papiamento is included explicitly for Aruba and Curaçao despite having no Set 1 code. | ["Danish"] |
callingCode nullable | string | Primary international calling prefix. Shared numbering plans may include the destination prefix; null where none is assigned. | +45 |
flagEmoji | string | Unicode regional-indicator flag sequence for the alpha-2 code. | 🇩🇰 |
latitude | float | Latitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's latitude. | 56 |
longitude | float | Longitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's longitude. | 10 |
areaSqKm nullable | float | Total area in square kilometres (land plus inland water) as published by GeoNames — one rounded figure per entry, not a measurement we computed. Null where GeoNames publishes no usable figure; today that is only UM (United States Minor Outlying Islands), which it prints as 0. | 43094 |
continent | string | GeoNames physical continent code: AF, AN, AS, EU, NA, OC or SA. This is a different classification from region, which is UN M49 statistical geography, and the two genuinely disagree for some entries (Cyprus is region asia but continent EU). | EU |
ccTLD | string | Country-code top-level domain recorded by GeoNames, leading dot included. Every entry has one. The United Kingdom's is .uk, not .gb; Saint Barthélemy (BL) and Saint Martin (MF) both carry Guadeloupe's .gp because .bl and .mf have never been delegated. | .dk |
languageTags | string[] | GeoNames' raw language column split on commas: mostly ISO 639-1 alpha-2, ISO 639-2/-3 alpha-3 (including collective codes such as cau and tut) where no alpha-2 exists, each optionally carrying an ISO 3166-1 region subtag. Not validated against the IANA Language Subtag Registry and far broader than the languages field. Empty for AQ, BV and HM. | ["da-DK","en","fo","de-DK"] |
name string Common English country or territory name.
example: Denmark
code string ISO 3166-1 alpha-2 code.
example: DK
alpha3 string ISO 3166-1 alpha-3 code.
example: DNK
numeric string Three-digit ISO 3166-1 numeric code, kept as text to preserve leading zeroes.
example: 208
capital string nullable Capital; multiple official seats are separated by semicolons. Null for territories without a capital.
example: Copenhagen
region string Lowercase geographic region: africa, americas, asia, europe, oceania or antarctic.
example: europe
subregion string nullable UN M49 geographic subregion where assigned; otherwise null.
example: Northern Europe
currencyCode string nullable Primary active ISO 4217 currency code. Null where no single active ISO currency is assigned.
example: DKK
languages string[] English labels normalized to the LOC ISO 639 Set 1 registry; Papiamento is included explicitly for Aruba and Curaçao despite having no Set 1 code.
example: ["Danish"]
callingCode string nullable Primary international calling prefix. Shared numbering plans may include the destination prefix; null where none is assigned.
example: +45
flagEmoji string Unicode regional-indicator flag sequence for the alpha-2 code.
example: 🇩🇰
latitude float Latitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's latitude.
example: 56
longitude float Longitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's longitude.
example: 10
areaSqKm float nullable Total area in square kilometres (land plus inland water) as published by GeoNames — one rounded figure per entry, not a measurement we computed. Null where GeoNames publishes no usable figure; today that is only UM (United States Minor Outlying Islands), which it prints as 0.
example: 43094
continent string GeoNames physical continent code: AF, AN, AS, EU, NA, OC or SA. This is a different classification from region, which is UN M49 statistical geography, and the two genuinely disagree for some entries (Cyprus is region asia but continent EU).
example: EU
ccTLD string Country-code top-level domain recorded by GeoNames, leading dot included. Every entry has one. The United Kingdom's is .uk, not .gb; Saint Barthélemy (BL) and Saint Martin (MF) both carry Guadeloupe's .gp because .bl and .mf have never been delegated.
example: .dk
languageTags string[] GeoNames' raw language column split on commas: mostly ISO 639-1 alpha-2, ISO 639-2/-3 alpha-3 (including collective codes such as cau and tut) where no alpha-2 exists, each optionally carrying an ISO 3166-1 region subtag. Not validated against the IANA Language Subtag Registry and far broader than the languages field. Empty for AQ, BV and HM.
example: ["da-DK","en","fo","de-DK"]
/api/countries {
"data": [
{
"name": "Afghanistan",
"code": "AF",
"alpha3": "AFG",
"numeric": "004",
"capital": "Kabul",
"region": "asia",
"subregion": "Southern Asia",
"currencyCode": "AFN",
"languages": [
"Pashto",
"Persian",
"Turkmen",
"Uzbek"
],
"callingCode": "+93",
"flagEmoji": "🇦🇫",
"latitude": 34.3332,
"longitude": 66.6552,
"areaSqKm": 647500,
"continent": "AS",
"ccTLD": ".af",
"languageTags": [
"fa-AF",
"ps",
"uz-AF",
"tk"
]
},
{
"name": "Åland Islands",
"code": "AX",
"alpha3": "ALA",
"numeric": "248",
"capital": "Mariehamn",
"region": "europe",
"subregion": "Northern Europe",
"currencyCode": "EUR",
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries?region=europe {
"data": [
{
"name": "Åland Islands",
"code": "AX",
"alpha3": "ALA",
"numeric": "248",
"capital": "Mariehamn",
"region": "europe",
"subregion": "Northern Europe",
"currencyCode": "EUR",
"languages": [
"Swedish"
],
"callingCode": "+358",
"flagEmoji": "🇦🇽",
"latitude": 60.1611,
"longitude": 19.8774,
"areaSqKm": 1580,
"continent": "EU",
"ccTLD": ".ax",
"languageTags": [
"sv-AX"
]
},
{
"name": "Albania",
"code": "AL",
"alpha3": "ALB",
"numeric": "008",
"capital": "Tirana",
"region": "europe",
"subregion": "Southern Europe",
"currencyCode": "ALL",
"languages": [
"Albanian"
],
"callingCode": "+355",
"flagEmoji": "🇦🇱",
"latitude": 40.6449,
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries?search=united {
"data": [
{
"name": "United Arab Emirates",
"code": "AE",
"alpha3": "ARE",
"numeric": "784",
"capital": "Abu Dhabi",
"region": "asia",
"subregion": "Western Asia",
"currencyCode": "AED",
"languages": [
"Arabic"
],
"callingCode": "+971",
"flagEmoji": "🇦🇪",
"latitude": 23.4791,
"longitude": 54.5322,
"areaSqKm": 82880,
"continent": "AS",
"ccTLD": ".ae",
"languageTags": [
"ar-AE",
"fa",
"en",
"hi",
"ur"
]
},
{
"name": "United Kingdom",
"code": "GB",
"alpha3": "GBR",
"numeric": "826",
"capital": "London",
"region": "europe",
"subregion": "Northern Europe",
"currencyCode": "GBP",
"languages": [
"English"
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries?region=asia&count=10&format=csv&fields=name,code,alpha3 name,code,alpha3
Afghanistan,AF,AFG
Armenia,AM,ARM
Azerbaijan,AZ,AZE
Bahrain,BH,BHR
Bangladesh,BD,BGD
Bhutan,BT,BTN
Brunei,BN,BRN
Cambodia,KH,KHM
China,CN,CHN
Cyprus,CY,CYP
/api/countries?continent=SA&fields=name,code,continent,region {
"data": [
{
"name": "Argentina",
"code": "AR",
"continent": "SA",
"region": "americas"
},
{
"name": "Bolivia",
"code": "BO",
"continent": "SA",
"region": "americas"
},
{
"name": "Brazil",
"code": "BR",
"continent": "SA",
"region": "americas"
},
{
"name": "Chile",
"code": "CL",
"continent": "SA",
"region": "americas"
},
{
"name": "Colombia",
"code": "CO",
"continent": "SA",
"region": "americas"
},
{
"name": "Ecuador",
"code": "EC",
"continent": "SA",
"region": "americas"
},
{
"name": "Falkland Islands",
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries?sort=area-desc&count=10&fields=name,code,areaSqKm,continent {
"data": [
{
"name": "Russia",
"code": "RU",
"areaSqKm": 17100000,
"continent": "EU"
},
{
"name": "Antarctica",
"code": "AQ",
"areaSqKm": 14000000,
"continent": "AN"
},
{
"name": "Canada",
"code": "CA",
"areaSqKm": 9984670,
"continent": "NA"
},
{
"name": "United States",
"code": "US",
"areaSqKm": 9629091,
"continent": "NA"
},
{
"name": "China",
"code": "CN",
"areaSqKm": 9596960,
"continent": "AS"
},
{
"name": "Brazil",
"code": "BR",
"areaSqKm": 8511965,
"continent": "SA"
},
{
"name": "Australia",
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries?continent=EU&maxArea=500&sort=area-asc&fields=name,code,areaSqKm,ccTLD {
"data": [
{
"name": "Vatican City",
"code": "VA",
"areaSqKm": 0.44,
"ccTLD": ".va"
},
{
"name": "Monaco",
"code": "MC",
"areaSqKm": 1.95,
"ccTLD": ".mc"
},
{
"name": "Gibraltar",
"code": "GI",
"areaSqKm": 6.5,
"ccTLD": ".gi"
},
{
"name": "San Marino",
"code": "SM",
"areaSqKm": 61.2,
"ccTLD": ".sm"
},
{
"name": "Guernsey",
"code": "GG",
"areaSqKm": 78,
"ccTLD": ".gg"
},
{
"name": "Jersey",
"code": "JE",
"areaSqKm": 116,
"ccTLD": ".je"
},
{
"name": "Liechtenstein",
…
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} Accepts a 2- or 3-letter ISO 3166-1 code, case-insensitively. Unknown codes are explicit 404s with a nearby-code hint when available.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
code
required
| string | allowed: 2 – 3 example: DK | ISO 3166-1 alpha-2 or alpha-3 code, case-insensitive (DK or DNK). |
code string required ISO 3166-1 alpha-2 or alpha-3 code, case-insensitive (DK or DNK).
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: name,code | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: languageTags | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
name | string | Common English country or territory name. | Denmark |
code | string | ISO 3166-1 alpha-2 code. | DK |
alpha3 | string | ISO 3166-1 alpha-3 code. | DNK |
numeric | string | Three-digit ISO 3166-1 numeric code, kept as text to preserve leading zeroes. | 208 |
capital nullable | string | Capital; multiple official seats are separated by semicolons. Null for territories without a capital. | Copenhagen |
region | string | Lowercase geographic region: africa, americas, asia, europe, oceania or antarctic. | europe |
subregion nullable | string | UN M49 geographic subregion where assigned; otherwise null. | Northern Europe |
currencyCode nullable | string | Primary active ISO 4217 currency code. Null where no single active ISO currency is assigned. | DKK |
languages | string[] | English labels normalized to the LOC ISO 639 Set 1 registry; Papiamento is included explicitly for Aruba and Curaçao despite having no Set 1 code. | ["Danish"] |
callingCode nullable | string | Primary international calling prefix. Shared numbering plans may include the destination prefix; null where none is assigned. | +45 |
flagEmoji | string | Unicode regional-indicator flag sequence for the alpha-2 code. | 🇩🇰 |
latitude | float | Latitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's latitude. | 56 |
longitude | float | Longitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's longitude. | 10 |
areaSqKm nullable | float | Total area in square kilometres (land plus inland water) as published by GeoNames — one rounded figure per entry, not a measurement we computed. Null where GeoNames publishes no usable figure; today that is only UM (United States Minor Outlying Islands), which it prints as 0. | 43094 |
continent | string | GeoNames physical continent code: AF, AN, AS, EU, NA, OC or SA. This is a different classification from region, which is UN M49 statistical geography, and the two genuinely disagree for some entries (Cyprus is region asia but continent EU). | EU |
ccTLD | string | Country-code top-level domain recorded by GeoNames, leading dot included. Every entry has one. The United Kingdom's is .uk, not .gb; Saint Barthélemy (BL) and Saint Martin (MF) both carry Guadeloupe's .gp because .bl and .mf have never been delegated. | .dk |
languageTags | string[] | GeoNames' raw language column split on commas: mostly ISO 639-1 alpha-2, ISO 639-2/-3 alpha-3 (including collective codes such as cau and tut) where no alpha-2 exists, each optionally carrying an ISO 3166-1 region subtag. Not validated against the IANA Language Subtag Registry and far broader than the languages field. Empty for AQ, BV and HM. | ["da-DK","en","fo","de-DK"] |
name string Common English country or territory name.
example: Denmark
code string ISO 3166-1 alpha-2 code.
example: DK
alpha3 string ISO 3166-1 alpha-3 code.
example: DNK
numeric string Three-digit ISO 3166-1 numeric code, kept as text to preserve leading zeroes.
example: 208
capital string nullable Capital; multiple official seats are separated by semicolons. Null for territories without a capital.
example: Copenhagen
region string Lowercase geographic region: africa, americas, asia, europe, oceania or antarctic.
example: europe
subregion string nullable UN M49 geographic subregion where assigned; otherwise null.
example: Northern Europe
currencyCode string nullable Primary active ISO 4217 currency code. Null where no single active ISO currency is assigned.
example: DKK
languages string[] English labels normalized to the LOC ISO 639 Set 1 registry; Papiamento is included explicitly for Aruba and Curaçao despite having no Set 1 code.
example: ["Danish"]
callingCode string nullable Primary international calling prefix. Shared numbering plans may include the destination prefix; null where none is assigned.
example: +45
flagEmoji string Unicode regional-indicator flag sequence for the alpha-2 code.
example: 🇩🇰
latitude float Latitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's latitude.
example: 56
longitude float Longitude of a label-safe point inside the largest/main land unit (WGS84), not the capital's longitude.
example: 10
areaSqKm float nullable Total area in square kilometres (land plus inland water) as published by GeoNames — one rounded figure per entry, not a measurement we computed. Null where GeoNames publishes no usable figure; today that is only UM (United States Minor Outlying Islands), which it prints as 0.
example: 43094
continent string GeoNames physical continent code: AF, AN, AS, EU, NA, OC or SA. This is a different classification from region, which is UN M49 statistical geography, and the two genuinely disagree for some entries (Cyprus is region asia but continent EU).
example: EU
ccTLD string Country-code top-level domain recorded by GeoNames, leading dot included. Every entry has one. The United Kingdom's is .uk, not .gb; Saint Barthélemy (BL) and Saint Martin (MF) both carry Guadeloupe's .gp because .bl and .mf have never been delegated.
example: .dk
languageTags string[] GeoNames' raw language column split on commas: mostly ISO 639-1 alpha-2, ISO 639-2/-3 alpha-3 (including collective codes such as cau and tut) where no alpha-2 exists, each optionally carrying an ISO 3166-1 region subtag. Not validated against the IANA Language Subtag Registry and far broader than the languages field. Empty for AQ, BV and HM.
example: ["da-DK","en","fo","de-DK"]
/api/countries/lookup?code=DK {
"data": {
"name": "Denmark",
"code": "DK",
"alpha3": "DNK",
"numeric": "208",
"capital": "Copenhagen",
"region": "europe",
"subregion": "Northern Europe",
"currencyCode": "DKK",
"languages": [
"Danish"
],
"callingCode": "+45",
"flagEmoji": "🇩🇰",
"latitude": 55.942,
"longitude": 8.9969,
"areaSqKm": 43094,
"continent": "EU",
"ccTLD": ".dk",
"languageTags": [
"da-DK",
"en",
"fo",
"de-DK"
]
},
"meta": {
"endpoint": "countries",
"route": "/lookup",
"params": {
"code": "DK"
},
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries/lookup?code=dnk {
"data": {
"name": "Denmark",
"code": "DK",
"alpha3": "DNK",
"numeric": "208",
"capital": "Copenhagen",
"region": "europe",
"subregion": "Northern Europe",
"currencyCode": "DKK",
"languages": [
"Danish"
],
"callingCode": "+45",
"flagEmoji": "🇩🇰",
"latitude": 55.942,
"longitude": 8.9969,
"areaSqKm": 43094,
"continent": "EU",
"ccTLD": ".dk",
"languageTags": [
"da-DK",
"en",
"fo",
"de-DK"
]
},
"meta": {
"endpoint": "countries",
"route": "/lookup",
"params": {
"code": "DNK"
},
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries/lookup?code=JPN&fields=name,callingCode,currencyCode {
"data": {
"name": "Japan",
"callingCode": "+81",
"currencyCode": "JPY"
},
"meta": {
"endpoint": "countries",
"route": "/lookup",
"params": {
"code": "JPN"
},
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} /api/countries/lookup?code=JP&fields=name,areaSqKm,continent,ccTLD,languageTags {
"data": {
"name": "Japan",
"areaSqKm": 377835,
"continent": "AS",
"ccTLD": ".jp",
"languageTags": [
"ja"
]
},
"meta": {
"endpoint": "countries",
"route": "/lookup",
"params": {
"code": "JP"
},
"generatedAt": "2026-09-15T19:47:18.000Z"
}
} The complete set of 249 officially assigned ISO 3166-1 entries — countries and dependent territories — with alpha-2, alpha-3 and zero-padded numeric codes. The user-assigned XK code is deliberately excluded because it is not an officially assigned ISO 3166-1 entry.
The code fields are checked against ISO 3166-1 and UN Statistics M49. region and subregion follow M49's statistical geography where it assigns one; Antarctica and Taiwan use their conventional geographic placement where the M49 table does not provide a grouping. This means statistically assigned territories can appear under a region that differs from their physical continent — the API returns the reference classification rather than silently inventing one.
Codes and names are reproduced exactly as published by the source cited on this page; randomapi.dev takes no position on the sovereignty or territorial status of any country, territory or subdivision, and the presence, absence or nesting of any entry implies none.
The two reference endpoints built on this same key space state it identically: /api/country-borders for land adjacency and /api/country-subdivisions for ISO 3166-2.
Supplemental fields are deliberately explicit about their limits:
Four columns are joined from a pinned GeoNames countryInfo.txt snapshot (CC BY 4.0), covering all 249 entries:
null for UM (United States Minor Outlying Islands), the one entry GeoNames prints as 0; a literal zero is never returned. /api/country-stats also publishes a surfaceArea series, and it is not the same number: that one is the World Bank's FAO-sourced figure, which includes some coastal waters and excludes Greenland's ice sheet, so the two disagree by more than 5% for 28 of the 215 countries both cover — Bermuda is 53 km² here and 4,290 there, Greenland 2,166,086 against 410,450. Use this field for a stable geographic constant and that one for the World Bank's dated, revisable series.AF, AN, AS, EU, NA, OC, SA) and is deliberately distinct from region, which is UN M49 statistical geography. They disagree on purpose, and not only at the edges: Cyprus is region: "asia" but continent: "EU"; M49's single americas spans NA, SA and AN (Bouvet Island and South Georgia are filed under South America statistically but are physically Antarctic); and five entries sit on continent AN where only one carries region: "antarctic". Both classifications are published unchanged rather than reconciled into one invented answer — pick the one your product actually means.. + their alpha-2: the United Kingdom is .uk (not .gb), and Saint Barthélemy (BL) and Saint Martin (MF) both carry Guadeloupe's .gp, because .bl and .mf have never been delegated.cau and tut), and may carry an ISO 3166-1 region subtag (en-GB). It is not validated against the IANA Language Subtag Registry and is not the same list as languages: India carries 26 tags here — the broadest row in the column — against two languages labels, and Russia 23 against one. It is empty for the three entries GeoNames records no language for (AQ, BV, HM).Two countryInfo.txt columns are deliberately left out. Population is not published here at all: the upstream column is stale and of mixed vintage (Afghanistan still carries its 2018 figure) and carries no observation year, and a population without the year it was observed is a number you cannot check. The postal-code regex column is rejected on accuracy grounds — 31 of its rows contradict their own mask — and /api/postal-code-formats derives every published pattern from the mask instead.
The list route is alphabetical by default, and region, continent and search each genuinely restrict every returned record and compose with one another. minArea/maxArea bound areaSqKm in square kilometres; because an entry with an unknown area cannot be proven to satisfy a bound, the one null-area entry is excluded whenever either bound is set, and the response says so in meta.warnings. A minArea above maxArea is a 400 naming both values. sort accepts name (the default alphabetical order), area-desc and area-asc; area sorts break ties in alphabetical order and put unknown-area entries last in both directions. count limits the already-filtered, already-sorted list, so ?sort=area-desc&count=10 is the ten largest.
The lookup route accepts either alpha-2 or alpha-3, case-insensitively. Unknown codes return a 404 with a nearby-code hint when possible — never a substitute country.
Yes — it contains all 249 officially assigned alpha-2, alpha-3 and numeric entries. The user-assigned XK code is excluded because it is not an official ISO 3166-1 assignment.
Yes — /api/countries/lookup?code=DK and ?code=DNK return the same Denmark record, case-insensitively. A well-formed unknown code returns 404, never a nearby record.
Use region=africa|americas|asia|europe|oceania|antarctic for UN M49 geography, and search= for a case- and diacritic-insensitive match on the common English name. They compose with the continent and area filters, and count limits the already-filtered list.
No — each is a deterministic label-safe point inside the entry's largest or main land unit, designed for useful lightweight map pins. The capital is separate, and entries without one return null.
region is UN M49 statistical geography; continent is the GeoNames physical code (AF, AN, AS, EU, NA, OC, SA). They disagree on purpose — Cyprus is region: asia but continent: EU, and M49's single americas spans NA, SA and AN. Both filters work independently and compose.
Yes — minArea and maxArea bound areaSqKm in square kilometres and sort=area-desc or sort=area-asc orders the result, so ?sort=area-desc&count=10 is the ten largest. Areas are GeoNames figures; the one entry with no published area returns null and is excluded whenever an area bound is set.
31,000+ world cities from a pinned GeoNames snapshot: coordinates, IANA timezone, elevation, population and capital flag — filter, search or rank by distance.
Population, GDP, life expectancy and five more World Bank indicators for 215 countries, 1960–2025: latest value, one year, a full annual series or a ranking.
Every active ISO 4217 currency — code, name, symbol, minor-unit decimals and the countries using it. Search the list or look up one code, with honest 404s.
Real public holidays for 61 countries, computed from official national rules — list a year, check a date, or get the next upcoming holiday.
Land neighbours for all 250 countries and territories, published border lengths in km, the 45 landlocked entries and shortest land-border paths.
ISO 3166-2 states, provinces and regions: 5,046 subdivision codes for 200 countries, with English names, parent codes and an auditable per-country index.