Skip to content
Getting started

SDKs and client libraries

Every client below is published and maintained by FXMacroData. Each one is a thin wrapper over the same REST API, so the response fields, authentication and free-access rules are identical whichever language you use.

Published client libraries
Language Package Install Source
Python fxmacrodata on PyPI pip install fxmacrodata GitHub
JavaScript / TypeScript @fxmacrodata/client on npm npm install @fxmacrodata/client GitHub
R fxmacrodata-r, installed from GitHub remotes::install_github("fxmacrodata/fxmacrodata-r") GitHub
Go Go module go get github.com/fxmacrodata/fxmacrodata-go GitHub
Julia FXMacroData.jl, installed from GitHub Pkg.add(url="https://github.com/fxmacrodata/FXMacroData.jl") GitHub
MCP (local, stdio) mcp-server-fxmacrodata on PyPI uvx mcp-server-fxmacrodata GitHub

All clients read the key from a constructor argument or an environment variable and send it in the X-API-Key header. Without a key they return USD data on the free terms described under free access. Get a key on the account page.

Python

Announcements, FX rates with optional technical indicators, the release calendar and the data catalogue. Python 3.9 or newer.

pip install fxmacrodata
from fxmacrodata import Client

client = Client(api_key="YOUR_API_KEY")

# Macro releases: AUD cash rate decisions in a window
data = client.get_indicator("aud", "policy_rate", start_date="2023-01-01", end_date="2023-11-01")

# FX history, optionally with indicators computed server-side
fx = client.get_fx_price("eur", "usd", indicators="sma_20,rsi_14,macd")

# Release calendar and catalogue discovery
calendar = client.get_calendar("usd")

Optional extras add OpenBB and MCP integrations; see the package README. The Python package is also what the Python and notebook guides use.

JavaScript and TypeScript

A typed client for Node.js and server-side runtimes, plus helpers that build MCP connection URLs and headers. The API is for server-side use and does not send CORS headers to browser origins.

npm install @fxmacrodata/client
import { FXMacroDataClient } from "@fxmacrodata/client";

const client = new FXMacroDataClient({ apiKey: process.env.FXMACRODATA_API_KEY });
const result = await client.announcements("aud", "policy_rate");

// Helpers for MCP hosts that need a URL or headers
import { createMcpHeaders, createMcpUrl } from "@fxmacrodata/client";
const headers = createMcpHeaders({ apiKey: process.env.FXMACRODATA_API_KEY });

R

Returns announcements, FX and calendar data as data frames. Installed from GitHub with the remotes package.

install.packages("remotes")
remotes::install_github("fxmacrodata/fxmacrodata-r")
library(fxmacrodata)
fxmd_set_key("YOUR_API_KEY")   # or set FXMACRODATA_API_KEY in ~/.Renviron

rates    <- fxmd_announcements("USD", "policy_rate")
cpi      <- fxmd_announcements("USD", "inflation", start_date = as.Date("2025-01-01"))
calendar <- fxmd_calendar("USD")
fxmd_meta(rates)$source

Date columns arrive already parsed. Function reference: fxmacrodata/fxmacrodata-r.

Go

A Go module generated from the OpenAPI schema, so every endpoint has a typed call. USD works without a key; set FXMACRODATA_API_KEY for other currencies.

go get github.com/fxmacrodata/fxmacrodata-go
import fxmacrodata "github.com/fxmacrodata/fxmacrodata-go"

client := fxmacrodata.NewAPIClient(fxmacrodata.NewConfiguration())
rates, _, err := client.FXMacroDataAPI.GetAnnouncements(ctx, "USD", "policy_rate").Execute()
calendar, _, err := client.FXMacroDataAPI.GetCalendar(ctx, "USD").Execute()

Package documentation: pkg.go.dev.

Julia

Installed from GitHub until it is registered in General.

using Pkg
Pkg.add(url="https://github.com/fxmacrodata/FXMacroData.jl")

Usage: fxmacrodata/FXMacroData.jl.

MCP server, run locally

For AI clients the hosted server at https://mcp.fxmacrodata.com needs nothing installed. The local package is for stdio-only hosts and air-gapped machines; it exposes the core data tools and reads your key from FXMACRODATA_API_KEY.

uvx mcp-server-fxmacrodata
{
  "mcpServers": {
    "fxmacrodata": {
      "command": "uvx",
      "args": ["mcp-server-fxmacrodata"],
      "env": { "FXMACRODATA_API_KEY": "YOUR_API_KEY" }
    }
  }
}

Full setup for Claude, ChatGPT, Cursor, VS Code and other hosts is on the MCP server page.

Any other language

The API is plain HTTPS and JSON, documented by an OpenAPI 3.1 schema.

  • Generate a client from https://api.fxmacrodata.com/openapi.json with any OpenAPI generator.
  • Or call it directly: curl -H "X-API-Key: YOUR_API_KEY" https://api.fxmacrodata.com/v1/announcements/eur/policy_rate?limit=1
  • Community and platform integrations (Airflow, Dagster, Prefect, DuckDB, Dify, LangChain and more) are listed under open source integrations.

AI Answer-Ready

Key Facts

Page
Sdks
Section
Documentation
Canonical URL
https://fxmacrodata.com/documentation/sdks
Source
FXMacroData editorial and official publisher references
Last Updated
See page metadata

Provenance And Trust

Cite the canonical URL and source field above. Where available, this page maps to official publisher releases and timestamped updates.

Quick Q&A

What is this page about? This page explains Sdks with directly usable context for trading, research, and API workflows.

What source should be cited? Use the canonical URL and the listed source field; cite official publisher references when available.

How fresh is this content? The last updated value above reflects the page metadata or latest available data timestamp.

Can this be used in AI assistants? Yes. This section is intentionally structured for retrieval and citation in chat assistants.

Prompt Packs

Use these in ChatGPT, Claude, Gemini, Mistral, Perplexity, or Grok for consistent source-aware outputs.