# Interval Chart

## GET /api/mkt-data/chart/interval-data

Interval Chart

This service can be used to fetch the open, high, low, close and volume values (chart data points) of a given symbol.

Also it provides sum up volume of last tick to calculate the current minute volume.

For derivative symbol, an additional field Open Interest Change for that particular minute will be added in same response array.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| Authorization | header | string | Yes | Access token in the following format:  Bearer <api_key>:<access_token>  Both values are required. The `api_key` is your app credential from the Apps Section. The `access_token` is obtained from the authentication endpoint and is valid for 24 hours. |
| from | query | integer | Yes | Enter starting datetime(eg: 2023-06-01 9:15:00 ) in timestamp(eg: 1685591100) |
| to | query | integer | Yes | Enter ending datetime(eg: 2023-06-01 13:12:34) in timestamp(eg: 1685605354) |
| interval | query | string ("1") | Yes | Enter time interval in minutes |
| id | query | string | Yes | Enter Symbol id |

### Responses

#### 200 — successful response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("ok" | "no-data" | "error") | No |  |
| d | object | No |  |
| d.bars | object[][] | No |  |
| d.bars[][].time | integer | No |  |
| d.bars[][].open | number | No |  |
| d.bars[][].high | number | No |  |
| d.bars[][].low | number | No |  |
| d.bars[][].close | number | No |  |
| d.bars[][].volume | integer | No |  |
| d.bars[][].minuteOi | integer | No |  |
| d.sumUpVolume | integer | No |  |
| msg | string ("no-data" | "error msg") | No |  |
| s | string ("ok" | "error" | "no-data") | No |  |

#### 400 — Bad Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Internal Error occurred. Kindly try again." | "Input validation failed. Kindly check your input contains required fields for the request") | No | Error message describing which field failed validation or why the request was rejected. |

#### 401 — Unauthorized — one of: (1) invalid or expired access token — tokens expire after 24 hours, re-authenticate to get a new one; (2) `Authorization` header missing or malformed — use format `Bearer <api_key>:<access_token>`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string ("Unauthorized") | No | Error message. |

#### 429 — Too Many Requests — rate limit exceeded. General API: 10 req/sec per auth token (400 req/min).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message indicating the rate limit was exceeded. |

#### 500 — Internal Server Error — retry with backoff; contact support if it persists.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| s | string ("error") | No | Response status. Always `error` for error responses. |
| msg | string | No | Error message. |