# Breakdown Trading Data (/markets/breakdown)

`GET`    /v2/markets/breakdown

## Overview

Detail Breakdown Trading Data is extracted from daily trading values and volumes (only regular trading sessions on the TSE market) per TSE-listed issue based on flags for margin transactions and short selling that are attached to orders at the time of placement.

### Attention

> **Info**
>
> - Even in the event of a corporate action for the issue, items of volume will not be retrospectively adjusted.
> - The data for Oct, 1st 2020 does not exist because trading was halted all day due to the failure of the equity trading system.

## Get daily trading values and volumes

`GET` `https://api.jquants.com/v2/markets/breakdown`

In your request message, 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 data of a specific issue.

- code: ✓, date: ✓, from /to: – → Data of a specific issue for a specific date.

- code: ✓, date: –, from /to: ✓ → Data of a specific issue for the specified period.

- code: –, date: ✓, from /to: – → All listed issue data 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 | Issue code (e.g. 27800 or 2780) If a 4-character issue code is specified, only the data of common stock will be obtained for the issue on which both common and preferred stocks are listed. |
| 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)                                                                                                                                       |
| date            | string | Optional | Date of data when from and to are not specified (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/markets/breakdown

**cURL**

```bash
curl -G https://api.jquants.com/v2/markets/breakdown \
-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/markets/breakdown", {
params: {
  code: '{{code}}',
  date: '{{date}}',
},
})
```

**Python**

```python
import requests

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

### Responses

### Data Item

| Parameter       | Type   | Required | Description                                                                                                                    |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Date            | string | Required | Trade date (YYYY-MM-DD)                                                                                                        |
| Code            | string | Required | Issue code                                                                                                                     |
| LongSellVa      | number | Required | Long selling trading value Breakdown of sell trading value                                                                     |
| ShrtNoMrgnVa    | number | Required | Trading value of short selling (excluding new margin sell) Breakdown of sell trading value                                     |
| MrgnSellNewVa   | number | Required | Trading value of new margin selling (sell orders that create new margin sell positions) Breakdown of sell trading value        |
| MrgnSellCloseVa | number | Required | Trading value of closing margin selling (sell orders that close existing margin buy positions) Breakdown of sell trading value |
| LongBuyVa       | number | Required | Long buying Trading value Breakdown of buy trading value                                                                       |
| MrgnBuyNewVa    | number | Required | Trading value of new margin buying (buy orders that create new margin buy positions) Breakdown of buy trading value            |
| MrgnBuyCloseVa  | number | Required | Closing margin buying (buy orders that close existing margin sell positions) Breakdown of buy trading value                    |
| LongSellVo      | number | Required | Long selling Trading volume Breakdown of sell trading volume                                                                   |
| ShrtNoMrgnVo    | number | Required | Trading volume of short selling (excluding new margin selling) Breakdown of sell trading volume                                |
| MrgnSellNewVo   | number | Required | Trading volume of new margin selling (sell orders that create new margin sell positions) Breakdown of sell trading volume      |
| MrgnSellCloseVo | number | Required | Closing margin selling (sell orders that close existing margin buy positions) Trading volume Breakdown of sell trading volume  |
| LongBuyVo       | number | Required | Long buying Trading volume Breakdown of buy trading volume                                                                     |
| MrgnBuyNewVo    | number | Required | Trading volume of new margin buying (buy orders that create new margin buy positions) Breakdown of buy trading volume          |
| MrgnBuyCloseVo  | number | Required | Trading volume of closing margin buying (buy orders that close existing margin sell positions) Breakdown of buy trading volume |

### Sample Response

```bash {{ title: "200:OK" }}
{
    "data": [
        {
            "Date": "2015-04-01",
            "Code": "13010",
            "LongSellVa": 115164000.0,
            "ShrtNoMrgnVa": 93561000.0,
            "MrgnSellNewVa": 6412000.0,
            "MrgnSellCloseVa": 23009000.0,
            "LongBuyVa": 185114000.0,
            "MrgnBuyNewVa": 35568000.0,
            "MrgnBuyCloseVa": 17464000.0,
            "LongSellVo": 415000.0,
            "ShrtNoMrgnVo": 337000.0,
            "MrgnSellNewVo": 23000.0,
            "MrgnSellCloseVo": 83000.0,
            "LongBuyVo": 667000.0,
            "MrgnBuyNewVo": 128000.0,
            "MrgnBuyCloseVo": 63000.0
        }
    ],
    "pagination_key": "value1.value2."
}
```
