POST Candlestick

Access real-time candlestick data for stocks, crypto, forex, energy, and commodities with the Candlestick API. Perfect for market analysis and trading strategies.

Overview

The Real-Time Candlestick API provides the latest candlestick data (OHLCV - Open, High, Low, Close, Volume) for various financial products, including stocks, cryptocurrencies, forex, energy, commodities, and more. This API allows users to retrieve real-time candlestick data for a specified list of symbols, based on different time intervals.

Endpoint

Market
Endpoint

Stocks

https://data.infoway.io/stock/v2/batch_kline

Crypto

https://data.infoway.io/crypto/v2/batch_kline

Forex, Commodities, Futures

https://data.infoway.io/common/v2/batch_kline

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 Policy for details.

Error Codes

See the HTTP 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 Body Parameters (JSON)

Parameter

Type

Required

Description

Example

klineType

int

Yes

The type of candlestick interval. Options: 1 = 1 minute 2 = 5 minutes 3 = 15 minutes 4 = 30 minutes 5 = 1 hour 6 = 2 hours 7 = 4 hours 8 = 1 day 9 = 1 week 10 = 1 month 11 = 1 quarter 12 = 1 year

1

klineNum

int

Yes

Number of candle to query (up to 500 candles per symbol; for multiple symbols, only the most recent 2 candles per symbol can be queried).

500

codes

String

Yes

Comma-separated list of product codes to query. (Up to 100 symbol at once).

TSLA.US,AAPL.US

timestamp

Long

No

For minute and hourly candlestick only. A timestamp in seconds to query historical data. If not provided, the most recent candles are returned.

1727007864

Example Response

{
    "ret": 200,
    "msg": "success",
    "traceId": "19814db2-42f7-4788-9b51-b2001bf17953",
    "data": [
        {
            "s": "TSLA.US",
            "respList": [
                {
                    "t": "1751372340",
                    "h": "298.620",
                    "o": "298.439",
                    "l": "298.100",
                    "c": "298.310",
                    "v": "24329",
                    "vw": "7259092.235",
                    "pc": "-0.02%",
                    "pca": "-0.070"
                },
                {
                    "t": "1751372280",
                    "h": "298.450",
                    "o": "298.090",
                    "l": "298.000",
                    "c": "298.380",
                    "v": "32214",
                    "vw": "9607344.900",
                    "pc": "0.10%",
                    "pca": "0.290"
                }
            ]
        },
        {
            "s": "01810.HK",
            "respList": [
                {
                    "t": "1751270400",
                    "h": "59.950",
                    "o": "59.950",
                    "l": "59.950",
                    "c": "59.950",
                    "v": "23669600",
                    "vw": "1418992520.000",
                    "pc": "0.50%",
                    "pca": "0.300"
                },
                {
                    "t": "1751270340",
                    "h": "59.700",
                    "o": "59.650",
                    "l": "59.650",
                    "c": "59.650",
                    "v": "829002",
                    "vw": "49466778.300",
                    "pc": "-0.08%",
                    "pca": "-0.050"
                }
            ]
        }
    ]
}

Response Fields

Field

Type

Required

Description

Example / Values

s

String

Yes

Product code or symbol.

TSLA.US

respList

Array

Yes

List of candlestick data for the symbol.

See below

respList Fields

Field

Type

Required

Description

Example

t

string

Yes

Time of the candlestick in Unix timestamp format (seconds).

1751372340

h

string

Yes

High price of the candlestick.

298.620

o

string

Yes

Open price of the candlestick.

298.439

l

string

Yes

Low price of the candlestick.

298.100

c

string

Yes

Close price of the candlestick.

298.310

v

string

Yes

Volume of the candlestick.

24329

vw

string

Yes

Weighted average price of the candlestick.

7259092.235

pc

string

Yes

Percentage change in price.

-0.02%

pca

string

Yes

Price change in absolute terms.

-0.070

Notes

  • This API supports various candlestick intervals (e.g., 1 minute, 5 minutes, 1 day, 1 week, etc.) to suit different trading strategies and analysis needs.

  • The timestamp field allows you to query historical candlestick data based on a specific point in time, which is especially useful for minute and hourly intervals.

  • The klineNum parameter allows you to specify the number of candlestick to query, with a maximum of 500 candles per product.

Last updated