Skip to content
Price Comparison

Get Security Price Comparison

Returns price series and base prices for several securities over the selected period so that their trends can be compared on one chart. The comparison block on the security detail page sends the current security, the selected comparison index, and the security's industry, in that order. The Broker App uses each security's base price to calculate the change at every point. The US index chart on the market page also uses this operation to load intraday prices for several indexes at once with the intraday period.

When the securities span markets and the period is too short, the operation returns unsupported as true instead of price series. The Broker App should then tell the Client that cross-market comparison requires a period of 6 months or longer, and clear the chart.

POSThttps://api.lbkrs.com/v1/quote/securities_contrast

Request body application/json

securitiesarray<string>required

IDs of the securities to compare, such as ST/US/AAPL. The data array at each point follows this order

periodintegerrequired

Comparison period:

  • 0 - Today
  • 1 - 6 months
  • 2 - Year to date
  • 3 - 1 year
  • 4 - 3 years
  • 5 - 5 years
  • 6 - All
  • 7 - 1 week
  • 8 - 1 month
Values
0
1
2
3
4
5
6
7
8

Responses

HTTP 200The request succeeded. The response body contains the result of the “Get Security Price Comparison” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
coordinatesarray<object>

Price series in ascending time order

Child attributes
timestampinteger

Unix timestamp of the point, in seconds

dataarray<object>

Prices of the securities, in the same order as securities in the request

Child attributes
pricestring

Price of the security at this point, as a decimal string. Empty when the security has no data at this point

prev_dataarray<object>

Base price of each security, used to calculate the change at each point in coordinates, in the same order as securities in the request

Child attributes
pricestring

Base price, as a decimal string

line_typeinteger

Candlestick granularity of the returned data. Pass the same granularity when you query historical trade points for the same range

unsupportedboolean

Whether the requested combination does not support cross-market comparison for this period. When true, no price series is returned

Whale Docs