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.json
20 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

FieldTypeNotes
name / codestringCountry name + ISO 3166-1 alpha-2
capitalstringCapital city
continentstringContinent name
populationnumberApproximate real figures
currencystringISO 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 →