Track country economic indicators in Google Sheets, refreshed monthly

On the first of every month, pull the latest World Bank values for the countries and indicators you list and append them to your tracking sheet in tidy long format.

Deterministic Code
World BankGoogle SheetsOperationsFinanceData SyncResearch & Monitoring

On the first day of every month at 06:00, refresh a "country indicators" tracking sheet in Google Sheets with the latest World Bank values. This is a deterministic ETL pipeline with no judgement step.

Trigger: cron, monthly on the 1st at 06:00. Workflow type: code (discrete nodes, deterministic flow).

Inputs the workflow should expose: the Google Sheets spreadsheet ID, the name of the config tab (default "config"), and the name of the data tab (default "data").

Step 1. Read the configuration tab from Google Sheets using the Get Values operation. The config tab has a header row and three columns starting in row 2: country_code (ISO 3-letter, e.g. USA, BRA, EUU), indicator_code (e.g. NY.GDP.MKTP.CD), and indicator_label (a human-friendly name like "GDP, current US$"). Read the full range to learn which (country, indicator) pairs to refresh on this run.

Step 2. For each (country_code, indicator_code) pair from the config tab, call World Bank's Get Indicator Data operation. Pass mrnev=1 so the API returns only the most recent non-empty observation along with its year. Also pass format=json and a generous per_page. Important: World Bank JSON responses are a two-element array shaped [meta, rows], so destructure both halves and read the value, date (year), and country.value (country name) from the first row. If the response has no rows or value is null, skip the pair instead of appending a blank row.

Step 3. Append one row per successful pair to the data tab using Google Sheets' Append Values operation. Use long/tidy format with these columns in this order: country_code, country_name, indicator_code, indicator_label, year, value, fetched_at. fetched_at is the workflow run timestamp in ISO 8601. Append only, never overwrite, so history accumulates over each monthly run. Use valueInputOption USER_ENTERED so numbers and dates are parsed by Sheets.

Keep the long format (one observation per row) so analysts can pivot the sheet however they like. Both integrations are world-bank (Get Indicator Data) and google-sheets (Get Values, Append Values). No auth is required for World Bank; Google Sheets uses OAuth.

Additional information

What does this prompt do?
  • On the first of every month at 6am, reads your list of countries and indicators from a config tab in your Google Sheet.
  • Looks up the most recent World Bank value for each country and indicator pair, along with the year that value comes from.
  • Appends a new row per pair to your data tab, so history builds up over time and nothing is overwritten.
  • Lands the data in tidy long format (one row per country, indicator, year, value) so you can pivot, chart, or join it however you like.
What do I need to use this?
  • A Google account with edit access to the tracking spreadsheet.
  • A Google Sheet with two tabs: a config tab listing the countries and indicators to track, and a data tab where new rows will be appended.
  • No World Bank login. The World Bank data API is free and public.
How can I customize it?
  • Change the schedule. Run weekly, quarterly, or on a specific weekday instead of the 1st of the month.
  • Edit the config tab to add or remove countries and indicators without touching the workflow itself.
  • Pull a longer history instead of just the latest reading, for example the last 5 or 10 years of each series.

Frequently asked questions

Where do I find World Bank country and indicator codes?
Country codes are the standard ISO 3-letter codes (USA, IND, BRA, etc.). Indicator codes come from the World Bank data catalog. For example, NY.GDP.MKTP.CD is GDP in current US dollars. You can browse all of them at data.worldbank.org.
Will this overwrite the data already in my sheet?
No. The workflow only appends new rows after the last row of your data tab, so every previous refresh is preserved and you can see how each indicator has changed over time.
What happens if World Bank has no recent value for a country and indicator?
The workflow asks for the most recent non-empty value, so even if last year is missing it returns the latest reading available. If a series has never had data for that country, the pair is skipped instead of writing a blank row.
Can I track aggregates like the European Union or World totals?
Yes. World Bank treats regions and income groups as countries with their own codes (EUU for European Union, WLD for World, OED for OECD members, and so on). Just add the code to your config tab.
Do I need a paid plan for any of this?
No. Google Sheets works on any Google account, and the World Bank data API is free, public, and does not require signup.

Stop pasting World Bank values into your sheet every month.

Connect Google Sheets once, list the countries and indicators you care about, and the latest values land in your tracker on the first of every month.