← Back to docs
endpoints
GET locci/geo/country/

All countries. Filter by continent using the continent_slug query parameter.

Locci Geography

Overview

Returns a paginated list of all countries in the database. Each record includes the country's name, slug, ISO 3166-1 alpha-2 and alpha-3 codes, numeric code, capital city, area (km²), population, top-level domain, currency code and name, phone prefix, and the parent continent. Also includes the list of official language codes and neighbouring country codes. Sourced from GeoNames country information.


Request parameters

Name Type In Required Description Example
continent_slug String Query Optional URL-friendly slug of a continent (e.g. north-america, europe). When supplied, the country list is filtered to return only countries on that continent. Obtain valid continent slugs from the continent list endpoint. north-america

Response fields

Name Type Nullable Description Example
area String Yes Total country area in square kilometres. 9984670
capital String Yes Name of the country capital city. Ottawa
continent String Yes Hyperlinked URL to the parent continent record. /locci/geo/continent/5/
continent_id String Primary key of the parent continent. 5
continent_name String Name of the parent continent. North America
continent_slug String URL-friendly continent name. north-america
currency_code String Yes ISO 4217 three-letter currency code. CAD
currency_name String Yes Full currency name. Dollar
equivalent_fips_code String Yes Equivalent FIPS code when the standard code differs.
fips String Yes FIPS 10-4 two-letter country code. CA
iso String Yes ISO 3166-1 alpha-2 two-letter country code. CA
iso_3 String Yes ISO 3166-1 alpha-3 three-letter country code. CAN
iso_numeric String Yes ISO 3166-1 numeric country code. 124
languages Array List of hyperlinked URLs to the official or widely spoken language records for this country. ["/locci/lang/language/12/"]
name String Yes Official country name. Canada
neighbours String Yes Comma-separated ISO alpha-2 codes of neighbouring countries. US
phone String Yes International dialling prefix (without the leading +). 1
pk Integer Database primary key of the country record. 38
population String Yes Country population as recorded in GeoNames. 37058856
postal_code_format String Yes Template for postal codes used in this country. @ = letter, # = digit. @#@ #@#
postal_code_regex String Yes Regular expression that validates a postal code for this country. ^([ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]) ?(\d[ABCEGHJKLMNPRSTVWXYZ]\d)$
slug String Yes URL-friendly country name. canada
tld String Yes Country-code top-level domain. .ca