Build macroeconomic research apps, dashboards and trading workflows with FXMacroData. These runnable projects show how to use official economic observations, release calendars and market data across Python, web and backtesting frameworks.
Subscribe to FXMacroData for non-USD data, full available history, FX, commodities and positioning. Use the public USD workflow to evaluate these projects before connecting your subscription.
Public USD catalogue, recent macro history and calendar queries support evaluation without an API key. Protected datasets require a key from an authorized FXMacroData subscription.
| App | Framework | Hosted on |
|---|---|---|
| Central Bank Rate Monitor | Streamlit | Streamlit Community Cloud |
| FX Trade Setup Studio | Web (Vanilla JS) | GitHub Pages / Netlify / Vercel Static |
| FX & Macro Explorer | Gradio | Hugging Face Spaces |
| FX Macro Heatmap | Plotly Dash | Render |
| Conversational FX Macro Monitor | Plotly Dash + Dash MCP | Render |
| Macro Intelligence Dashboard | HoloViz Panel | Hugging Face Spaces |
| FX Market Intelligence | Next.js | Vercel |
| USD Macro Snapshot API | FastAPI | Railway/Render/Fly.io |
| USD Macro Landing App | Flask | Render/Railway |
| Edge Macro Widget Proxy | Cloudflare Worker | Cloudflare |
| Netlify Macro Widget | Netlify Functions + static | Netlify |
| Policy Rate Divergence | Backtrader | Local script |
| Policy Rate Divergence | Zipline | Local script |
| Macro Signal (BTC/USDT) | Freqtrade | Local strategy |
| FX Strategy Backtesting | VectorBT (Jupyter) | Run locally / JupyterHub |
| Macro Data Access | pandas-datareader | Local script |
| Macro Carry Scanner | CCXT | Local script |
| Carry Rebalance Bot | Blankly | Local strategy |
Never commit or print real API keys. Use only these patterns:
- Environment variables (
FXMACRODATA_API_KEY) - Host-level encrypted secrets (Vercel/Netlify/Render/Cloudflare)
.env.exampletemplates only (never real.envfiles)- Optional user-entered key fields that stay in memory only
Before publishing, run a scan:
grep -RInE "(sk-|AIza|FXMACRODATA_API_KEY\s*=\s*['\"][^'\"]+)" . || trueUse FXMacroData as a custom data source inside QuantConnect backtests and live-trading algorithms.
cd quantconnect # copy fxmacrodata/ into your LEAN projectSee quantconnect/README.md for setup instructions and two
example algorithms:
- Macro Monitor — plot USD indicators in QuantConnect charts (free, no key)
- Policy Rate Divergence — FX carry strategy driven by central-bank rate differentials
Use FXMacroData as a macro signal source inside Freqtrade strategies.
cd freqtrade
cp fxmacrodata_ft.py MacroSignalStrategy.py \
~/.freqtrade/user_data/strategies/
freqtrade backtesting --strategy MacroSignalStrategy --timeframe 1d \
--timerange 20200101-20251231 --pair BTC/USDTSee freqtrade/README.md for setup and the included
Macro Signal strategy (BTC/USDT driven by the USD real policy rate).
Use FXMacroData as a custom bundle and macro data source inside zipline-reloaded backtests.
cd zipline && pip install -r requirements.txt && python example.pySee zipline/README.md for setup and the included
Policy Rate Divergence strategy (EUR/USD carry driven by central-bank rate
differentials).
Use FXMacroData through the CCXT unified interface. The adapter implements the standard CCXT exchange API so you can plug FXMacroData into any existing CCXT-based trading or analysis workflow.
cd ccxt && pip install -r requirements.txt && python example.pySee ccxt/README.md for setup and usage. Supported CCXT
methods:
load_markets()— 30 FX pairs + XAU/USD, XAG/USD, XPT/USDfetch_ohlcv(symbol, '1d', since, limit)— daily mid-market candlesfetch_ticker(symbol)/fetch_tickers(symbols)— latest ratesfetch_macro_indicator(currency, indicator)— macro extension
# Python apps (pick one)
cd streamlit && pip install -r requirements.txt && streamlit run app.py
cd gradio && pip install -r requirements.txt && python app.py
cd dash && pip install -r requirements.txt && python app.py
cd dash-mcp && pip install -r requirements.txt && python app.py
cd panel && pip install -r requirements.txt && panel serve app.py --autoreload
cd flask && pip install -r requirements.txt && python app.py
cd fastapi && pip install -r requirements.txt && uvicorn app:app --reload --port 8010
cd backtrader && pip install -r requirements.txt && python example.py
cd zipline && pip install -r requirements.txt && python example.py
cd freqtrade # copy fxmacrodata_ft.py + MacroSignalStrategy.py into user_data/strategies/
# pandas-datareader
cd pandas-datareader && pip install -r requirements.txt && python example.py
# VectorBT Jupyter notebook
cd vectorbt && pip install -r requirements.txt && jupyter notebook fxmacrodata_vectorbt.ipynb
# CCXT macro scanner
cd ccxt && pip install -r requirements.txt && python example.py
# Next.js app
cd vercel && npm install && npm run dev
# Netlify app
cd netlify-widget && npm install && npm run dev
# FX Trade Setup Studio (static app)
cd pollinations/fx-trade-setup-studio && python -m http.server 8080
# Cloudflare Worker
cd cloudflare-worker && npm install && npm run dev
# QuantConnect / LEAN — copy the fxmacrodata/ package into your LEAN project
# then follow quantconnect/README.md- Fork this repo (or push
streamlit/to your own public repo). - Go to share.streamlit.io, sign in with GitHub.
- New app → select repo → set main file to
streamlit/app.py. - Click Deploy.
- Create a Space at huggingface.co/spaces → SDK: Gradio.
- Upload
gradio/app.pyandgradio/requirements.txt. - Space builds automatically.
- Fork this repo.
- Go to render.com → New Web Service → connect repo.
- Set root directory to
dash/, start command:gunicorn app:server. - Or use the included
render.yamlblueprint: New → Blueprint → connect repo.
- Fork this repo.
- Go to render.com → New Web Service → connect repo.
- Set root directory to
dash-mcp/, start command:gunicorn app:server. - Add
FXMACRODATA_API_KEYas an environment variable for protected FX spot history. - Connect MCP clients to
https://<your-service>.onrender.com/_mcp.
- Create a Space at huggingface.co/spaces → SDK: Docker.
- Upload
panel/app.py,panel/requirements.txt, andpanel/Dockerfile. - Space builds automatically.
cd vectorbt
pip install -r requirements.txt
jupyter notebook fxmacrodata_vectorbt.ipynbOr launch on any hosted Jupyter environment (Google Colab, JupyterHub, Binder)
by uploading fxmacrodata_vectorbt.ipynb and requirements.txt.
Or manually: vercel.com → Add New → Project → import repo → root directory: vercel/.
- Push
flask/orfastapi/to your public examples repo. - Create a new service on Render/Railway.
- Set start command:
- Flask:
gunicorn app:app - FastAPI:
uvicorn app:app --host 0.0.0.0 --port $PORT
- Flask:
- Add
FXMACRODATA_API_KEYas an environment variable only if you need protected endpoints.
- Import the repo into Netlify.
- Set base directory to
netlify-widget/. - Add optional environment variable:
FXMACRODATA_API_KEY. - Deploy and share your
.netlify.appURL.
- Deploy
cloudflare-worker/viawrangler deploy. - Add optional secret with
wrangler secret put FXMACRODATA_API_KEY. - Use the Worker URL from any frontend widget.
All apps accept an API key at runtime via a sidebar input. To pre-configure:
| Platform | Method |
|---|---|
| Streamlit Cloud | Settings → Secrets → FXMACRODATA_API_KEY = "key" |
| HF Spaces | Settings → Secrets → FXMACRODATA_API_KEY |
| Render | Environment → FXMACRODATA_API_KEY |
| Vercel | Settings → Environment Variables → FXMACRODATA_API_KEY |
Use FXMacroData as a drop-in data source inside any workflow that already uses pandas-datareader.
cd pandas-datareader && pip install -r requirements.txt && python example.pySee pandas-datareader/README.md for the full
guide and two usage patterns:
- Standalone readers —
FXMacroDataIndicatorReader,FXMacroDataForexReader,FXMacroDataCommoditiesReader,FXMacroDataCOTReader - DataReader interface — register once and use
pdr.DataReader("USD/inflation", "fxmacrodata", ...)
| Endpoint | Auth | Used by |
|---|---|---|
GET /v1/announcements/usd/{indicator} |
Free | Streamlit, Dash, Gradio, Panel |
GET /v1/announcements/{currency}/{indicator} |
API key | All |
GET /v1/forex/{base}/{quote} |
API key | Gradio, Backtrader, VectorBT, Dash MCP |
GET /v1/calendar/{currency} |
Free | Gradio, Vercel |
GET /v1/commodities/{indicator} |
API key | Panel, Vercel, Backtrader |
GET /v1/cot/{currency} |
API key | Vercel |
Full reference: fxmacrodata.com/documentation