← Back to Home

Data Access

Access country data programmatically

JSON Data Files

All country data is available as JSON files in our GitHub repository. Each country has its own JSON file containing comprehensive information about geography, demographics, government, economy, and more.

Browse Data Files →

Data Structure

Each country JSON file contains the following sections:

  • Introduction - Background and history
  • Geography - Location, area, climate, terrain, resources
  • People and Society - Population, languages, religions, demographics
  • Government - Government type, capital, leaders, legal system
  • Economy - GDP, industries, trade, employment
  • Communications - Internet, phones, broadcast media
  • Transportation - Airports, railways, roadways, ports
  • Military - Armed forces, expenditure, service age

Example Usage

Fetch country data directly from the raw GitHub content:

// Fetch United States data
const response = await fetch(
  'https://raw.githubusercontent.com/Jeff-Kazzee/open-world-factbook/master/data/north-america/us.json'
);
const data = await response.json();

console.log(data.Government.Capital.name.text);
// Output: "Washington, D.C."

Region Folders

Data is organized by region:

/data/africa//data/antarctica//data/australia-oceania//data/central-america-n-caribbean//data/central-asia//data/east-n-southeast-asia//data/europe//data/middle-east//data/north-america//data/oceans//data/south-america//data/south-asia/

License

All data is in the public domain and free to use for any purpose - commercial or non-commercial, with or without attribution.