# SDKs: Python, JavaScript, R, Go, Julia and MCP Clients | FXMacroData

> Official FXMacroData client libraries that are published today: the Python package on PyPI, the JavaScript client on npm, R, Go and Julia clients on GitHub, and the local MCP server package. Install lines and first calls.

Source: https://fxmacrodata.com/documentation/sdks
Documentation index: https://fxmacrodata.com/documentation/llms.txt
API base URL: https://api.fxmacrodata.com

# 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.

| Language | Package | Install | Source |
| --- | --- | --- | --- |
| Python | [fxmacrodata](https://pypi.org/project/fxmacrodata/) on PyPI | pip install fxmacrodata | [GitHub](https://github.com/fxmacrodata/fxmacrodata) |
| JavaScript / TypeScript | [@fxmacrodata/client](https://www.npmjs.com/package/@fxmacrodata/client) on npm | npm install @fxmacrodata/client | [GitHub](https://github.com/fxmacrodata/website/tree/main/extensions/npm-package) |
| R | fxmacrodata-r, installed from GitHub | remotes::install_github("fxmacrodata/fxmacrodata-r") | [GitHub](https://github.com/fxmacrodata/fxmacrodata-r) |
| Go | Go module | go get github.com/fxmacrodata/fxmacrodata-go | [GitHub](https://github.com/fxmacrodata/fxmacrodata-go) |
| Julia | FXMacroData.jl, installed from GitHub | Pkg.add(url="https://github.com/fxmacrodata/FXMacroData.jl") | [GitHub](https://github.com/fxmacrodata/FXMacroData.jl) |
| MCP (local, stdio) | [mcp-server-fxmacrodata](https://pypi.org/project/mcp-server-fxmacrodata/) on PyPI | uvx mcp-server-fxmacrodata | [GitHub](https://github.com/fxmacrodata/mcp-server-fxmacrodata) |

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](https://fxmacrodata.com/documentation/rate-limits#free-access). Get a key on the [account page](https://fxmacrodata.com/api-management).

## 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](https://github.com/fxmacrodata/fxmacrodata). The Python package is also what the [Python and notebook guides](https://fxmacrodata.com/quick-start-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](https://github.com/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](https://pkg.go.dev/github.com/fxmacrodata/fxmacrodata-go).

## 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](https://github.com/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](https://fxmacrodata.com/documentation/mcp-server#local-stdio).

## 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](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](https://fxmacrodata.com/open-source-integrations).
