# Trading View History

Returns historical open, high, low, close and volume bars in TradingView UDF format.

_Source: https://beta.taostats.io/docs/api-reference/tradingview/get-tradingview-udf-history_

_Last reviewed: 2026-09-18_

```http
GET https://api.taostats.io/api/dtao/tradingview/udf/history
```

Requires an API key in the `Authorization` header.

Returns historical open, high, low, close and volume bars in TradingView UDF format. Supply a symbol, resolution and time range; the response includes timestamps and a data status.

## Try it

Try this request in the browser on the HTML version of this page, or use the code samples below.

### Code samples

**cURL**

```bash
curl -H "Authorization: <YOUR_API_KEY>" \
  "https://api.taostats.io/api/dtao/tradingview/udf/history"
```

**JavaScript**

```js
const response = await fetch('https://api.taostats.io/api/dtao/tradingview/udf/history', {
  headers: {
    Authorization: '<YOUR_API_KEY>',
  },
});
const data = await response.json();
```

**Python**

```python
import requests

response = requests.get(
    "https://api.taostats.io/api/dtao/tradingview/udf/history",
    headers={"Authorization": "<YOUR_API_KEY>"},
)
data = response.json()
```

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `symbol` | query | `string` | Yes | SUB- followed by subnet netuid "SUB-19" |
| `resolution` | query | `string` | Yes | granularity of data (possible values: 1,5,15,60 for minutes, 1D, 7D, 30D for days) |
| `from` | query | `integer (int32)` |  | unix timestamp |
| `to` | query | `integer (int32)` | Yes | unix timestamp |
| `countback` | query | `integer (int32)` |  |  |

## Responses

### `200` — History retrieved successfully

| Field | Type | Required |
| --- | --- | --- |
| `c` | `array, nullable` |  |
| `c[]` | `number (double)` |  |
| `h` | `array, nullable` |  |
| `h[]` | `number (double)` |  |
| `l` | `array, nullable` |  |
| `l[]` | `number (double)` |  |
| `nextTime` | `integer (int32), nullable` |  |
| `o` | `array, nullable` |  |
| `o[]` | `number (double)` |  |
| `s` | `string` | Yes |
| `t` | `array, nullable` |  |
| `t[]` | `integer (int32)` |  |
| `v` | `array, nullable` |  |
| `v[]` | `number (double)` |  |

**Example response**

```json
{
  "c": [
    0.112485,
    0.112093
  ],
  "h": [
    0.126404,
    0.119289
  ],
  "l": [
    0.107904,
    0.097772
  ],
  "o": [
    0.121455,
    0.112485
  ],
  "s": "ok",
  "t": [
    1743975744,
    1744062144
  ],
  "v": [
    10185.2743107528,
    22702.8728905252
  ]
}
```

**Response details**

```text
{
  "s": "ok",
  "t": [
  <unix timestamps>
  ],
  "c": [
<close prices>
  ],
  "o": [
<open prices>
  ],
  "h": [
<high prices>
  ],
  "l": [
<low prices>
  ],
  "v": [
<volumes>
  ]
}
```

Every request needs an `Authorization` header holding your API key — see [Getting started with the Taostats API](https://beta.taostats.io/docs/start-here/getting-started-with-taostats-api).
