GET api/Candles/{priceSource}?time={time}&count={count}&externalSymbolId={externalSymbolId}&period={period}

Gets the requested number of complete candles running into the past from the time given, for the given market. For example, a request with a count of 100 would give the 100 candles that immediately predate the supplied time (this is inclusive; the candle that the given time falls within will also be included). Incomplete candles are available via the Lightstreamer streaming API. Candles may not be recorded for all periods of time, so the returned candles may not be contiguous. Requests that would result in excessively large data sets will be rejected with a status code of 400. You are not guaranteed to get the full number of candles requested. Return data is ordered from oldest to newest.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
priceSource

The source of the prices for the candles. Each price source may use a different symbol id for the same market

PriceSource

Required

time

The inclusive time to get candles before (in UTC)

date

Required

count

The number of candles to return

integer

Required

externalSymbolId

The prices source's symbol id for which candles should be returned

string

Required

period

The period of time (in minutes) that each returned candle should represent

integer

Required

Body Parameters

None

Response Information

Resource Description

CandleResponse
NameDescriptionTypeAdditional information
Content

A collection of candles sorted by start time ascending

Collection of Candle

None

Response Formats

application/json, text/json

Sample:
{
  "Content": [
    {
      "Time": "2000-01-01T00:00:00",
      "Key": "123",
      "Open": 100.0,
      "Close": 200.0,
      "High": 250.0,
      "Low": 50.0
    },
    {
      "Time": "2000-01-01T00:01:00",
      "Key": "123",
      "Open": 100.0,
      "Close": 200.0,
      "High": 250.0,
      "Low": 50.0
    }
  ]
}