# OHLCV Bars

> Returns historical OHLCV bars for the specified symbol and timeframe

Source: /trader/api/charting/get-bars

## `GET /history/bars`

**OHLCV Bars**

Returns historical OHLCV bars for the specified symbol and timeframe

Tags: `Charting`

#### Query parameters

- `sid` (string) (required) — Symbol ID to fetch bars for
- `timeframe` (string) (required) — Bar timeframe/resolution
  - enum: `1M`, `2M`, `3M`, `5M`, `15M`, `30M`, `1H`, `4H`, `12H`, `D`, `W`, `M`
- `from` (integer) — Start timestamp (Unix time in seconds). Either 'from' or 'count' must be provided.
- `to` (integer) (required) — End timestamp (Unix time in seconds)
- `count` (integer) — Maximum number of bars to return. Either 'from' or 'count' must be provided.


### Responses

#### `200` — Successfully retrieved 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` — Bad request (missing or invalid parameters)

**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

#### `401` — Unauthorized (invalid or missing JWT token)

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



#### `404` — Symbol not found

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



#### `500` — Internal server error

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



