The EODHD Macro Indicators API exposes 39 macroeconomic time series per country — GDP, inflation, unemployment, demographics, trade balances, debt ratios and more. Data is sourced from the World Bank World Development Indicators (WDI) and refreshed annually as the World Bank publishes new vintages. Most series start in 1960; the latest available year is typically the previous calendar year.

API Endpoint

https://eodhd.com/api/macro-indicator/{country}

Path Parameter

ParameterRequiredDescription
countryYesISO 3166-1 alpha-3 country code (e.g. USA, FRA, DEU, GBR, JPN). Case-insensitive — usa and USA are equivalent. World Bank aggregate codes are also accepted (see Country Codes section).

Query Parameters

ParameterRequiredDescription
api_tokenYesYour EODHD API token
indicatorNoIndicator key from the list below. Default is gdp_current_usd
fmtNoResponse format, json (default) or csv. Note that csv truncates decimal values to integers

Available Indicators

39 indicators are exposed. The Status column reflects how regularly the underlying World Bank series is updated and whether the data is suitable for current analysis. See Known Limitations for the indicators flagged as data issue or historical.

National Accounts and Growth

Indicator keyDescriptionStatus
gdp_current_usdGDP, current US$Active
gdp_per_capita_usdGDP per capita, current US$Active
gdp_growth_annualGDP growth, annual %Active
gni_usdGNI, Atlas method, current US$Active
gni_per_capita_usdGNI per capita, Atlas method, current US$Active
gni_ppp_usdGNI, PPP, current international $Active (from 1990)
gni_per_capita_ppp_usdGNI per capita, PPP, current international $Active (from 1990)
gross_capital_formation_percent_gdpGross capital formation, % of GDPActive
agriculture_value_added_percent_gdpAgriculture, value added, % of GDPActive (coverage varies by country)
industry_value_added_percent_gdpIndustry, value added, % of GDPActive (coverage varies by country)
services_value_added_percent_gdpServices, value added, % of GDPActive (coverage varies by country)

Prices and Inflation

Indicator keyDescriptionStatus
inflation_consumer_prices_annualInflation, consumer prices, annual %Active
consumer_price_indexConsumer Price Index, 2010 = 100Active
inflation_gdp_deflator_annualInflation, GDP deflator, annual %Active
real_interest_rateReal interest rate, %Stale — last update 2021, missing for several countries

Trade and External Sector

Indicator keyDescriptionStatus
net_trades_goods_servicesNet trades in goods and services, current US$Active
exports_of_goods_services_percent_gdpExports of goods and services, % of GDPActive
imports_of_goods_services_percent_gdpImports of goods and services, % of GDPActive
merchandise_trade_percent_gdpMerchandise trade, % of GDPActive
high_technology_exports_percent_totalHigh-technology exports, % of manufactured exportsActive (from 2007)

Government Finance and Debt

Indicator keyDescriptionStatus
debt_percent_gdpCentral government debt, % of GDPActive (limited country coverage)
revenue_excluding_grants_percent_gdpRevenue, excluding grants, % of GDPActive
cash_surplus_deficit_percent_gdpCash surplus/deficit, % of GDPHistorical — last update 2014. Values look implausible, see Known Limitations
total_debt_service_percent_gniTotal debt service, % of GNIActive for IBRD/IDA borrowers only — empty for high-income countries

Population and Demographics

Indicator keyDescriptionStatus
population_totalPopulation, totalActive
population_growth_annualPopulation growth, annual %Active
net_migrationNet migration, absolute value (5-year totals)Active
life_expectancyLife expectancy at birth, total yearsActive
fertility_rateFertility rate, total births per womanActive
prevalence_hiv_totalPrevalence of HIV, total, % of population ages 15-49Active for low- and middle-income countries — empty for the US and several high-income countries

Labour, Poverty and Income

Indicator keyDescriptionStatus
unemployment_total_percentUnemployment, total, % of labour forceActive
income_share_lowest_twentyIncome share held by lowest 20%, %Active (sparse — based on national household surveys)
poverty_poverty_lines_percent_populationPoverty headcount ratio at national poverty lines, % of populationSparse — based on national surveys, often only a handful of data points per country, empty for the US

Financial Markets and Business Environment

Indicator keyDescriptionStatus
market_cap_domestic_companies_percent_gdpMarket capitalization of listed domestic companies, % of GDPActive (coverage varies by country)
mobile_subscriptions_per_hundredMobile cellular subscriptions per 100 peopleActive
internet_users_per_hundredInternet users per 100 peopleHistorical — last update 2015. Values look implausible, see Known Limitations
startup_procedures_registerStart-up procedures to register a business, numberHistorical — World Bank discontinued the Doing Business programme in 2021. Final data point is 2019

Environment and Geography

Indicator keyDescriptionStatus
co2_emissions_tons_per_capitaCO2 emissions, metric tons per capitaStale — last update 2020. Values look implausible, see Known Limitations
surface_area_kmSurface area, sq. kmActive

Country Codes

The country path parameter accepts ISO 3166-1 alpha-3 codes — three letters, case-insensitive. Common examples: USA (United States), FRA (France), DEU (Germany), GBR (United Kingdom), JPN (Japan), CHN (China), IND (India), BRA (Brazil).

The endpoint also accepts World Bank aggregate codes, which return aggregated regional or income-group data. The most useful aggregates:

CodeAggregate
WLDWorld
EUUEuropean Union
EMUEuro area
OEDOECD members
LCNLatin America and Caribbean
SSFSub-Saharan Africa
EASEast Asia and Pacific
MEAMiddle East and North Africa

The full list of World Bank country and aggregate codes is published at api.worldbank.org/v2/country.

Request Example

URL
cURL
PHP
Python
R
Chat GPT
https://eodhd.com/api/macro-indicator/FRA?indicator=inflation_consumer_prices_annual&api_token=YOUR_TOKEN&fmt=json
curl --location "https://eodhd.com/api/macro-indicator/FRA?indicator=inflation_consumer_prices_annual&api_token=YOUR_TOKEN&fmt=json"
$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://eodhd.com/api/macro-indicator/FRA?indicator=inflation_consumer_prices_annual&api_token=YOUR_TOKEN&fmt=json',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'GET',
));

$data = curl_exec($curl);
curl_close($curl);

try {
    $data = json_decode($data, true, 512, JSON_THROW_ON_ERROR);
    var_dump($data);
} catch (Exception $e) {
    echo 'Error. '.$e->getMessage();
}
import requests

url = f'https://eodhd.com/api/macro-indicator/FRA?indicator=inflation_consumer_prices_annual&api_token=YOUR_TOKEN&fmt=json'
data = requests.get(url).json()

print(data)
library(httr)
library(jsonlite)

url <- 'https://eodhd.com/api/macro-indicator/FRA?indicator=inflation_consumer_prices_annual&api_token=YOUR_TOKEN&fmt=json'
response <- GET(url)

if (http_type(response) == "application/json") {
    content <- content(response, "text", encoding = "UTF-8")
    cat(content)
} else {
    cat("Error while receiving data\n")
}
New to coding? Our ChatGPT assistant can generate code in any language tailored to our API. Simply describe how you want to use our data, and get a working piece of code. Don’t forget to replace the API token with your own.

Try it now (it's free)!

How to use it (YouTube)

Response Format

The response is a JSON array of observations, one per year, ordered from newest to oldest. Each observation has the same shape regardless of the requested indicator:

[
  {
    "CountryCode": "FRA",
    "CountryName": "France",
    "Indicator": "Inflation, consumer prices (annual %)",
    "Date": "2024-12-31",
    "Period": "Annual",
    "Value": 1.999
  },
  {
    "CountryCode": "FRA",
    "CountryName": "France",
    "Indicator": "Inflation, consumer prices (annual %)",
    "Date": "2023-12-31",
    "Period": "Annual",
    "Value": 4.9296
  }
]
FieldTypeDescription
CountryCodestringISO 3166-1 alpha-3 country code (always returned in upper case, regardless of the case used in the request)
CountryNamestringCountry name in English, as published by the World Bank
IndicatorstringHuman-readable indicator name (e.g. “GDP (current US$)”). Matches the World Bank WDI indicator name verbatim
Datestring (date)End-of-period date in YYYY-MM-DD format. Always 12-31 for annual data
PeriodstringReporting period. Currently always “Annual” — no quarterly or monthly series are exposed
Valuenumber or nullIndicator value. Units depend on the indicator and are reflected in the Indicator name (US$, %, count, etc.)

An empty array [] is returned when the country code is recognised but no observations exist for the requested indicator. The same empty-array response is also returned when the country code is unknown — check that the country actually has data before treating an empty array as “no observations”.

Response Codes

CodeMeaning
200Success. The response body is a JSON array (possibly empty) or a CSV document
401Missing or invalid api_token
403Plan does not include access to the Macro Indicators API
404Indicator name is not recognised. The error message “Indicator or Country are Not Found.” is returned as plain text
429Rate limit exceeded

Known Limitations

  • Annual frequency only. All series are published at annual cadence. For quarterly or monthly macro releases (GDP nowcasts, CPI flash, central bank decisions), use the Economic Events Data API instead.
  • Refresh cadence depends on the source. The World Bank publishes WDI updates on an annual cycle, typically several months after the reference year ends. Expect the latest year to be one to two years behind the current calendar year for most series.
  • Country coverage is uneven across indicators. Several indicators are only collected for certain country groups: total_debt_service_percent_gni applies to IBRD/IDA borrowers; prevalence_hiv_total is empty for the US and some high-income countries; debt_percent_gdp coverage depends on whether the country reports to the IMF GFS database.
  • Historical-only indicators. startup_procedures_register, cash_surplus_deficit_percent_gdp and internet_users_per_hundred are exposed for backward compatibility but the underlying World Bank series stopped updating in 2019, 2014 and 2015 respectively. The Doing Business programme was discontinued by the World Bank in 2021.
  • Data quality flags. Three indicators currently return values that appear out of expected range: co2_emissions_tons_per_capita, internet_users_per_hundred and cash_surplus_deficit_percent_gdp. Treat these as unverified until the data feed is reviewed. Other indicators have been spot-checked against the World Bank WDI portal and match.
  • Unknown country codes return an empty array, not a 404. A request with an unrecognised country code (e.g. a two-letter ISO code, or a typo) returns HTTP 200 with an empty JSON array, identical to the response for a recognised country with no data. Validate the country code before issuing the request.
  • CSV output truncates decimals. The fmt=csv option emits integer-only values for the Value column. Use fmt=json (the default) if you need full precision.

Sign up & Get Data