# 2s.io US Treasury Official Exchange Rates

> 2s.io US Treasury Official Exchange Rates is a paid API for AI agents from 2s.io, paid per call via x402, $0.0012/call, status unknown (last checked 2026-09-14).

Returns official US Treasury exchange rates for foreign currencies, sourced from the Treasury Fiscal Data API, with quarterly and ad-hoc updates per country/currency pair.

## Facts

- Endpoint: GET https://2s.io/api/treasury/exchange-rates
- Price: $0.0012/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/2s-io-8f769820
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KWZnTuaMmxgO1cvHPncqE

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 2s-io-8f769820
```

Example prompt: What is the official US Treasury exchange rate for Brazil? Pull the most recent record and show me the country, currency, exchange rate, and effective date.

## When to prefer this

Use this endpoint when you need the official US government-sanctioned exchange rate for foreign-currency reporting — specifically the rate used by federal agencies — rather than live market rates. Prefer it over ECB Frankfurter (/api/fx/rates) when regulatory compliance or cross-validation with official Treasury figures is required. Best for quarterly historical lookups or auditing foreign-currency transactions reported in USD.

## Known failure modes

- Invalid filter syntax returns a 400 or empty result set
- Unknown country or currency name in filter returns zero rows
- pageSize exceeding 10000 is rejected
- Network or upstream Treasury Fiscal Data outage returns 5xx
- Stale data if Treasury hasn't published a new quarterly update yet

## How this service works

Official US Treasury exchange rates via US Treasury Fiscal Data. Used by federal agencies to report foreign-currency transactions in USD. Quarterly + ad-hoc updates per country/currency pair. Each row carries record_date, country, currency, country_currency_desc, exchange_rate, effective_date. Pair with `/api/fx/rates` (ECB Frankfurter, daily market rates) for cross-validation. Use Fiscal Data filter syntax — e.g. `filter=country:eq:Brazil` to scope to a single country.

## Output

A paginated list of Treasury exchange rate records, each containing record_date, country, currency, country_currency_desc (e.g. 'Brazil-Real'), exchange_rate (USD equivalent), and effective_date. Sorted by record_date descending by default.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "sort": "-record_date",
   "filter": "country:eq:Canada",
   "pageSize": 10,
   "pageNumber": 1
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "queryParams"
   ],
   "properties": {
    "type": {
     "const": "http"
    },
    "method": {
     "const": "GET"
    },
    "queryParams": {
     "properties": {
      "sort": {
       "type": "string",
       "default": "-record_date"
      },
      "fields": {
       "type": "string"
      },
      "filter": {
       "type": "string",
       "description": "e.g. country:eq:Brazil,record_date:gte:2024-01-01"
      },
      "pageSize": {
       "type": "integer",
       "default": 100,
       "maximum": 10000,
       "minimum": 1
      },
      "pageNumber": {
       "type": "integer",
       "minimum": 1
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "schema": {
  "type": "object",
  "properties": {
   "ok": {
    "type": "boolean"
   },
   "meta": {
    "type": "object",
    "properties": {
     "links": {},
     "labels": {},
     "dataTypes": {}
    }
   },
   "page": {
    "type": "object",
    "properties": {
     "size": {
      "type": "integer"
     },
     "pages": {},
     "number": {
      "type": "integer"
     }
    }
   },
   "items": {
    "type": "array",
    "items": {
     "type": "object",
     "properties": {
      "country": {
       "type": "string"
      },
      "currency": {
       "type": "string"
      },
      "record_date": {
       "type": "string"
      },
      "exchange_rate": {
       "type": "string"
      },
      "effective_date": {
       "type": "string"
      },
      "country_currency_desc": {
       "type": "string"
      }
     }
    }
   },
   "total": {
    "type": "integer"
   },
   "source": {
    "type": "object",
    "properties": {
     "url": {
      "type": "string"
     },
     "license": {
      "type": "string"
     },
     "provider": {
      "type": "string"
     }
    }
   }
  }
 },
 "example": {
  "ok": true,
  "meta": {
   "links": null,
   "labels": null,
   "dataTypes": null
  },
  "page": {
   "size": 100,
   "pages": null,
   "number": 1
  },
  "items": [
   {
    "country": "Brazil",
    "currency": "Real",
    "record_date": "2026-03-31",
    "exchange_rate": "5.254",
    "effective_date": "2026-03-31",
    "country_currency_desc": "Brazil-Real"
   }
  ],
  "total": 5421,
  "source": {
   "url": "https://fiscaldata.treasury.gov/api-documentation/",
   "license": "US Government work, public domain.",
   "provider": "US Treasury Fiscal Data API (Bureau of the Fiscal Service)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/2s-io-8f769820/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 2s.io](https://www.zero.xyz/host/2s.io/llms.txt)
