Betting Type Definitions

Type Definitions


MarketFilter

Field name

Type

Required

Description

textQuery

String


Restrict markets by any text associated with the Event name. You can include a wildcard (*) character as long as it is not the first character. Please note - the textQuery field doesn't evaluate market or selection names.

exchangeIds

Set<String>


DEPRECATED

eventTypeIds

Set<String>


Restrict markets by event type associated with the market. (i.e., Football, Hockey, etc)

eventIds

Set<String>


Restrict markets by the event id associated with the market.

competitionIds

Set<String>


Restrict markets by the competitions associated with the market.

marketIds

Set<String>


Restrict markets by the market id associated with the market.

venues

Set<String>


Restrict markets by the venue associated with the market. Currently, only Horse & Greyhound racing markets have venues.

bspOnly

boolean


Restrict to bsp markets only, if True or non-bsp markets if False. If not specified then returns both BSP and non-BSP markets

turnInPlayEnabled

boolean


Restrict to markets that will turn in play if True or will not turn in play if false. If not specified, returns both.

inPlayOnly

boolean


Restrict to markets that are currently in play if True or are not currently in play if false. If not specified, returns both.

marketBettingTypes

Set< MarketBettingType >


Restrict to markets that match the betting type of the market (i.e. Odds, Asian Handicap Singles, Asian Handicap Doubles or Line)

marketCountries

Set<String>


Restrict to markets that are in the specified country or countries.  Please note: the default value is 'GB' when the correct country code cannot be determined.

marketTypeCodes

Set<String>


Restrict to markets that match the type of the market (i.e., MATCH_ODDS, HALF_TIME_SCORE). You should use this instead of relying on the market name as the market type codes are the same in all locales. Please note: All market types are available via the listMarketTypes operations.

marketStartTime

TimeRange


Restrict to markets with a market start time before or after the specified date

withOrders

Set< OrderStatus >


Restrict to markets where I have one or more orders in these states.

raceTypes

Set<String>


Restrict to markets of a specific raceType. Valid values are - Harness, Flat, Hurdle, Chase, Bumper, NH Flat, Steeple (AUS/NZ races), and NO_VALUE (when no valid race type has been mapped).   

For AUS/NZ races, the following definitions apply:

  • Flat’ – Used for standard ANZ thoroughbred races

  • Harness’ – Self-explanatory – used for Aus/NZ harness racing events.

  • Steeple’ – Used for Aus/NZ steeple chase races.

  • Hurdle’ - Used for Aus/NZ hurdle races.




MarketCatalogue

Information about a market

Field name

Type

Required

Description

marketId

String

(tick)

The unique identifier for the market. MarketId's are prefixed with '1.'

marketName

String

(tick)

The name of the market

marketStartTime

Date


The time this market starts at, only returned when the MARKET_START_TIME enum is passed in the marketProjections

description

MarketDescription


Details about the market

totalMatched

Double


The total amount of money matched on the market.  Please note:  The returned value is cached.  For the live total matched value please use listMarketBook.

runners

List <RunnerCatalog>


The runners (selections) contained in the market

eventType

EventType


The Event Type the market is contained within

competition

Competition


The competition the market is contained within. Usually only applies to Football competitions

event

Event


The event the market is contained within



MarketBook

The dynamic data in a market

Field name

Type

Required

Description

marketId

String

(tick)

The unique identifier for the market. MarketId's are prefixed with '1.'

isMarketDataDelayed

boolean

(tick)

True if the data returned by listMarketBook will be delayed. The data may be delayed because you are not logged in with a funded account or you are using an Application Key that does not allow up to date data.

status

MarketStatus


The status of the market, for example OPEN, SUSPENDED, CLOSED (settled), etc.

betDelay

int


The number of seconds an order is held until it is submitted into the market. Orders are usually delayed when the market is in-play

bspReconciled

boolean


True if the market starting price has been reconciled

complete

boolean


If false, runners may be added to the market

inplay

boolean


True if the market is currently in play

numberOfWinners

int


The number of selections that could be settled as winners

numberOfRunners

int


The number of runners in the market

numberOfActiveRunners

int


The number of runners that are currently active. An active runner is a selection available for betting

lastMatchTime

Date


The most recent time an order was executed

totalMatched

double


The total amount matched

totalAvailable

double


The total amount of orders that remain unmatched

crossMatching

boolean


True if cross matching is enabled for this market.

runnersVoidable

boolean


True if runners in the market can be voided. Please note - this doesn't include horse racing markets under which bets are voided on non-runners with any applicable reduction factor applied/

version

long


The version of the market. The version increments whenever the market status changes, for example, turning in-play, or suspended when a goal is scored.

runners

List< Runner >


Information about the runners (selections) in the market.

keyLineDescription

KeyLineDescription


Description of a markets key line for valid market types



RunnerCatalog

Information about the Runners (selections) in a market

Field name

Type

Required

Description

selectionId

long

(tick)

The unique id for the selection. The same selectionId and runnerName pairs are used accross all Betfair markets which contain them. Please note: The selectionId can be mapped to the runner name using the output from listMarketCatalogue

runnerName

String

(tick)

The name of the runner.

handicap

double

(tick)

The handicap applies to market with the MarketBettingType ASIAN_HANDICAP_SINGLE_LINE & ASIAN_HANDICAP_DOUBLE_LINE only otherwise '0'

sortPriority

int

(tick)

The sort priority of this runner. Indicates the order in which the runners are displayed on the Betfair Exchange website.

metadata

Map<String,String>


Metadata associated with the runner.  For a description of this data for Horse Racing, please see Runner Metadata Description



Runner

The dynamic data about runners in a market

Field name

Type

Required

Description

selectionId

long

(tick)

The unique id of the runner (selection). Please note - the same selectionId and runnerName pairs are used accross all Betfair markets which contain them.

handicap

double

(tick)

The handicap.  Enter the specific handicap value (returned by RUNNER in listMaketBook) if the market is an Asian handicap market.

status

RunnerStatus

(tick)

The status of the selection (i.e., ACTIVE, REMOVED, WINNER, PLACED, LOSER, HIDDEN) Runner status information is available for 90 days following market settlement.

adjustmentFactor

double


The adjustment factor applied if the selection is removed

lastPriceTraded

double


The price of the most recent bet matched on this selection

totalMatched

double


The total amount matched on this runner

removalDate

Date


If date and time the runner was removed

sp

StartingPrices


The BSP related prices for this runner

ex

ExchangePrices


The Exchange prices available for this runner

orders

List< Order >


List of orders in the market

matches

List< Match >


List of matches (i.e, orders that have been fully or partially executed)

matchesByStrategy

Map<String,Matches>


List of matches for each strategy, ordered by matched data




StartingPrices

Information about the Betfair Starting Price. Only available in BSP markets

Field name

Type

Required

Description

nearPrice

double


What the starting price would be if the market was reconciled now taking into account the SP bets as well as unmatched exchange bets on the same selection in the exchange. This data is cached and update every 60 seconds. Please note: Type Double may contain numbers, INF, -INF, and NaN.

farPrice

double


What the starting price would be if the market was reconciled now taking into account only the currently place SP bets. The Far Price is not as complicated but not as accurate and only accounts for money on the exchange at SP. This data is cached and updated every 60 seconds. Please note: Type Double may contain numbers, INF, -INF, and NaN.

backStakeTaken

List<#PriceSize >


The total amount of back bets matched at the actual Betfair Starting Price. Pre-reconciliation, this field is zero for all prices except 1.01 (for Market on Close bets) and at the limit price for any Limit on Close bets.

layLiabilityTaken

List< PriceSize >


The lay amount matched at the actual Betfair Starting Price. Pre-reconciliation, this field is zero for all prices except 1000 (for Market on Close bets) and at the limit price for any Limit on Close bets.

actualSP

double


The final BSP price for this runner. Only available for a BSP market that has been reconciled. Please note: for REMOVED runners the actualSP will be returned as 'NaN. Value may be returned as 'Infinity' if no BSP can be calculated.



ExchangePrices


Field name

Type

Required

Description

availableToBack

List< PriceSize >



availableToLay

List< PriceSize >



tradedVolume

List< PriceSize >





Event

Event

Field name

Type

Required

Description

id

String


The unique id for the event

name

String


The name of the event

countryCode

String


The ISO-2 code for the event.  A list of ISO-2 codes is available via http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2  Please note: default value is 'GB' when the correct country code cannot be determined.

timezone

String


This is timezone in which the event is taking place.

venue

String


venue

openDate

Date


The scheduled start date and time of the event. This is Europe/London (GMT) by default















































Type

Required

Description

Type

Required

Description




PriceLadderDescription

Description of the price ladder type and any related data.

Field name

Type

Required

Description

Field name

Type

Required

Description

type

PriceLadderType

The type of price ladder.



KeyLineSelection

Description of a markets key line selection, comprising the selectionId and handicap of the team it is applied to.

Field name

Type

Required

Description

Field name

Type

Required

Description

selectionId

SelectionId

Selection ID of the runner in the key line handicap.

handicap

Handicap

Handicap value of the key line.



KeyLineDescription

A list of KeyLineSelection objects describing the key line for the market

Field name

Type

Required

Description

Field name

Type

Required

Description

keyLine

List<KeyLineSelection>

A list of KeyLineSelection objects