# Get TradingView Udf History

OHLC candles for charting.

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

_Last reviewed: 2026-10-07_

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

Requires an API key in the `Authorization` header.

OHLC candles for charting.

## 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/v1/tradingview/udf/history"
```

**JavaScript**

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

**Python**

```python
import requests

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

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `symbol` | query | `string` | Yes | Symbol identifier: `SUB-<netuid>`, or `SUB--1` for the total series. Required: a missing value is rejected with 400. |
| `resolution` | query | `string` | Yes | Resolution token: `1`, `5`, `15`, `60`, `240`, `1D`, `7D`, `30D`. Required: a missing value is rejected with 400. |
| `from` | query | `integer (int64)` |  | Range start, Unix seconds (inclusive). |
| `to` | query | `integer (int64)` | Yes | Range end, Unix seconds (inclusive). Required. |
| `countback` | query | `integer (int32)` |  | Number of bars to return (most recent within the range). |

## Responses

### `200` — TradingView UDF OHLC history

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `c` | `array, nullable` |  | Close prices. |
| `c[]` | `number (double)` |  |  |
| `h` | `array, nullable` |  | High prices. |
| `h[]` | `number (double)` |  |  |
| `l` | `array, nullable` |  | Low prices. |
| `l[]` | `number (double)` |  |  |
| `nextTime` | `integer (int64), nullable` |  | Next available data timestamp (Unix seconds) when `s = "no_data"`. |
| `o` | `array, nullable` |  | Open prices. |
| `o[]` | `number (double)` |  |  |
| `s` | `string` | Yes | `"ok"` or `"no_data"`. |
| `t` | `array, nullable` |  | Candle open timestamps (Unix seconds). |
| `t[]` | `integer (int64)` |  |  |
| `v` | `array, nullable` |  | Per-bar alpha volume traded, parallel-indexed with `t`. Sourced from `dtao_subnet_volume_v1`; `0` for a bar with no trades. |
| `v[]` | `number (double)` |  |  |

### `400` — Invalid query parameter

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | `string` | Yes | Plain-english message describing the failure from the caller's perspective. |
| `status_code` | `integer (int32)` | Yes | HTTP status code (mirrored in the response status line for convenience). |

### `500` — Internal server error

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | `string` | Yes | Plain-english message describing the failure from the caller's perspective. |
| `status_code` | `integer (int32)` | Yes | HTTP status code (mirrored in the response status line for convenience). |

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).
