Sample JSON / Countries
Sample Countries JSON
Twenty countries with ISO codes, capitals, continents, real population figures, and currencies - reference-style data for dropdowns, maps, and localization exercises.
https://jsonconsole.com/api/countries.json20 records3 KBCORS: *
Download countries.json·Free for any use, no attribution required (CC0). Endpoint is stable - safe to use in tutorials and READMEs.
Preview
[
{
"name": "Germany",
"code": "DE",
"capital": "Berlin",
"continent": "Europe",
"population": 83200000,
"currency": "EUR"
},
{
"name": "Japan",
"code": "JP",
"capital": "Tokyo",
"continent": "Asia",
"population": 125700000,
"currency": "JPY"
},
{
"name": "United States",
"code": "US",
"capital": "Washington, D.C.",
"continent": "North America",
"population": 331900000,
"currency": "USD"
}
]First 3 records shown - the full file has 20 records.
Fields
| Field | Type | Notes |
|---|---|---|
| name / code | string | Country name + ISO 3166-1 alpha-2 |
| capital | string | Capital city |
| continent | string | Continent name |
| population | number | Approximate real figures |
| currency | string | ISO 4217 code |
Fetch it in code
JavaScript
const res = await fetch(
"https://jsonconsole.com/api/countries.json"
);
const data = await res.json();Python
import requests
data = requests.get(
"https://jsonconsole.com/api/countries.json"
).json()What this dataset is good for
- Country dropdowns and autocomplete inputs
- Number formatting exercises (large populations, currencies)
- Grouping demos: countries by continent
More sample data
You might also need
Free and in-browser, like everything on JSON Console. Browse all tools →
Mock JSON GeneratorPaste one sample record and generate up to 1,000 mock records with the same structureJSON to CSVPaste a JSON array of objects on the left and get a spreadsheet-ready CSV with headers on the rightJSON to SQLPaste a JSON array and get a CREATE TABLE statement with inferred column types plus one INSERT per rowJSON ViewerExplore documents as tree, table, or graph.JSON FormatterFormat and validate with code, tree, table, and graph views.JSON ComparePaste two JSON documents and see only real differencesJWT DecoderPaste a JWT and instantly see its decoded header and payload with expiry statusJSON to TypeScriptPaste an API response and get TypeScript interfacesJSON MinifyPaste formatted JSON and get the smallest valid version