Country geographic, demographic, and administrative information including ISO codes, capital city, region, population, area, languages, currency, and timezone. Used for country databases, internationalization, and geographic applications.
https://api.mockly.codes/countries?page=1&limit=10&count=10Configure your request and click Send Request to see the response here.
/countriesGet a collection of countries
/location/countries/countries/:idGet a single country by ID
/location/countries/:id/countries/metaGet resource metadata and schema
/location/countries/metaThe search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.
Search across all text fields:
GET https://api.mockly.codes/countries?q=laptopGET https://api.mockly.codes/countries?q=laptop&search_fields=name,descriptionsearch_fields, all text fields are searched// Get 10 countries
fetch('https://api.mockly.codes/countries?count=10')
.then(res => res.json())
.then(data => console.log(data));import requests
response = requests.get(
'https://api.mockly.codes/countries?count=10'
)
data = response.json()curl "https://api.mockly.codes/countries?count=10"fetch('https://api.mockly.codes/countries?nocache=true')idintegerrequiredUnique identifier for the country record
random_intnamestringrequiredOfficial name of the country
countrycodestringrequiredISO 3166-1 alpha-2 two-letter country code (e.g., US, GB, FR, DE)
country_codecode3stringISO 3166-1 alpha-3 three-letter country code (e.g., USA, GBR, FRA, DEU)
country_code3capitalstringName of the capital city of the country
capitalregionstringGeographic region or continent (e.g., Europe, Asia, Americas, Africa)
regionsubregionstringGeographic subregion (e.g., Western Europe, South Asia, North America)
subregionpopulationintegerTotal population of the country
populationareanumberTotal land area in square kilometers
arealanguagesarrayArray of official languages spoken in the country
languages_arraycurrencystringISO 4217 currency code used in the country (e.g., USD, EUR, GBP)
currency_codecalling_codestringInternational phone calling code (e.g., +1, +44, +33)
calling_codetimezonestringPrimary IANA timezone identifier for the country
timezoneflagstringURL to the country's flag image
flag_urluricountintegerNumber of items to return (default: 10, max: 100)
seedintegerSeed for reproducible data generation
nocachebooleanBypass cache and generate fresh data on every request