---
title: "Price bars for one coin, keyed by slug"
method: GET
path: "/api/coins/{slug}/candles"
tags: ["public-crypto-data"]
---

# Price bars for one coin, keyed by slug

`GET /api/coins/{slug}/candles`

## Request

- Base URL: `https://api.coinrithm.com`
- URL: `https://api.coinrithm.com/api/coins/{slug}/candles`
- Auth: none required

Keyless form of `/api/agent/market/{coinId}/candles`, keyed by slug:
the same loader and payload, without `observation`. `range` fixes
both lookback and resolution: 1H = 60 x 1-minute, 1D = 288 x
5-minute, 1W = 672 x 15-minute, 1M = 720 x 1-hour, 3M = 540 x
4-hour, 1Y = up to 366 daily bars. Bars are oldest first with `t` in
unix SECONDS. They are sampled composite-price bars, not venue trade
candles, and `v` is a rolling 24-hour USD quote-volume observation
at the bar, not the volume traded during it: never sum `v`.

o/h/l/c are converted to `fiat` at the nearest stored rate. Here
`fiat` is upper-cased and echoed; `rateToUsd: 1` with a non-USD
`fiat` means the code is not tracked and the values are USD.

Query parameters other than `range` and `fiat` are ignored. Unknown
slug: 404 `{"error": "Coin not found"}`. Also served at
`/api/v1/coins/{slug}/candles` with identical behaviour.

## Path parameters

- `slug` string, required

## Query parameters

- `range` '1H' | '1D' | '1W' | '1M' | '3M' | '1Y'
- `fiat` string

## Response `200`

Bars for the requested range, oldest first

- PublicCoinCandles
  - `coin` object, required
    - `ucid` string
    - `slug` string
    - `symbol` string
    - `name` string
  - `range` '1H' | '1D' | '1W' | '1M' | '3M' | '1Y', required
  - `fiat` string, required: The requested currency, upper-cased.
  - `rateToUsd` number, required: Latest `fiat`-per-USD rate (1 for USD, and 1 for an untracked code).
  - `candles` PublicCoinCandle[], required: Oldest first.
    - `t` integer, required: Bar timestamp, unix SECONDS (UTC).
    - `o` number, required
    - `h` number, required
    - `l` number, required
    - `c` number, required
    - `v` number, required: Mean rolling 24-hour quote volume observed at this bar, in USD regardless of `fiat`; not the volume traded during the bar, so never sum it across bars.
    - `vm` integer, nullable: Expected venues missing from `v` because their fetch failed; 0 none known, null unknown.

## Other responses

- `400`: Invalid or missing parameters. On a route with a query allowlist, an undocumented query parameter returns `{"error": "unsupported_query_parameter", "message": "Unsupported query parameter: <key>. Supported: <keys>."}`.
- `404`: Resource not found. A path the API does not serve at all returns `{"error": "not_found", "message": "not_found"}` with `Cache-Control: no-store`.
- `429`: Per-IP public rate limit exceeded. Honor `Retry-After` when present, otherwise back off; `RateLimit-*` headers report the window.
- `500`: Server error

---

[API](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api.md) · [All operations](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/llms.txt) · [OpenAPI document](https://skmtc.dev/coinrithm/apis/coinrithm-agent-trading-api/revisions/28fb59f285fe?raw)
