Docs / Rates
Exchange rates
Returns a rate table from the European Central Bank, the Federal Reserve, or the Central Bank of Turkey.
GET
/v1/ratesimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const rates = await client.rates("tcmb");Request
Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.
| Field | Type | Description |
|---|---|---|
| source | string | ecb, fed, or tcmb. Optional. |
| date | string | Calendar day, YYYY-MM-DD. Optional. |
Response
A 200 response uses one call. The table names its source, base currency, date, and one row per currency.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A required field is missing or has the wrong type. |
| 503 | upstream_unavailable | The rate source is unavailable. |
| 401 | unauthorized | The bearer token is missing or not recognized. |