# Indices (OHLC) (/indices/bars/daily)

`GET`    /v2/indices/bars/daily

## Overview

Available various indices.

Please refer to [this page](/en/spec/idx-bars-daily/indexcodes) for the currently distributed indices.

### Attention

> **Info**
>
> - Although the Tokyo Stock Exchange Mothers market was reorganized on April 4, 2022, based on certain rules, the replacement of the component stocks of the Tokyo Stock Exchange Mothers Index was carried out, and on November 6, 2023, the index name was changed to "Tokyo Stock Exchange Growth Market 250 Index". For details, please refer to [here](https://www.jpx.co.jp/english/news/6030/20230428-01.html).
> - The OHLC data for Oct. 1st, 2020 includes the closing price from the previous trading day (Sep. 30th, 2020) because trading was halted all day due to the failure of the equity trading system, arrowhead.
> - Some indices are available only with the Premium plan.
> - For some indices, only the closing price is provided.

## Get daily various indices prices (OHLC)

`GET` `https://api.jquants.com/v2/indices/bars/daily`

Either "code" or "date" must be specified.

### Parameter and Response

In your request message, either "code" or "date" must be specified.\
Combination of parameter in the request and results are as below.

- code: ✓, date: –, from /to: – → All historical indices prices of a specific index code.

- code: ✓, date: ✓, from /to: – → Indices prices of a specific index code on the specific date.

- code: ✓, date: –, from /to: ✓ → Indices prices of a specific index code for the specified period.

- code: –, date: ✓, from /to: – → All listed indices prices for the specific date.

### Requests

### Headers

| Parameter | Type   | Required | Description |
| --------- | ------ | -------- | ----------- |
| x-api-key | string | Required | API Key     |

### Query Parameters

> **Note**
>
> Either **code** or **date** must be specified.

| Parameter       | Type   | Required | Description                                                                                                                                           |
| --------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| code            | string | Optional | Index code (e.g. 0000 or 0028)  Please refer to [the index codes page](/en/spec/idx-bars-daily/indexcodes) for the currently distributed indices. |
| date            | string | Optional | Date of data when "from" and "to" are not specified (e.g. 20210907 or 2021-09-07)                                                                     |
| from            | string | Optional | Starting point of data period (e.g. 20210901 or 2021-09-01)                                                                                           |
| to              | string | Optional | End point of data period (e.g. 20210907 or 2021-09-07)                                                                                                |
| pagination\_key | string | Optional | The primary key of the first item that this operation will evaluate. Use the value that was returned for pagination\_key in the previous operation.   |

### Sample Code

/v2/indices/bars/daily

**cURL**

```bash
curl -G https://api.jquants.com/v2/indices/bars/daily \
-H "x-api-key: {{apiKey}}" \
-d code="{{code}}" \
-d date="{{date}}"
```

**JavaScript**

```javascript
import axios from 'axios'

const client = axios.create({
baseURL: "https://api.jquants.com",
headers: { "x-api-key": "{{apiKey}}" },
})

await client.get("/v2/indices/bars/daily", {
params: {
  code: '{{code}}',
  date: '{{date}}',
},
})
```

**Python**

```python
import requests

headers = {"x-api-key": "{{apiKey}}"}
resp = requests.get(
  "https://api.jquants.com/v2/indices/bars/daily",
  params={"code": "{{code}}", "date": "{{date}}"},
  headers=headers,
)
print(resp.json())
```

### Responses

### Data Item

| Parameter | Type   | Required | Description                                                                                                            |
| --------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| Date      | string | Required | Date (YYYY-MM-DD)                                                                                                      |
| Code      | string | Required | Index Code  Please refer to [this page](/en/spec/idx-bars-daily/indexcodes) for the currently distributed indices. |
| O         | number | Required | Open Price（※）                                                                                                          |
| H         | number | Required | High Price（※）                                                                                                          |
| L         | number | Required | Low Price（※）                                                                                                           |
| C         | number | Required | Close Price                                                                                                            |

※ Null is set for indices where only the closing price is provided.

### Response Sample

```bash {{ title: "200:OK" }}
{
    "data": [
        {
            "Date": "2023-12-01",
            "Code": "0028",
            "O": 1199.18,
            "H": 1202.58,
            "L": 1195.01,
            "C": 1200.17
        }
    ],
    "pagination_key": "value1.value2."
}
```
