Barquant

FX rates

GET/api/v1/families/fx/rates

Daily FX closes against the US dollar for reporting currencies, many currencies per call. Pro and Unlimited.

Description

Returns daily closes for each requested currency against the US dollar, quoted both ways: usd_per_unit (USD for 1 unit, pair TWDUSD) and units_per_usd (units for 1 USD). Covers the currencies listed US stocks report in plus the major currencies, back decades where the history exists. Pass date=YYYY-MM-DD for the last close on or before that day (weekends and holidays fall back to the prior close), or from / to for a history window; omit both for the full history. Omit currencies for every stored currency. USD always answers 1. An unknown code comes back null. Every request counts as one API request against the plan quota, however many currencies it returns.

Authentication

v1 is client_id plus client_secret on every protected GET. A browser session is not enough. Google sign-in is for the website only — do not send a session cookie to v1.

  • HTTP Basic — Authorization: Basic base64(client_id:client_secret)
  • Headers — X-Client-Id and X-Client-Secret

Create or rotate credentials on Account. Full notes are on Authentication.

Path parameters

This path has no parameters.

Query parameters

ParameterInTypeRequiredDescription
currenciesquerystringNoComma-separated ISO 4217 codes (TWD,DKK,EUR). Repeated params are merged. Omit for every stored currency.
datequerystringNoAs-of day, YYYY-MM-DD: each entry carries rate, the last close on or before it. Cannot be combined with from / to.
fromquerystringNoFirst day of the history window, YYYY-MM-DD. Default: the start of the history.
toquerystringNoLast day of the history window, YYYY-MM-DD. Default: the latest close.

Example request

curl -sS -u "$CLIENT_ID:$CLIENT_SECRET" \
  https://barquant.dev/api/v1/families/fx/rates?currencies=TWD,DKK,EUR&date=2026-09-25

Response attributes

FieldTypeDescription
base"USD"Every rate is against the US dollar.
as_ofstring | nullDay the FX store was last published, YYYY-MM-DD.
mode"history" | "as_of"history when date is omitted; as_of with date.
requestedstring[]Currencies in request order (every stored one when omitted).
currenciesobjectCurrency → entry, or null when unknown or pending.
currencies[].pairstringAlways {CUR}USD. quote and inverse_quote spell out both directions ("USD per 1 TWD", "TWD per 1 USD").
currencies[].first / laststring | nullFirst and latest stored close.
currencies[].rates[]object[]History mode: { date, usd_per_unit, units_per_usd } per trading day, oldest first.
currencies[].rateobject | nullAs-of mode: { date, usd_per_unit, units_per_usd } for the last close on or before date; null before the history starts.
pendingstring[]Currencies that are stored but could not be read this time. Retry them.

Sample response

{
  "family": "fx-rates",
  "base": "USD",
  "as_of": "2026-09-26",
  "computed_at": "2026-09-26T22:10:00Z",
  "mode": "as_of",
  "date": "2026-09-25",
  "requested": [
    "TWD",
    "DKK",
    "EUR"
  ],
  "currencies": {
    "TWD": {
      "currency": "TWD",
      "pair": "TWDUSD",
      "quote": "USD per 1 TWD",
      "inverse_quote": "TWD per 1 USD",
      "source_pair": "USDTWD",
      "first": "1983-10-03",
      "last": "2026-09-25",
      "rate": {
        "date": "2026-09-25",
        "usd_per_unit": 0.031550718,
        "units_per_usd": 31.695
      }
    },
    "DKK": {
      "currency": "DKK",
      "pair": "DKKUSD",
      "quote": "USD per 1 DKK",
      "inverse_quote": "DKK per 1 USD",
      "source_pair": "DKKUSD",
      "first": "2003-12-01",
      "last": "2026-09-25",
      "rate": {
        "date": "2026-09-25",
        "usd_per_unit": 0.152,
        "units_per_usd": 6.5789474
      }
    },
    "EUR": {
      "currency": "EUR",
      "pair": "EURUSD",
      "quote": "USD per 1 EUR",
      "inverse_quote": "EUR per 1 USD",
      "source_pair": "EURUSD",
      "first": "1971-01-04",
      "last": "2026-09-25",
      "rate": {
        "date": "2026-09-25",
        "usd_per_unit": 1.13911,
        "units_per_usd": 0.87787834
      }
    }
  },
  "pending": []
}

Errors

StatusWhen
400A currency is not a three-letter code, date / from / to is not YYYY-MM-DD, date is combined with from / to, or from is after to.
401Missing or wrong client_id / client_secret.
403Authenticated, but this plan does not include FX rates. They start on Pro.
429Daily quota or per-minute plan quota. Read Retry-After and X-RateLimit-* headers.

401 body:

{
  "error": "Unauthorized"
}

403 body:

{
  "error": "This plan does not include that family.",
  "plan": "basic",
  "requiredPlan": "pro"
}

429 body (per-minute / daily):

{
  "error": "Too many requests."
}

Plan access

Pro and Unlimited. Free and Basic receive 403. No history window. Every request counts as one API request against the plan quota.

Daily and per-minute quotas live on Plans and limits.

© 2026–2035 Barquant

FX rates · Barquant