---
title: "Conversion rate between two coins as of a past moment"
method: POST
path: "/v1/rate-at"
tags: ["Reference"]
---

# Conversion rate between two coins as of a past moment

`POST /v1/rate-at`

## Request

- Base URL: `https://intelapi.publicaml.org`
- URL: `https://intelapi.publicaml.org/v1/rate-at`
- Auth: one of:
  - API key in header `X-API-Key`
  - none

How many units of `to_coin_iso` one unit of `from_coin_iso` was worth on the UTC day of `timestamp`.

The figure comes from PublicAML's own daily price series (the one the risk engine values transfers with): one USD quote per token per day derived from on-chain swaps, and exchange closes for BTC. No vendor ticker is involved, so a transfer priced with this endpoint carries the same value the screening endpoints report.

Granularity is a day, never a minute. `rate` is a float; `rate_e8` is the same number scaled by 10^8 as an integer string for callers that keep rates as integers. `fallback` is null when both sides had a quote for that exact day, otherwise it names what was done instead: `nearest_day` (a quote from up to 7 days earlier; the leg's `day_gap` says how many), `stable_peg` (a stablecoin with no quote in reach, pinned at 1 USD), or both joined with `+`. `legs.from` / `legs.to` show the USD value, the day and the source series of each side.

Symbols are coin tickers (BTC, ETH, USDT, USDC, TRX, BNB, LINK, …), not networks; USD is accepted as the fiat unit. An unknown symbol answers 400 with the supported list; a day before any market answers 404.

Served at https://intelapi.publicaml.org/v1/rate-at and available only with an API key (`X-API-Key`) or a signed request; without one the answer is 401.

## Request body

- object
  - `from_coin_iso` string, required: Coin ticker, case-insensitive, e.g. BTC.
  - `to_coin_iso` string, required: Coin ticker or USD.
  - `timestamp` union, required: Unix seconds, unix milliseconds (values above 1e12) or an ISO-8601 date/time. Up to one day ahead of now.
    - integer
    - string

## Response `200`

The rate for that day.

- object
  - `from_coin_iso` string
  - `to_coin_iso` string
  - `requested_at` integer: The timestamp as unix seconds.
  - `requested_at_iso` string
  - `day` string: UTC day the rate is for, YYYY-MM-DD.
  - `rate` number: Units of to_coin_iso per one from_coin_iso.
  - `rate_e8` string: rate × 10^8, integer as a string.
  - `inverse_rate` number
  - `granularity` 'day'
  - `fallback` string, nullable: null, `nearest_day`, `stable_peg` or `nearest_day+stable_peg`.
  - `legs` object: `from` and `to`, each {coin, usd, basis (market | pinned | stable_peg | usd), day, day_gap, source {chain, token, kind, quote_asset, swap_txs}}. basis `pinned` is a stablecoin the price series itself anchors at 1 USD; unlike `stable_peg` it is a stored row, not a fallback.
  - `source` 'publicaml:token_price'

## Other responses

- `400`: Unsupported coin (the body lists the supported tickers), bad timestamp or unknown field.
- `401`: No API key or signature. This endpoint is key-only.
- `404`: No quote for one side on that day or the 7 days before it; `missing` names it.
- `429`: Rate limited: anonymous callers, and keys issued with a quota of their own. Authenticate to remove the limit.
- `500`: Server error.

---

[API](https://skmtc.dev/publicaml/apis/publicaml-intelligence-api.md) · [All operations](https://skmtc.dev/publicaml/apis/publicaml-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/publicaml/apis/publicaml-intelligence-api/revisions/7c0c6315088c?raw)
