# GET Market Trading Days

### Overview

The **Market Trading Days API** provides the trading day information for different markets. It includes both full trading days and half-day trading sessions. This API allows users to query market-specific trading days within a specified date range.

### Endpoint

* Base Path: `/common/basic/markets/trading_days`
* Full Path: `https://data.infoway.io  /common/basic/markets/trading_days`

### Request Frequency

This API shares the same rate limits as other endpoints. The number of allowed requests per second depends on your subscription plan. Please refer to the [**Rate Limit**](https://docs.infoway.io/en-docs/getting-started/api-limitation/rest-api-limitation) for details.

### Error Codes

See the [HTTP Error Codes](https://docs.infoway.io/en-docs/getting-started/error-codes/rest-api-error-codes) section for reference.

### Authentication

Each request must include your **API Key** in the header.

| **Header** | **Type** | **Required** | **Description**                                 |
| ---------- | -------- | ------------ | ----------------------------------------------- |
| `apiKey`   | String   | Yes          | Your API Key associated with your current plan. |

### Request Parameters

| **Parameter** | **Type** | **Required** | **Description**                                            | **Example** |
| ------------- | -------- | ------------ | ---------------------------------------------------------- | ----------- |
| `market`      | String   | Yes          | Market code. Options include `US`, `HK`, `CN`, `IN`, `JP`. | `US`        |
| `beginDay`    | String   | Yes          | Start date for the query, in `YYYYMMDD` format.            | `20230101`  |
| `endDay`      | String   | Yes          | End date for the query, in `YYYYMMDD` format.              | `20230301`  |

### Example Request

```
GET https://data.infoway.io/common/basic/markets/trading_days?market=US&beginDay=20230101&endDay=20230301

```

### Example Response

```json
{
  "ret": 200,
  "msg": "success",
  "traceId": "46fbf427-a30e-48ff-8760-9fb20025c667",
  "data": {
    "trade_days": [
      "20230221",
      "20230222",
      "20230223",
      "20230224",
      "20230227",
      "20230228",
      "20230301"
    ],
    "half_trade_days": []
  }
}
```

### Response Fields

| **Field**         | **Type** | **Required** | **Description**                                         | **Example / Values**   |
| ----------------- | -------- | ------------ | ------------------------------------------------------- | ---------------------- |
| `trade_days`      | List     | No           | List of full trading days in `YYYYMMDD` format.         | `20230221`, `20230222` |
| `half_trade_days` | List     | No           | List of half-day trading sessions in `YYYYMMDD` format. | `20230201`             |

### Notes

* The `trade_days` field contains the full trading days within the specified date range.
* The `half_trade_days` field lists any half-day trading sessions, if applicable.
* It is important to ensure that the requested date range is correct, as the API will only return trading days within the given timeframe.
