Currency exchange rate

$0.002 per call · USDC via x402 · GET /api/fx-rate · Cached 5m

Live currency conversion using European Central Bank reference rates (via Frankfurter). Send GET /api/fx-rate with the required fields from and to and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with from, to, amount, rate, result and 1 more.

Converts an amount between two currencies and returns the rate and date. ?from=USD&to=EUR&amount=100

Category: Live public data · Tags: currency forex fx exchange-rate convert ecb

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
fromstringyes3-letter currency code, e.g. USD Also accepted as source, src, start.
tostringyes3-letter currency code, e.g. EUR Also accepted as target, dest, destination, end.
amountnumbernoamount to convert (default 1)

Example request

curl -i "https://agent402.tools/api/fx-rate?from=USD&to=EUR&amount=100"

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

Example response

{
  "from": "USD",
  "to": "EUR",
  "amount": 100,
  "rate": 0.923,
  "result": 92.3,
  "date": "2026-06-13"
}
FieldTypeAlways presentIn the example
fromstringyesUSD
tostringyesEUR
amountnumberyes100
ratenumberyes0.923
resultnumberyes92.3
datestringyes2026-06-13

From an MCP client

catalog.call {
  "slug": "fx-rate",
  "params": {
    "from": "USD",
    "to": "EUR",
    "amount": 100
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for fx-rate; 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-rate?from=USD&to=EUR&amount=100");

Part of these workflows

Currency exchange rate is one step in this skill pack, each sold as a single call:

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…

FX rate time series

$0.005 · GET /api/fx-timeseries

Daily FX rates between two currencies across a date window using European Central Bank reference rates (via Frankfurter)…

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…

Country info

FREE w/ compute · or $0.001 · GET /api/country-info

Country facts by name or ISO code: official name, capital, region, currencies, languages, timezones, dialing code, TLD, …

Timezone convert

FREE w/ compute · or $0.001 · GET /api/timezone-convert

Convert a datetime from one IANA timezone to another. Accepts ISO 8601, Unix timestamps (seconds or milliseconds), or na…

A2A Agent Card validate

FREE w/ compute · or $0.002 · POST /api/a2a-card-validate

Validate an A2A (Agent2Agent protocol) Agent Card: required fields, skill shape, transport names, capability flags - spe…