Back to EODHD APIs in Google Sheets
SheetXAI logo
EODHD APIs logo
EODHD APIs · Google Sheets Guide

Pull Macroeconomic Indicators Into a Google Sheet for Country Comparison

2026-05-14
5 min read

The Scenario

You've been asked to contribute a regional economic comparison section to a research report due Thursday. The section needs GDP growth, CPI inflation, and unemployment rates for 15 countries over the past decade — organized in a Google Sheet that the lead economist can hand off directly to the designer. The data exists on EODHD. What doesn't exist yet is the sheet.

The bad version:

  • Pull up the EODHD macro data endpoint documentation, figure out which indicator codes map to GDP growth vs. GDP level, make a test API call to confirm the response structure.
  • Write or adapt a script to loop over 15 country codes, call three separate indicator endpoints per country, and reshape 45 API responses into rows and columns that align by year.
  • Discover partway through that two countries use fiscal-year reporting rather than calendar-year, which means the annual values land in the wrong column when you align by December.

The report deadline is Thursday. You've just spent most of Tuesday on data plumbing.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads your country list, calls the EODHD macroeconomic endpoints for each indicator and country, and builds the annual comparison table — no endpoint documentation, no loop, no response reshaping required.

For each country code in column A of my 'Macro Data' sheet, pull GDP growth, inflation rate, and unemployment data for the past 10 years from EODHD and write the annual values into columns B onward.

What You Get

  • One row per country per year, or one column per year with country rows — depending on how the sheet is structured
  • Three indicator columns per year grouping: GDP growth %, CPI %, unemployment %
  • Any country/year combination with missing data left blank rather than filled with a zero that would distort averages
  • Years in descending order by default, matching how analysts typically scan the table

What If the Data Is Not Quite Ready

The country list uses full names, not ISO codes

Column A has "Germany," "South Korea," "Brazil" — not "DEU," "KOR," "BRA." EODHD's macro endpoints want ISO alpha-3 codes.

Convert each country name in column A of my 'Macro Data' sheet to its ISO alpha-3 code and write it into column B, then use those codes to pull GDP growth, inflation, and unemployment from EODHD for the past 10 years.

You need to add a currency-adjusted GDP per capita column

The comparison needs GDP per capita in constant 2015 USD for comparability across the income distribution.

For each country in column A of my 'Macro Data' sheet, pull GDP per capita in constant 2015 USD from EODHD for each year in the past decade and write it into a new column alongside the existing indicators.

Some countries have gaps in the time series

A few emerging market countries have missing years in the EODHD dataset, which breaks the chart the designer is building from the sheet.

For each country in column A of my 'Macro Data' sheet, pull the 10-year macro series from EODHD, and for any years where data is missing, interpolate the value as the average of the surrounding years and mark the interpolated cells in yellow.

Full report-ready prep: pull, normalize, flag outliers, and build summary row

Pull GDP growth, inflation, and unemployment for all 15 countries in my 'Macro Data' sheet from EODHD for the past 10 years, normalize each indicator to a 0–100 index relative to the group, flag any country-year with a value more than 2 standard deviations from the group mean in red, and add a final row showing the unweighted average for each indicator by year.

One prompt. Clean table ready to hand to the designer.

Try It

Get the 7-day free trial of SheetXAI and open any Google Sheet with a country or region list, then ask it to pull the macro series from EODHD. From there, you can also ask it to pull yield curve data for fixed-income analysis or return to the EODHD APIs hub.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more