Use FXMacroData in Google Sheets
Pull macroeconomic indicators, FX rates, commodities, release calendars, and catalogue metadata into spreadsheet cells with FXMacroData custom functions or the sidebar importer.
Current status
The Apps Script add-on source is prepared for test deployment and Marketplace review. A public install URL will be added after Google approval.
Auth model
Public USD, catalogue, calendar, and FX examples can run without a key. Protected endpoint families use a key saved in the sidebar.
Data shape
Functions return spill ranges. The sidebar importer writes the same tabular data into the selected output range.
How a user connects the API today
1. Create an API key
Sign in to FXMacroData, open API management, and generate a key for the account or subscription.
2. Save it in Sheets
Open the FXMacroData menu, choose Settings, paste the key, then use Test Key. The key is stored per Google user, not shared with sheet collaborators.
3. Use formulas
Start with public USD and FX formulas, then use the saved key for non-USD indicators and commodities.
=FXMACRO_INDICATOR("usd","inflation")
=FXMACRO_INDICATOR("eur","inflation","2024-01-01")
=FXMACRO_COMMODITY("gold","2024-01-01")
4. Import from the sidebar
Select an empty cell, open the FXMacroData sidebar, choose a dataset, and click Insert at selected cell to write a static table.
5. Direct HTTP access
Outside the add-on, the same key works as an `api_key` query parameter or `X-API-Key` header.
https://fxmacrodata.com/api/announcements/eur/inflation?api_key=YOUR_API_KEY
Custom functions
Each function returns a table. Indicator, FX, and commodity functions auto-page API responses in batches of 100 rows up to the requested row cap.
| Function | Purpose | Example |
|---|---|---|
FXMACRO_INDICATOR |
Macro indicator time series such as inflation, GDP, unemployment, and policy rates. | =FXMACRO_INDICATOR("usd","inflation") |
FXMACRO_FOREX |
FX spot-rate history for currency pairs. | =FXMACRO_FOREX("eur","usd","2024-01-01") |
FXMACRO_COMMODITY |
Commodity and energy series such as gold, WTI oil, Brent oil, and natural gas. | =FXMACRO_COMMODITY("gold") |
FXMACRO_CALENDAR |
Upcoming economic release dates for a currency. | =FXMACRO_CALENDAR("usd") |
FXMACRO_CATALOGUE |
Available indicator slugs and metadata for a currency. | =FXMACRO_CATALOGUE("aud") |
API endpoints behind the formulas
The add-on calls the same production API documented on this site.
https://fxmacrodata.com/api/announcements/usd/inflation https://fxmacrodata.com/api/forex/eur/usd https://fxmacrodata.com/api/commodities/gold https://fxmacrodata.com/api/calendar/usd https://fxmacrodata.com/api/data_catalogue/usd
Marketplace path
The Google Workspace Marketplace listing needs a linked standard Cloud project, OAuth consent, a versioned Apps Script deployment, screenshots, support links, and Google review.
After approval, users will install from Marketplace and then connect their FXMacroData API key from the sidebar. Public support and Marketplace contact metadata should use [email protected].