---
title: "Get the historical bars"
method: GET
path: "/trade/history"
tags: ["Market data"]
---

# Get the historical bars

`GET /trade/history`

Get the historical bars for an instrument. Any request that would result in a response with more than `20,000` bars will be rejected.
<br>Each property of the response object is a table column. Bar time for daily bars is 00:00 UTC. Bar time for monthly bars is 00:00 UTC and is the first trading day of the month. If there is no data in the requested time period but there is data in the previous time period the status code will be set to no_data and the nb property to UNIX timestamp of the next available bar behind the range. If there is no data in the requested and previous time periods the status code will be set to `no_data`.

## Query parameters

- `routeId` integer, required
- `from` integer, required
- `resolution` '1M' | '1W' | '1D' | '4H' | '1H' | '30m' | '15m' | '5m' | '1m', required
- `to` integer, required
- `tradableInstrumentId` integer, required

## Headers

- `accNum` integer, required

## Response `200`

OK

- HistorySuccessResponse — History success response
  - `d` HistoryResponse, required
    - `barDetails` BarDetails[] — Bar details
      - `c` number — Close price.
      - `h` number — High price.
      - `l` number — Low price.
      - `o` number — Open price.
      - `t` integer — Unix timestamp in milliseconds (UTC) of the rightmost required bar, including to. It can be in the future. In this case, the rightmost required bar is the latest available bar.
      - `v` number — Volume.
  - `s` string, required — Status will always be `ok`.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/tradelocker/apis/trading-api.md) · [All operations](https://skmtc.net/tradelocker/apis/trading-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tradelocker/trading-api/revisions/5b184d9b617c/schema)
