> For the complete documentation index, see [llms.txt](https://docs.infoway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infoway.io/en-docs/getting-started/endpoints.md).

# Endpoints

This section describes how to access real-time and historical market data through our REST APIs. All endpoints support batch queries and follow a consistent RESTful path structure.

How to reach REST and WebSocket market data.

Auth: send `apiKey` (also accepted as `apikey`) on HTTP headers. Quote WebSockets and the news channel take `apikey` as a query parameter.

Symbol suffixes: Symbol convention. Rate limits: [REST API Limitation](/en-docs/getting-started/api-limitation/rest-api-limitation.md) and [WebSocket Limitation](/en-docs/getting-started/api-limitation/websocket-limitation.md). Error codes: [REST API Error Codes](/en-docs/getting-started/error-codes/rest-api-error-codes.md) and [WebSocket Error Codes](/en-docs/getting-started/error-codes/websocket-error-codes.md). Protocols: [HTTP Protocols](/en-docs/getting-started/http-protocols.md).

### HTTP

Host: `https://data.infoway.io`

#### 1. Batch candlesticks (POST + JSON body)

API reference: [POST Candlestick](/en-docs/rest-api/market-data/post-candlestick-real-historical.md)

This endpoint is POST with a JSON body.

| Market                               | Path                     |
| ------------------------------------ | ------------------------ |
| Equities (US, HK, CN A-shares)       | `/stock/v2/batch_kline`  |
| Crypto                               | `/crypto/v2/batch_kline` |
| Forex, commodities, futures, indices | `/common/v2/batch_kline` |
| Japan                                | `/japan/v2/batch_kline`  |
| India                                | `/india/v2/batch_kline`  |
| Korea                                | `/korea/v2/batch_kline`  |
| Taiwan                               | `/taiwan/v2/batch_kline` |

```http
POST https://data.infoway.io/stock/v2/batch_kline
Content-Type: application/json
apiKey: <your-api-key>

{
    "klineType": 1,
    "klineNum": 2,
    "codes": "TSLA.US,AAPL.US"
}
```

#### 2. Batch latest trades (GET)

API reference: [GET Latest Trade](/en-docs/rest-api/market-data/get-latest-trade.md)

| Market                        | Path                          |
| ----------------------------- | ----------------------------- |
| Equities                      | `/stock/batch_trade/{codes}`  |
| Crypto                        | `/crypto/batch_trade/{codes}` |
| Forex / commodities / futures | `/common/batch_trade/{codes}` |
| Japan                         | `/japan/batch_trade/{codes}`  |
| India                         | `/india/batch_trade/{codes}`  |
| Korea                         | `/korea/batch_trade/{codes}`  |
| Taiwan                        | `/taiwan/batch_trade/{codes}` |

```http
GET https://data.infoway.io/stock/batch_trade/TSLA.US,AAPL.US
```

For crypto trades, add the query parameter `withMarkPrice=true` to request perpetual-contract index price, mark price, funding rate and next funding time. It is disabled by default; see the trade reference above.

#### 3. Batch order book (GET)

API reference: [GET Market Depth](/en-docs/rest-api/market-data/get-market-depth.md)

| Market                        | Path                          |
| ----------------------------- | ----------------------------- |
| Equities                      | `/stock/batch_depth/{codes}`  |
| Crypto                        | `/crypto/batch_depth/{codes}` |
| Forex / commodities / futures | `/common/batch_depth/{codes}` |
| Japan                         | `/japan/batch_depth/{codes}`  |
| India                         | `/india/batch_depth/{codes}`  |
| Korea                         | `/korea/batch_depth/{codes}`  |
| Taiwan                        | `/taiwan/batch_depth/{codes}` |

```http
GET https://data.infoway.io/common/batch_depth/EURUSD,XAUUSD
```

#### 4. Basic info

| Purpose          | Path                                         | Docs                                                                                     |
| ---------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Symbol list      | `GET /common/basic/symbols`                  | [GET Symbol List](/en-docs/rest-api/get-basic-info/get-symbol-list.md)                   |
| Symbol info      | `GET /common/basic/symbols/info`             | [GET Symbol Fundamentals](/en-docs/rest-api/get-basic-info/get-symbol-fundamentals.md)   |
| Trading days     | `GET /common/basic/markets/trading_days`     | [GET Market Trading Days](/en-docs/rest-api/get-basic-info/get-market-trading-days.md)   |
| Trading schedule | `GET /common/basic/markets/trading_schedule` | [GET Market Trading Hours](/en-docs/rest-api/get-basic-info/get-market-trading-hours.md) |

#### 5. Package quota

```http
GET https://data.infoway.io/package/info
```

See GET package info. Rate table: [REST API Limitation](/en-docs/getting-started/api-limitation/rest-api-limitation.md).

### 6. Monthly candlestick archive download (POST)

`POST https://data.infoway.io/kline/archive/download` accepts a JSON body containing `market`, `klineType`, and a `yyyyMM` array. It supports markets including `crypto` and `common`, and returns temporary download URLs and the remaining daily request quota. See [Monthly Candlestick Archive Download](/en-docs/rest-api/market-data/post-kline-archive-download.md).

### WebSocket

Choose the market with `business` and open separate connections for different markets. Connection and subscription quotas depend on the current plan and gateway rules; see [WebSocket Limitation](/en-docs/getting-started/api-limitation/websocket-limitation.md). Use `crypto` for digital assets and `common` for forex, commodities, futures and indices (TV-related market data):

```
wss://data.infoway.io/ws?business=stock&apikey=<your-api-key>
wss://data.infoway.io/ws?business=crypto&apikey=<your-api-key>
wss://data.infoway.io/ws?business=common&apikey=<your-api-key>
wss://data.infoway.io/ws?business=japan&apikey=<your-api-key>
wss://data.infoway.io/ws?business=india&apikey=<your-api-key>
wss://data.infoway.io/ws?business=korea&apikey=<your-api-key>
wss://data.infoway.io/ws?business=taiwan&apikey=<your-api-key>
```

News is a **separate** entitlement and a **separate** connection:

```
wss://data.infoway.io/news?apikey=<your-api-key>
```
