Market Data

data-ohlc

Retrieve OHLCV candle data for a time range. Intraday data is available for the most recent year; daily data is available from when the securities symbol started trading.

GET
/api/v3/data/ohlc

Authorization

Bearer
AuthorizationBearer <token>

Enter the JWT token in the format Bearer <token>.

In: header

Header Parameters

Content-Typestringrequired

The content format of the request body, use "application/json".

User-Agentstringoptional

Information about the client sending the request.

Accept-Languagestringoptional

The desired response language. If this header is absent, the system defaults to en.

Query Parameters

symbolstringrequired

The securities symbol for which to retrieve OHLCV data.

fromstringrequired

The start timestamp. Format `YYYY/MM/DD` for daily data and `YYYY/MM/DD HH:mm:ss` for intraday data.

tostringrequired

The end timestamp. Format `YYYY/MM/DD` for daily data and `YYYY/MM/DD HH:mm:ss` for intraday data.

timeFramestringoptional

The time frame of the OHLCV data. The value can be `1m`, `3m`, `5m`, `15m`, `30m`, `1h`, or `1d`. If not provided, the system uses the default value of `1d`.

pageIndexintegeroptional

The page index for paginated results, starting from 1. If not provided, the system uses the default value of 1. This value, combined with `pageSize`, lets the client retrieve different portions of the historical order book data when there are many records.

pageSizeintegeroptional

The number of records per page for paginated results. If not provided, the system uses the default value of 10. This value, combined with `pageIndex`, lets the client retrieve different portions of the historical order book data when there are many records.

Response Headers

X-RATELIMIT-LIMITstringoptional

The request limit for the period.

X-RATELIMIT-REMAININGstringoptional

The number of requests remaining in the current period.

X-RATELIMIT-RESETstringoptional

The time at which the request limit resets.

Response Body

application/json

application/json

curl -X GET "https://api.ssi.com.vn/api/v3/data/ohlc?symbol=string&from=string&to=string" \  -H "Content-Type: application/json"

Success

{
  "pageSize": 0,
  "pageIndex": 0,
  "data": [
    {
      "symbol": "string",
      "tradingDate": "string",
      "open": "string",
      "high": "string",
      "low": "string",
      "close": "string",
      "volume": "string",
      "value": "string"
    }
  ]
}

Invalid request.

{
  "code": "400",
  "msg": "Invalid request"
}