FXMacroData Python SDK πŸπŸ“Š

MCP serverProductivity

fxmacrodata gives your AI access to macroeconomic and foreign exchange time-series data. Once added, your AI can look up economic indicators, check calendar events, and pull historical figures for currencies and commodities. This lets it answer economy and market questions using actual data.

Use FXMacroData Python SDK πŸπŸ“Š in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add FXMacroData Python SDK πŸπŸ“Š and connect your AI. About a minute.

Also: Claude Code Β· Cursor Β· Codex

Then ask your AI: use FXMacroData Python SDK πŸπŸ“Š to ping

Details

Available today. Use it from your connected AI after setup.

Add fxmacrodata to your AI, then ask for the figures you need, such as a recent indicator reading or a currency's rate history.

FXMacroData Python SDK πŸπŸ“ŠStart free

What your AI can do with it

  • Look up macroeconomic indicators and their historical values
  • Check economic calendar events
  • Retrieve COT (Commitments of Traders) data
  • Pull foreign exchange rate histories
  • Fetch commodity time-series data

Install FXMacroData Python SDK πŸπŸ“Š

The server’s own address, for the clients that take one directly. Or connect Ahel once and every client you use reads it from one address, with the account kept on Ahel rather than in each client’s config.

  • Claude Code

    claude mcp add --transport http --scope user fxmacrodata-python-sdk 'https://fxmacrodata.com/mcp'

    Run it once in your project, then open /mcp to approve any sign-in the server asks for.

  • Claude Desktop

    https://fxmacrodata.com/mcp

    Add a custom connector in Settings, paste this address, and approve the sign-in.

  • Cursor

    cursor://anysphere.cursor-deeplink/mcp/install?name=fxmacrodata-python-sdk&config=eyJ1cmwiOiJodHRwczovL2Z4bWFjcm9kYXRhLmNvbS9tY3AifQ==

    Open the link and Cursor adds the server at that address.

  • ChatGPT

    https://fxmacrodata.com/mcp

    In Settings, enable Developer mode, create an MCP app, and paste this address. Your plan and workspace must allow custom apps.

  • Codex

    codex mcp add fxmacrodata-python-sdk --url 'https://fxmacrodata.com/mcp'

    Run it once, then sign in with codex mcp login fxmacrodata-python-sdk if the server asks for an account.

From the project's README

As published by fxmacrodata/fxmacrodata in README.md.

The FXMacroData Python SDK provides a simple and efficient interface for fetching macroeconomic indicators, forex prices, release calendars, COT positioning, and commodity prices from FXMacroData.

Use synchronous and asynchronous clients to bring the data into research notebooks, backtests and applications.

Subscribe to FXMacroData for non-USD data, full available history, FX, commodities and positioning. Use the public USD workflow to evaluate the integration before connecting your subscription.


🌟 Features

  • Fetch:
    • Macroeconomic indicators β€” policy rates, inflation, GDP, unemployment, bond yields, and more: 97 distinct indicators across 656 endpoints
    • FX spot rates with optional technical indicators (SMA, RSI, MACD, Bollinger Bands)
    • Release calendars β€” upcoming economic data release dates
    • Data catalogue β€” discover available indicators per currency
    • COT data β€” CFTC Commitment of Traders positioning
    • Commodity prices β€” gold, silver, platinum
  • Evaluate with public USD macro data covering the most recent 90 days; connect your FXMacroData subscription for full available history.
  • FX spot-rate history through get_fx_price.
  • A key from an authorized FXMacroData subscription is required for protected datasets, including non-USD indicators, FX spot-rate history, COT, and commodities.
  • Full support for:
    • Synchronous client
    • Asynchronous client
  • Lightweight: depends only on requests and aiohttp.

πŸ“¦ Installation

Install from PyPI:

pip install fxmacrodata

Or install the latest version from GitHub:

pip install git+https://github.com/fxmacrodata/fxmacrodata.git

πŸ”§ Usage

Synchronous

from fxmacrodata import Client

client = Client(api_key="YOUR_API_KEY")

# Fetch macroeconomic indicators
data = client.get_indicator(
    "aud", "policy_rate",
    start_date="2023-01-01",
    end_date="2023-11-01"
)
print(data)

# Forex price endpoint
fx = client.get_fx_price("usd", "gbp", start_date="2025-01-01")
print(fx)

# Forex with technical indicators
fx = client.get_fx_price("eur", "usd", indicators="sma_20,rsi_14,macd")
print(fx)

# Release calendar
calendar = client.get_calendar("usd")
print(calendar)

# Data catalogue β€” discover available indicators
catalogue = client.get_data_catalogue("usd")
print(catalogue)

# COT positioning data
cot = client.get_cot("eur", start_date="2025-01-01")
print(cot)

# Commodity prices
gold = client.get_commodities("gold", start_date="2026-01-01")
print(gold)

Asynchronous

import asyncio
from fxmacrodata import AsyncClient

async def main():
    async with AsyncClient(api_key="YOUR_API_KEY") as client:
        # Fetch macroeconomic indicators
        data = await client.get_indicator("eur", "inflation")
        print(data)

        # Forex price endpoint
        fx = await client.get_fx_price("usd", "jpy")
        print(fx)

        # Release calendar
        calendar = await client.get_calendar("usd")
        print(calendar)

        # Data catalogue
        catalogue = await client.get_data_catalogue("usd")
        print(catalogue)

        # COT positioning
        cot = await client.get_cot("jpy")
        print(cot)

        # Commodity prices
        gold = await client.get_commodities("gold")
        print(gold)

asyncio.run(main())

Timeouts and errors

Every request has a 30-second timeout by default. Change it per client:

Client(api_key="YOUR_API_KEY", timeout=60)            # seconds
Client(api_key="YOUR_API_KEY", timeout=(3.05, 120))   # (connect, read)
AsyncClient(api_key="YOUR_API_KEY", timeout=60)       # total seconds

All errors are FXMacroDataError or one of its subclasses:

ExceptionRaised when
FXMacroDataAPIErrorThe API returns a non-200 status (.status_code is set).
FXMacroDataResponseErrorThe API returns 200 but the body is an error message or not a JSON object.
FXMacroDataTimeoutErrorThe request exceeds the timeout.
FXMacroDataTransportErrorThe connection fails (DNS, TLS, network).
FXMacroDataRedirectErrorA redirect would send your API key to a different origin, so it is refused.

Your API key is never included in error messages, and it is only sent over HTTPS to the origin you configured: redirects to another host or to plain HTTP are refused rather than followed with the key attached.


OpenBB Integration

FXMacroData supports all practical OpenBB integration paths from this package:

  • OpenBB Python: installable provider/router extension for obb.fxmacrodata.*.
  • OpenBB REST API: /api/v1/fxmacrodata/* routes through openbb-api.
  • OpenBB Workspace, generated: widgets generated by openbb-api from inline metadata.
  • OpenBB Workspace, custom: standalone backend serving widgets.json, apps.json, and data endpoints.
  • OpenBB MCP: tools exposed through openbb-mcp.
  • OpenBB CLI: commands available after openbb-build.

OpenBB packages require Python 3.10+. Install the OpenBB Python extra:

pip install "fxmacrodata[openbb]"
openbb-build

Then use FXMacroData from the OpenBB Python interface:

from openbb import obb

obb.user.credentials.fxmacrodata_api_key = "YOUR_API_KEY"

catalogue = obb.fxmacrodata.data_catalogue(
    currency="USD",
    provider="fxmacrodata",
).to_df()

inflation = obb.fxmacrodata.macro_indicators(
    currency="USD",
    indicator="inflation",
    start_date="2020-01-01",
    provider="fxmacrodata",
).to_df()

eurusd = obb.fxmacrodata.fx_historical(
    base="EUR",
    quote="USD",
    start_date="2024-01-01",
    provider="fxmacrodata",
).to_df()

Run the OpenBB REST API and generated Workspace backend:

pip install "fxmacrodata[openbb-api]"
openbb-build
fxmacrodata-openbb-api --host 127.0.0.1 --port 6900

Workspace can be connected to http://127.0.0.1:6900. The generated /widgets.json uses FXMacroData's inline OpenBB widget metadata.

Run the OpenBB Workspace custom backend:

pip install "fxmacrodata[workspace]"
fxmacrodata-openbb-backend

Default backend URL:

http://127.0.0.1:7779

Workspace exposes /widgets.json, /apps.json, /catalogue, /release_calendar, /macro_indicator, /forex, /cot, and /commodity. Swagger/OpenAPI docs are disabled by default for this backend. For local debugging only, set FXMACRODATA_OPENBB_ENABLE_DOCS=1 before starting it.

Run OpenBB MCP:

pip install "fxmacrodata[mcp]"
openbb-build
fxmacrodata-openbb-mcp --default-categories fxmacrodata --host 127.0.0.1 --port 8001

Run OpenBB CLI:

pip install "fxmacrodata[openbb-cli]"
openbb-build
openbb

See docs/openbb-integration.md for the full integration matrix and the separate upstream OpenBB repository contribution path.


πŸ“˜ API Overview

get_indicator(currency, indicator, start_date=None, end_date=None)

Fetches macroeconomic indicator time series data.

  • currency: "usd", "aud", "eur", "gbp", "cad", "nok", "nzd", "jpy", "brl", "cny", "dkk", "pln", "sek", "sgd", etc.
  • indicator: "policy_rate", "inflation", "gdp", "unemployment", "trade_balance", "current_account_balance", "gov_bond_10y", etc.
  • API key required for non-USD.

get_fx_price(base, quote, start_date=None, end_date=None, indicators=None)

Fetches daily FX spot rates between two currencies.

  • indicators: Optional comma-separated technical indicators β€” "sma_20", "sma_50", "sma_200", "rsi_14", "macd", "ema_12", "ema_26", "bollinger_bands", or "all".
  • API key required.

get_calendar(currency, indicator=None)

Fetches upcoming economic data release dates for a currency.

  • indicator: Optional filter to a specific indicator slug.
  • Returns announcement_datetime (Unix timestamp) and release (indicator slug).

get_data_catalogue(currency, include_capabilities=False, include_coverage=False, indicator=None)

Discovers available macroeconomic indicators for a given currency.

  • Returns a dict keyed by indicator slug with name, unit, frequency, and has_official_forecast.
  • API key required for non-USD.

get_cot(currency, start_date=None, end_date=None)

Fetches CFTC Commitment of Traders (COT) positioning data.

  • Supported currencies: AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD.
  • API key required for non-USD.

get_commodities(indicator, start_date=None, end_date=None)

Fetches commodity price time series.

  • indicator: "gold", "silver", or "platinum".
  • API key required.

πŸ’Ή Supported Currencies & Indicators

18 currencies supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.

The table below shows a sample of indicator coverage across four major currencies. Use get_data_catalogue() to discover the full list for any currency.

CategoryMetricUSDEURAUDGBP
EconomyGDP Growthβœ“βœ“βœ“βœ“
Inflation Rateβœ“βœ“βœ“βœ“
Trade Balanceβœ“βœ“βœ“βœ“
Current Account Balanceβœ“βœ“βœ“βœ“
Retail Salesβœ“βœ“βœ“βœ“
Industrial Productionβœ“β€”β€”β€”
Labor MarketUnemployment Rateβœ“βœ“βœ“βœ“
Employment Levelβœ“βœ“βœ“βœ“
Full-Time Employmentβœ“βœ“βœ“β€”
Part-Time Employmentβœ“βœ“βœ“βœ“
Participation Rateβœ“βœ“βœ“βœ“
Non-Farm Payrollsβœ“β€”β€”β€”
Monetary PolicyPolicy Rateβœ“βœ“βœ“βœ“
Risk-Free Rateβœ“βœ“βœ“βœ“
Central Bank Assetsβœ“β€”βœ“β€”
Government Bond Yields2-Year Govt Bondβœ“βœ“βœ“βœ“
5-Year Govt Bondβœ“βœ“βœ“βœ“
10-Year Govt Bondβœ“βœ“βœ“βœ“
Inflation-Linked Bondβœ“βœ“βœ“βœ“

πŸ“„ License

MIT License Β© FXMacroData


🌐 Links

Tools it offers (50)

What this server listed when Ahel dialed its public endpoint in Oct 2026, with no key and no account of yours. The names are the server’s own.

  • ping
  • mcp_capabilities
  • mcp_auth_guide
  • subscribe_for_mcp_access
  • data_catalogue
  • risk_sentiment
  • macro_news
  • release_calendar
  • release_calendar_visual_artifact
  • event_predictions
  • latest_announcements
  • announcement_changes
  • press_releases
  • macro_factor
  • fx_reference_sources
  • fx_reference_universe
  • fx_intraday_reference_rates
  • rate_curve
  • rate_differentials
  • latest_commodities
  • forex
  • seasonality
  • indicator_query
  • plot_visual_artifact
  • indicator_visual_artifact
  • forex_visual_artifact
  • commodities_visual_artifact
  • cot_visual_artifact
  • policy_rate_differential_visual_artifact
  • macro_briefing_task

Signals

GitHub stars
9
Forks
1
Last commit
Oct 2026
Advanced
Delivery
fxmacrodata MCP server β†’ your Ahel connector (mcp.ahel.ai) β†’ your AI.
Item type
mcp-server
Key
io-github-fxmacrodata-fxmacrodata
Source
github.com/fxmacrodata/fxmacrodata
Hosted endpoint
https://fxmacrodata.com/mcp