FX rate time series

$0.005 per call · USDC via x402 · GET /api/fx-timeseries

Daily FX rates between two currencies across a date window using European Central Bank reference rates (via Frankfurter). ?from=USD&to=EUR&startDate=2024-01-02&endDate=2024-01-31. Send GET /api/fx-timeseries with the required fields from, to, startDate and endDate and pay $0.005 per call over x402 or MPP (there is no free tier). It returns a JSON object with from, to, startDate, endDate, count and 1 more.

Category: Live public data · Tags: forex fx currency time-series exchange-rate ecb macro history

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
fromstringyes3-letter source currency code Also accepted as source, src, start.
tostringyes3-letter target currency code Also accepted as target, dest, destination, end.
startDatestringyesISO start date (YYYY-MM-DD)
endDatestringyesISO end date (YYYY-MM-DD)

Example request

curl -i "https://agent402.tools/api/fx-timeseries?from=USD&to=EUR&startDate=2024-01-02&endDate=2024-01-31"

Without payment this returns HTTP 402 Payment Required with the exact price for fx-timeseries; any x402 v2 or MPP client pays it and retries.

Example response

{
  "from": "USD",
  "to": "EUR",
  "startDate": "2024-01-02",
  "endDate": "2024-01-31",
  "count": 22,
  "series": [
    {
      "date": "2024-01-02",
      "rate": 0.9128
    }
  ]
}
FieldTypeAlways presentIn the example
fromstringyesUSD
tostringyesEUR
startDatestringyes2024-01-02
endDatestringyes2024-01-31
countnumberyes22
seriesarray of objectsyes1 item in the example

From an MCP client

catalog.call {
  "slug": "fx-timeseries",
  "params": {
    "from": "USD",
    "to": "EUR",
    "startDate": "2024-01-02",
    "endDate": "2024-01-31"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for fx-timeseries; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/fx-timeseries?from=USD&to=EUR&startDate=2024-01-02&endDate=2024-01-31");

Related tools

Historical FX rate by date

$0.002 · GET /api/fx-historical

Historical foreign-exchange rate for a specific date using European Central Bank reference rates (via Frankfurter). Retu…

Currency exchange rate

$0.002 · GET /api/fx-rate

Live currency conversion using European Central Bank reference rates (via Frankfurter). Converts an amount between two c…

G10 FX dashboard vs USD

$0.005 · GET /api/fx-dashboard

Snapshot of all G10 spot exchange rates quoted against USD (EUR, GBP, JPY, CHF, CAD, AUD, NZD, SEK, NOK) using ECB refer…

US Treasury yield history

$0.005 · GET /api/treasury-yield-history

Last N business days of US Treasury constant-maturity yields, oldest→newest. Source: FRED DGS* series (St. Louis Fed), p…

FRED catalog search

$0.005 · GET /api/fred-search

Full-text search across FRED's ~800,000 economic time series. Returns series IDs (use with /api/fred-series), titles, fr…

FRED time series

$0.005 · GET /api/fred-series

Fetch any of FRED's ~800,000 economic time series by series ID - GDP (GDPC1), CPI (CPIAUCSL), unemployment (UNRATE), fed…