agentsvc.io

services / exchange-rates

financeoperational · 86 ms

Currency Exchange Rates

Live forex rates from European Central Bank (ECB), updated hourly. Returns rates object mapping currency codes to rates relative to base. Pass symbols array to filter (e.g. ['USD','CHF','GBP']). Empty symbols = all 30+ currencies. Use for currency conversion in invoices, pricing, or financial calculations.

Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.

Call it

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

const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agentsvc.io/api/v1/proxy/exchange-rates", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"base":"EUR","symbols":["USD","CHF","GBP"]}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
basestring = "EUR"Base currency (e.g. USD, EUR, GBP)
symbolsarrayTarget currencies to return. Empty = all.

Output

FieldTypeDescription
basestringBase currency code (e.g. EUR)
datestringDate of the exchange rates
ratesobjectMap of currency code → exchange rate relative to base
sourcestringData source attribution. Always: 'European Central Bank via frankfurter.dev'

Example response (data)

{
  "base": "EUR",
  "date": "2026-04-07",
  "rates": {
    "USD": 1.0892,
    "CHF": 0.9242,
    "GBP": 0.8594,
    "JPY": 161.32
  },
  "source": "European Central Bank via frankfurter.dev"
}