Free JSON API — 28 indicators across 195 countries
No auth required CORS enabled Updated weekly
https://countryxray.com/api/v1
Full country data: metadata + all 28 indicators (latest values) + democracy scores + 10-year trends.
Global ranking for one indicator across all countries.
| Key | Description |
|---|---|
gdp | GDP (current US$) |
gdp_per_capita | GDP per capita (current US$) |
gdp_growth | GDP growth (annual %) |
population | Total population |
unemployment | Unemployment (% of labor force) |
inflation | Inflation, consumer prices (annual %) |
trade_pct_gdp | Trade (% of GDP) |
fdi_pct_gdp | Foreign direct investment (% of GDP) |
gini | Gini index (inequality) |
govt_debt_pct | Government debt (% of GDP) |
literacy | Adult literacy rate (%) |
internet_users | Internet users (% of population) |
| Key | Description |
|---|---|
life_expectancy | Life expectancy at birth (years) |
healthy_life_expectancy | Healthy life expectancy / HALE (years) |
fertility_rate | Fertility rate (births per woman) |
neonatal_mortality | Neonatal mortality (per 1,000 live births) |
maternal_mortality | Maternal mortality ratio (per 100,000) |
under5_mortality | Under-5 mortality (per 1,000 live births) |
physicians_per_1000 | Physicians per 1,000 people |
health_spending_pct | Health expenditure (% of GDP) |
| Key | Description |
|---|---|
co2_per_capita | CO2 emissions (metric tons per capita) |
Democracy scores are on a 0–1 scale (higher = more democratic, except corruption where higher = more corrupt).
| Key | Description |
|---|---|
electoral | Electoral Democracy Index |
liberal | Liberal Democracy Index |
participatory | Participatory Democracy Index |
deliberative | Deliberative Democracy Index |
egalitarian | Egalitarian Democracy Index |
corruption | Political Corruption Index |
rule_of_law | Rule of Law Index |
press_freedom | Freedom of Expression & Alt Info |
All responses are JSON with Cache-Control: public, max-age=3600 and CORS headers.
GET /api/v1/countries/JPN
{
"country": {
"iso3": "JPN",
"name": "Japan",
"capital": "Tokyo",
"region": "Asia",
"population": 125124989,
"flag_emoji": "🇯🇵",
...
},
"indicators": [
{ "indicator": "gdp", "year": 2023, "value": 4212945070000, "source": "worldbank" },
{ "indicator": "life_expectancy", "year": 2022, "value": 84.8, "source": "worldbank" },
...
],
"democracy": {
"year": 2024, "electoral": 0.88, "liberal": 0.84,
"corruption": 0.12, "rule_of_law": 0.93, ...
},
"trends": [
{ "indicator": "gdp_per_capita", "year": 2015, "value": 34524 },
{ "indicator": "gdp_per_capita", "year": 2016, "value": 38761 },
...
]
}
| Source | Indicators | Update Frequency | License |
|---|---|---|---|
| World Bank | 16 | Quarterly | CC BY 4.0 |
| WHO GHO | 5 | Annual | CC BY-NC-SA 3.0 IGO |
| V-Dem | 8 | Annual (March) | Free, cite required |
| REST Countries | Metadata | On change | MPL 2.0 |
None. The API is free and open. Please be reasonable — if you need bulk data, use the /api/v1/countries endpoint to get all countries in one call.
If you use this API, a link back to countryxray.com is appreciated but not required.