> 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": 10,
    "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
```

#### 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).

### WebSocket

Quote channels (several `business` values usually count as one plan connection):

```
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>
```
