> ## Documentation Index
> Fetch the complete documentation index at: https://docs.snek.fun/llms.txt
> Use this file to discover all available pages before exploring further.

# Charts HTTP API

> Historical and initial OHLC / market-cap bars on https://charts.snek.fun/v1

The charts service exposes **read-only** HTTP endpoints for candlestick (`/v1/charts/...`) and market-cap bars (`/v1/charts/mcap/...`). Prefer [WebSocket](/api-reference/charts-ws/websocket) for live updates.

**Base URL:** `https://charts.snek.fun/v1`

**Auth:** Public

## Resolution query parameter

All endpoints take `resolution` — one of: `min1`, `min5`, `hour1`, `day1`, `week1`, `month1` (see OpenAPI / server enum).

## GET /v1/charts/history

OHLCV history for a **base / quote** pair over a time range.

### Query parameters

<ParamField query="base" type="string" required>
  Base asset id (`policy.hex` or `.` for ADA).
</ParamField>

<ParamField query="quote" type="string" required>
  Quote asset id.
</ParamField>

<ParamField query="from" type="integer" required>
  Range start (Unix seconds).
</ParamField>

<ParamField query="to" type="integer" required>
  Range end (Unix seconds).
</ParamField>

<ParamField query="resolution" type="string" required>
  e.g. `min1`, `hour1`.
</ParamField>

### Response

JSON array of bar objects (`LastBarWs`): `pair`, `time`, `low`, `high`, `open`, `close`, `volume` (decimals).

```bash theme={null}
curl -sS "https://charts.snek.fun/v1/charts/history?base=…&quote=.&from=1700000000&to=1700086400&resolution=min5"
```

***

## GET /v1/charts/initial-state

Latest bar (and relevance flag) before subscribing over WebSocket.

### Response

```json theme={null}
{
  "bar": {
    "pair": { "base": "…", "quote": "." },
    "time": 1729459260,
    "low": "0.0998",
    "high": "0.1015",
    "open": "0.1001",
    "close": "0.1009",
    "volume": "345.67"
  },
  "isRelevant": true
}
```

***

## GET /v1/charts/mcap/history

Market-cap bars over a range (same query shape as `charts/history`).

***

## GET /v1/charts/mcap/initial-state

Latest market-cap bar snapshot (`mCap` string, `time`, `pair`, `isRelevant` in the bar payload — see OpenAPI).

***

## OpenAPI

`GET /v1/docs/openapi` on the same host returns the full YAML spec (includes all routes served by the process).
