Skip to content
Getting started

SDKs and client libraries

FXMacroData clients connect research notebooks, statistical workflows and production applications to the financial-data API across six language ecosystems. Choose a client for its endpoint coverage, response types and language-native interfaces.

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 Published package files
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
OCaml fxmacrodata on opam opam install fxmacrodata 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

Typed Promise-based calls for announcements, calendars, catalogues, positioning and commodities, plus MCP connection helpers. Uses native fetch on Node.js 18 or newer. Keep protected API credentials on the server.

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 public Go module with OpenAPI-generated requests and response models, plus context-based cancellation. USD works without a key; set FXMACRODATA_API_KEY for protected access.

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()

Source and API documentation: fxmacrodata/fxmacrodata-go.

Julia

Announcements, revision history and release calendars for release-aware research. Distributed through GitHub.

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

Usage: fxmacrodata/FXMacroData.jl.

OCaml

Typed wrappers return asynchronous Lwt results for macro indicators, calendars, FX, positioning and commodities. Published in the opam package registry.

opam install fxmacrodata

Installation and dependencies: opam package. Usage and source: fxmacrodata/ocaml-fxmacrodata.

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; 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
  • Officially listed integrations for DuckDB, Apache Airflow, Singer / Meltano and Hermes are available 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.