Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.99 KB

File metadata and controls

64 lines (47 loc) · 1.99 KB

FXMacroData.jl

FXMacroData.jl is a small Julia client for the FXMacroData REST API. It is intended for research, release-aware backtests, and event-driven systems such as Fastback.jl; it does not place trades, modify accounts, or bundle any Fastback source code.

Install

FXMacroData.jl is distributed directly from GitHub and is not published to the Julia General registry, so install it by URL:

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

Use

using Dates
using FXMacroData

client = Client()
inflation = announcements(
    client,
    "USD",
    "inflation";
    start_date=Date(2025, 1, 1),
    end_date=Date(2025, 12, 31),
    revisions="all",
)
calendar = release_calendar(client, "USD")

Authentication

Client() reads FXMACRODATA_API_KEY then FXMD_API_KEY from the environment, or takes an explicit api_key=.

The key is sent as an X-API-Key request header. That is deliberate: a key in the query string is recorded by every proxy, CDN and server access log along the request path, and leaks through Referer headers. If something between you and the API cannot forward the header, opt in explicitly:

client = Client(auth_mode=:query)

Subscribe to FXMacroData for non-USD data, full available history, FX, commodities and positioning in your Julia research workflows. Evaluate the client with public USD data within the API's public-history window, then supply your subscription's key for protected access.

Release-aware research

Macro rows expose announcement_datetime, and announcements(...; revisions="all") preserves revision epochs returned by the API. Backtests must not use a release or revision before its source timestamp.

Development

julia --project -e 'using Pkg; Pkg.instantiate(); Pkg.test()'

Tests inject a fake HTTP request function and do not make live API calls.