# Guest OHLCV Bars

> Returns historical OHLCV bars for one active symbol. At least one of `from` or `count` is required.
When both are supplied, `count` takes precedence and `from` is ignored. A request may not ask for more
than 5,000 bars: `count` directly, or — in range mode — the bars the timeframe implies over
`[from, to]`, so the permitted span scales with the timeframe (5,000 minutes on `1M`, 5,000 days on
`D`). Bounds are rejected with HTTP 400 rather than truncated. No authentication required.


Source: /trader/api/public-endpoints/get-public-bars

## `GET /public/history/bars`

**Guest OHLCV Bars**

Returns historical OHLCV bars for one active symbol. At least one of `from` or `count` is required.
When both are supplied, `count` takes precedence and `from` is ignored. A request may not ask for more
than 5,000 bars: `count` directly, or — in range mode — the bars the timeframe implies over
`[from, to]`, so the permitted span scales with the timeframe (5,000 minutes on `1M`, 5,000 days on
`D`). Bounds are rejected with HTTP 400 rather than truncated. No authentication required.


Tags: `Public Endpoints`

#### Query parameters

- `sid` (string) (required) — Active symbol ID
- `timeframe` (string) (required)
  - enum: `1M`, `2M`, `3M`, `5M`, `15M`, `30M`, `1H`, `4H`, `12H`, `D`, `W`, `M`
- `from` (integer) — Positive start timestamp in Unix seconds. Required when count is omitted; ignored when count is supplied. In range mode `(to - from)` may not imply more than 5,000 bars at the requested timeframe.
- `to` (integer) (required) — Positive end timestamp in Unix seconds
- `count` (integer) — Maximum bars to return. Required when from is omitted and takes precedence when both are supplied.


### Responses

#### `200` — Historical bars

**Content-Type:** `application/json`

- `bars` (array) (required)
  - items:
    - `open` (number) (required) — Opening price
    - `high` (number) (required) — Highest price
    - `low` (number) (required) — Lowest price
    - `close` (number) (required) — Closing price
    - `volume` (integer) (required) — Trading volume
    - `datetime` (string) (required) — Bar timestamp

#### `400` — Invalid request

**Content-Type:** `application/json`

- `error` (object) (required)
  - `type` (string) (required) — Error type code
  - `message` (string) (required) — Human-readable error message
  - `field` (string) — Field name if error is field-specific

#### `404` — Symbol is unknown or inactive

**Content-Type:** `application/json`



#### `429` — The per-client-IP rate limit for this request's class was exceeded, or the service is at capacity for
distinct clients. Retry after the `Retry-After` interval.


**Content-Type:** `application/json`



