Which API should I use?

  • Use v20 REST API only if you have a v20 account
  • Use v1 REST API if your account id contains only digits (ie. 2534253) as it is a legacy account

Instrument Definitions


Value Description
S5 5 second candlesticks, minute alignment
S10 10 second candlesticks, minute alignment
S15 15 second candlesticks, minute alignment
S30 30 second candlesticks, minute alignment
M1 1 minute candlesticks, minute alignment
M2 2 minute candlesticks, hour alignment
M4 4 minute candlesticks, hour alignment
M5 5 minute candlesticks, hour alignment
M10 10 minute candlesticks, hour alignment
M15 15 minute candlesticks, hour alignment
M30 30 minute candlesticks, hour alignment
H1 1 hour candlesticks, hour alignment
H2 2 hour candlesticks, day alignment
H3 3 hour candlesticks, day alignment
H4 4 hour candlesticks, day alignment
H6 6 hour candlesticks, day alignment
H8 8 hour candlesticks, day alignment
H12 12 hour candlesticks, day alignment
D 1 day candlesticks, day alignment
W 1 week candlesticks, aligned to start of week
M 1 month candlesticks, aligned to first day of the month

Value Description
Monday Monday
Tuesday Tuesday
Wednesday Wednesday
Thursday Thursday
Friday Friday
Saturday Saturday
Sunday Sunday

Candlestick is an application/json object with the following Schema:

{
    # 
    # The start time of the candlestick
    # 
    time : (DateTime),

    # 
    # The candlestick data based on bids. Only provided if bid-based candles
    # were requested.
    # 
    bid : (CandlestickData),

    # 
    # The candlestick data based on asks. Only provided if ask-based candles
    # were requested.
    # 
    ask : (CandlestickData),

    # 
    # The candlestick data based on midpoints. Only provided if midpoint-based
    # candles were requested.
    # 
    mid : (CandlestickData),

    # 
    # The number of prices created during the time-range represented by the
    # candlestick.
    # 
    volume : (integer),

    # 
    # A flag indicating if the candlestick is complete. A complete candlestick
    # is one whose ending time is not in the future.
    # 
    complete : (boolean)
}

CandlestickData is an application/json object with the following Schema:

{
    # 
    # The first (open) price in the time-range represented by the candlestick.
    # 
    o : (PriceValue),

    # 
    # The highest price in the time-range represented by the candlestick.
    # 
    h : (PriceValue),

    # 
    # The lowest price in the time-range represented by the candlestick.
    # 
    l : (PriceValue),

    # 
    # The last (closing) price in the time-range represented by the
    # candlestick.
    # 
    c : (PriceValue)
}

CandlestickResponse is an application/json object with the following Schema:

{
    # 
    # The instrument whose Prices are represented by the candlesticks.
    # 
    instrument : (InstrumentName),

    # 
    # The granularity of the candlesticks provided.
    # 
    granularity : (CandlestickGranularity),

    # 
    # The list of candlesticks that satisfy the request.
    # 
    candles : (Array[Candlestick])
}

OrderBook is an application/json object with the following Schema:

{
    # 
    # The order book’s instrument
    # 
    instrument : (InstrumentName),

    # 
    # The time when the order book snapshot was created.
    # 
    time : (DateTime),

    # 
    # The price (midpoint) for the order book’s instrument at the time of the
    # order book snapshot
    # 
    price : (PriceValue),

    # 
    # The price width for each bucket. Each bucket covers the price range from
    # the bucket’s price to the bucket’s price + bucketWidth.
    # 
    bucketWidth : (PriceValue),

    # 
    # The partitioned order book, divided into buckets using a default bucket
    # width. These buckets are only provided for price ranges which actually
    # contain order or position data.
    # 
    buckets : (Array[OrderBookBucket])
}

OrderBookBucket is an application/json object with the following Schema:

{
    # 
    # The lowest price (inclusive) covered by the bucket. The bucket covers the
    # price range from the price to price + the order book’s bucketWidth.
    # 
    price : (PriceValue),

    # 
    # The percentage of the total number of orders represented by the long
    # orders found in this bucket.
    # 
    longCountPercent : (DecimalNumber),

    # 
    # The percentage of the total number of orders represented by the short
    # orders found in this bucket.
    # 
    shortCountPercent : (DecimalNumber)
}

PositionBook is an application/json object with the following Schema:

{
    # 
    # The position book’s instrument
    # 
    instrument : (InstrumentName),

    # 
    # The time when the position book snapshot was created
    # 
    time : (DateTime),

    # 
    # The price (midpoint) for the position book’s instrument at the time of
    # the position book snapshot
    # 
    price : (PriceValue),

    # 
    # The price width for each bucket. Each bucket covers the price range from
    # the bucket’s price to the bucket’s price + bucketWidth.
    # 
    bucketWidth : (PriceValue),

    # 
    # The partitioned position book, divided into buckets using a default
    # bucket width. These buckets are only provided for price ranges which
    # actually contain order or position data.
    # 
    buckets : (Array[PositionBookBucket])
}

PositionBookBucket is an application/json object with the following Schema:

{
    # 
    # The lowest price (inclusive) covered by the bucket. The bucket covers the
    # price range from the price to price + the position book’s bucketWidth.
    # 
    price : (PriceValue),

    # 
    # The percentage of the total number of positions represented by the long
    # positions found in this bucket.
    # 
    longCountPercent : (DecimalNumber),

    # 
    # The percentage of the total number of positions represented by the short
    # positions found in this bucket.
    # 
    shortCountPercent : (DecimalNumber)
}

RawMarketPriceLevel is an application/json object with the following Schema:

{
    # 
    # The amount of liquidity for the bucket.
    # 
    liquidity : (DecimalNumber),

    # 
    # The price to use for the bucket.
    # 
    price : (DecimalNumber)
}

RawMarketPriceDepthOfMarket is an application/json object with the following Schema:

{
    # 
    # The list of prices and liquidity available on the Instrument’s bid side
    # of the RawMarketPrice.
    # 
    bids : (Array[RawMarketPriceLevel]),

    # 
    # The list of prices and liquidity available on the Instrument’s ask side
    # of the RawMarketPrice.
    # 
    asks : (Array[RawMarketPriceLevel])
}

Value Description
PRESENT_VALUE The present value adjustment is intended to back-out the interest component of the future-date contract expiry.
DIVIDEND The dividend adjustment is intended to include the impact of the dividend payment from the equities that make up the index.
BASIS The basis adjustment is intended to offset the difference in the basis between the futures price and the index price.
FAIR_VALUE The fair value adjustment is intended to be configured manually by the Trading team to adjust the price of the CFD for any reason which is not captured by the other adjustments, and will typically be the 0.

PriceAdjustment is an application/json object with the following Schema:

{
    # 
    # The type of price adjustment.
    # 
    type : (PriceAdjustmentType),

    # 
    # The adjustment amount applied, represented in price units.
    # 
    amount : (DecimalNumber)
}

Value Description
M1 One minute sampling.

RawMarketPrice is an application/json object with the following Schema:

{
    # 
    # The ID of the liquidity pool the RawMarketPrice is for.
    # 
    liquidityPoolID : (integer),

    # 
    # The name of the instrument the RawMarketPrice is for.
    # 
    instrumentName : (InstrumentName),

    # 
    # The name of the contract the RawMarketPrice is for.
    # 
    contractName : (string),

    # 
    # The date/time when the RawMarketPrice was created.
    # 
    timestamp : (DateTime),

    # 
    # The list of adjustments that were applied to the RawMarketPriceLevels of
    # bids and asks.
    # 
    adjustments : (Array[PriceAdjustment]),

    # 
    # The OrderBook depth of market. The list of bids and asks in an OrderBook
    # depth of market can be viewed as an independent bid/offer for the given
    # number of units at the specified price. To fill an order for a given
    # number of units the bids/asks are walked in order until the total desired
    # units are filled. The price at each level is used for the units obtained
    # from that level. Lists of bids in an OrderBook will always be in
    # decreasing price order, however there is no restriction on the liquidity
    # values for each level, they may increase, decrease or stay the same.
    # Lists of asks in an OrderBook representation will always be in increasing
    # price order, however there is no restriction on the liquidity values for
    # each level, they may increase, decrease or stay the same.
    # 
    orderBook : (RawMarketPriceDepthOfMarket),

    # 
    # The Ladder depth of market. The list of bid and ask price-liquidity pairs
    # in a Ladder depth of market can be viewed as a ‘rung’. To determine what
    # price to use for a given target liquidity, find the first rung that
    # matches the target liquidity and use its price. Lists of bids in a Ladder
    # will always be in decreasing price order and the corresponding liquidity
    # values will always be increasing. Lists of asks in a Ladder will always
    # be in increasing price order and the corresponding liquidity values will
    # always be increasing.
    # 
    ladder : (RawMarketPriceDepthOfMarket)
}