Bet Angel
×
Full Guide

Type definitions

 

AddMarketsInstruction

Field name
Type
Required
Description
marketIds
List < string >
ü
The betfair Ids of the markets that you wish to add
 
 

AddMarketsResponse

Field name
Type
Description
status
Indicates if the operation was successful
errors
List of any errors that occurred during processing
 
 

ApplyCouponInstruction

Field name
Type
Required
Description
couponName
string
ü
The name of the coupon (from the list of Coupon filters on the Coupon tab of Guardian) that you wish to use to load markets into Guardian and the Watch List.
clearOption
ü
The choice of what should be cleared before adding the new markets
watchListNumber
int
ü
The watch list that will contain the coupon. Value must be in the range [1 to 5]
 
 

ApplyCouponResponse

Field name
Type
Description
status
Indicates if the operation was successful
marketIdsAdded
List< string >
The market Ids that were added by using the coupon
errors
List of any errors that occurred during processing
 
 

ApplyRulesInstruction

Field name
Type
Required
Description
rulesFileName
string
ü
The name of an Automation Rules File (from the list of available Rules Files in Guardian) that you wish to apply to the markets.
marketsFilter
ü
The choice of which markets will be assigned with the rules file.
guardianRulesColumn
int
ü
The number of the Automation Rules column that will be assigned the rules file. Value must be in the range [1 to 5]
 
 

ApplyRulesResponse

Field name
Type
Description
status
Indicates if the operation was successful
errors
List of any errors that occurred during processing
 
 

BetAngelAPIError

Field name
Type
Description
code
The error code
betfairErrorCode
string
Used by the betting component to relay any error code returned from the betfair API
msg
string
The error message
 
 

BetSummaryInfo

Field name
Type
Description
avgPrc
double
The average price of the bets in the summary
totStk
double
The total stake of all the bets in the summary
count
int
The number of bets
 
 

CancelBetsInstruction

Field name
Type
Required
Description
marketId
string
ü
The market in which you wish to cancel bets
filterOption
 
Indicates whether all or just some of the bets need to be cancelled. (default = ALL bets in the market)
betRefs
List< string >
 
When filterOption is SPECIFIED_BET_REFS, this field lists the bet references that you wish to cancel
selectionIds
List< string >
 
When filterOption is SPECIFIED_SELECTION_IDS, this field lists the selection Ids whose bets you wish to cancel
type
 
A secondary filter to allow the cancellation to be limited to just back or lay bets.  (default = ALL so that cancellation applies to both back and lay bets )
async
bool
 
Set this to true if you wish to cancel the bets asynchronously so that this call returns without delay
 
 

CancelBetsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
contains the result of the cancel bets instruction
pendingResultId
string
If the instruction requested that the bets were cancelled asynchronously, this provides the Id that can be used to lookup the results at a later time.
 
 

CancelBetsResult

Field name
Type
Description
bets
List of results following bet cancellation (one item per bet)
 
 

CancelBetResultInfo

Field name
Type
Description
status
Indicates if the bet has been cancelled
betRef
string
The reference of the bet being cancelled
stakeCancelled
double
If the status is OK, this field contains the amount of the bet that was cancelled.
error
Set if an error occurred during processing of the bet cancellation
 
 

ClearStoredValuesInstruction

Field name
Type
Description
marketsFilter
Allows the stored values search to be limited to specific markets
selectionsFilter
Allows the stored values search to be limited to specific selections
instanceFilter
Allows the stored values search to be limited to specific Automation Instances
storedValueFilterBetAngelLevel
Provides the search with criteria about which Stored Values at the Bet Angel level need to be cleared.  Note: if the field is null, no stored Values at this level will be cleared.
storedValueFilterEventLevel
Provides the search with criteria about which Stored Values at the Event level need to be cleared.  Note: if the field is null, no stored Values at this level will be cleared.
storedValueFilterMarketLevel
Provides the search with criteria about which Stored Values at the Market level need to be cleared.  Note: if the field is null, no stored Values at this level will be cleared.
storedValueFilterSelectionLevel
Provides the search with criteria about which Stored Values at the Selection level need to be cleared.  Note: if the field is null, no stored Values at this level will be cleared.
writeToMarketLog
bool
If true, makes a note in the log of the market containing the Stored Value that the Stored Value has been cleared. Note: if the field is null, a false value is assumed
 
 

ClearStoredValuesResponse

Field name
Type
Description
status
Indicates if the operation was successful
errors
List of any errors that occurred during processing
 
 

CloseTradeInstruction

Field name
Type
Required
Description
marketId
string
ü
The market in which you wish to close a trade
selectionId
string
ü
The selection on which you wish to close a trade
withGreening
bool
ü
Indicates whether to close the trade with greening or not
priceOption
 
Indicates whether you wish to green all using the best market prices or the reverse market prices. ( default = BEST_MARKET_PRICE )
swapAboveAndBelowWhenLaying
bool
 
Indicates whether to swap the Above & Below price options when the closing bet is a lay ( default = false ).
i.e. When set to true, you can be sure that any of the '_ABOVE_' price options will be offering the bet to the market rather than taking a current price regardless of whether the closing trade bet is a back or a lay.
fixedPrice
double
 
If the priceOption is set to FIXED_PRICE, use this field to specify the price to use when closing the trade.
ticks
int
 
If the priceOption is one of the TICKS_ options, use this field to specify the number of ticks to adjust the price by when closing trade.
percent
double
 
If the priceOption is one of the PERC_ options, use this field to specify the percentage to adjust the price by when closing trade.
async
bool
 
Set this to true if you wish to close a trade asynchronously so that this call returns without delay
 
 

CloseTradeResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
contains the result of the close trade instruction
pendingResultId
string
If the instruction requested that the trade was closed asynchronously, this provides the Id that can be used to lookup the results at a later time.
 
 

CloseTradeResult

Field name
Type
Description
betsCancelled
Depending on Bet Angel Settings, calling CloseTrade will cancel the selection's unmatched bets in the market. This field lists the results of each of the bets that required cancellation (one item per bet)
betPlaced
The bet that was placed to close the trade
 
 

ContainerFilter

Field name
Type
Required
Description
filter
ü
The choice of how the container should be filtered
ids
List< string >
 
Provides the filter with the list of Ids required, if applicable.
 
 

GetInstancesInstruction

Field name
Type
Required
Description
includeStoppedInstances
bool
 
When true, the search will include Automation Instances that are in a Stopped state. If this field is null then a false value is used, so Stopped instances are excluded.
fromId
long
 
If specified, the search will start from this Id onwards. If the field is null then the search will start from 1.
toId
long
 
If specified, the search will not go beyond this Id. If the field is null then the search will go to the last Instance created.
restrictToTypes
 
If specified, the search will only include Automation Instances that match one of the types provided. If the field is null, all types will be included.
marketsFilter
 
Allows the Automation Instance search to be limited to only the ones associated with the specified markets. If the field is null, all markets will be searched.
 
 

GetInstancesResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the requested data
errors
List of any errors that occurred during processing
 
 

GetInstancesResult

Field name
Type
Description
instances
List of Automation Instance information objects. One per instance that satisfies the search criteria.
 
 

GetMarketBetsInstruction

Field name
Type
Required
Description
marketId
string
ü
The id of the market held in Bet Angel that you wish to query for bet information
filter
 
Allows the bet retrieval to be limited to specific bet references or to just matched bets or just unmatched bets (default = ALL bets in the market)
 
 

GetMarketBetsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the requested data
errors
List of any errors that occurred during processing
 
 

GetMarketBetsResult

Field name
Type
Description
matchedBets
List of market bet information objects. The contents will be populated from the matched bets in the Bet Angel market based on any filter specified in the instruction.
unmatchedBets
List of market bet information objects. The contents will be populated from the unmatched bets in the Bet Angel market based on any filter specified in the instruction.
 
 

GetMarketPricesInstruction

Field name
Type
Required
Description
marketsFilter
 
Allows the price retrieval to be limited to specific markets (default = ALL markets)
dataRequired
 
The data items you wish to retrieve
 
 

GetMarketPricesResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the requested data
errors
List of any errors that occurred during processing
 
 

GetMarketPricesResult

Field name
Type
Description
markets
List of market price information objects (the contents will depend on the dataRequired provided in the instruction)
 
 

GetMarketsInstruction

Field name
Type
Required
Description
dataRequired
ü
The data items you wish to retrieve
 
 

GetMarketsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the requested data
errors
List of any errors that occurred during processing
 
 

GetMarketsResult

Field name
Type
Description
markets
List< MarketInfo >
List of market information objects. One per market loaded into Bet Angel
 
 

GetPendingResultInstruction

Field name
Type
Required
Description
marketId
string
ü
The id of the market held in Bet Angel that you wish to query for the pending result.
pendingResultId
string
ü
The Id of the pending result that you wish to retrieve.
 
 

GetStoredValuesInstruction

Field name
Type
Description
marketsFilter
Allows the stored values search to be limited to specific markets
selectionsFilter
Allows the stored values search to be limited to specific selections
instanceFilter
Allows the stored values search to be limited to specific Automation Instances
storedValueFilterBetAngelLevel
Provides the search with criteria about which Stored Values at the Bet Angel level are required.  Note: if the field is null, no stored Values at this level will be returned.
storedValueFilterEventLevel
Provides the search with criteria about which Stored Values at the Event level are required.  Note: if the field is null, no stored Values at this level will be returned.
storedValueFilterMarketLevel
Provides the search with criteria about which Stored Values at the Market level are required.  Note: if the field is null, no stored Values at this level will be returned.
storedValueFilterSelectionLevel
Provides the search with criteria about which Stored Values at the Selection level are required.  Note: if the field is null, no stored Values at this level will be returned.
 
 

GetStoredValuesResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the requested data
errors
List of any errors that occurred during processing
 
 

GetStoredValuesResult

Field name
Type
Description
betAngel
Contains the stored values at the Bet Angel level that met the search criteria.
events
List of containers of stored values at the event level that met the search criteria. One container per event that has information to return.
markets
List of containers of stored values (at the market and/or selection level) that met the search criteria. One container per market that has information to return.
 
 

GreenAllSelectionsInstruction

Field name
Type
Required
Description
marketId
string
ü
The market in which you wish to green all selections.
priceOption
 
Indicates whether you wish to green all using the best market prices or the reverse market prices. ( default = BEST_MARKET_PRICE )
async
bool
 
Set this to true if you wish to green all selections asynchronously so that this call returns without delay
 
 

GreenAllSelectionsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
contains the result of the green all selections instruction
pendingResultId
string
If the instruction requested that the green all selections process was executed asynchronously, this provides the Id that can be used to lookup the results at a later time.
 
 

GreenAllSelectionsResult

Field name
Type
Description
betsCancelled
Depending on Bet Angel Settings, calling GreenAllSelections will cancel current unmatched bets in the market. This field lists the results of each of the bets that required cancellation (one item per bet)
betsPlaced
List of results of each of the bets that were placed to green all selections (one item per bet)
 
 

InstanceContainer

Field name
Type
Description
id
long
The id of the Automation Instance. Note: Each new instance (i.e. Guardian Automation Rules assigned to a market, or Servant started) is given a new id. Ids start at 1 and increment with each new instance.
status
Indicates whether the instance is awaiting the first trigger, has started, or has stopped.
rulesFileName
string
The name of the rules being processed by this instance.
timeCreated
DateTime
The date and time this Automation Instance was created.
timeFirstTriggered
DateTime
The date and time this Automation Instance first triggered a rule. The field will be null if no rules have triggered.
marketId
string
The Id of the Market that is using the Automation Rules
marketName
string
The name of the Market that is using the Automation Rules
instanceType
Indicates whether the instance is being processed by Guardian or is running as a Servant or as the market's Safety Servant.
guardianRulesColumn
int
The Automation Rules column in Guardian that is associated with the Instance or null if running as a Servant.
 
 

InstanceFilter

Field name
Type
Required
Description
includeStoppedInstances
bool
 
When searching for Automation Instances, set this to true if instances that have already stopped should be included in the search.
filter
ü
The choice of how the Automation Instances should be filtered
instanceIds
List< long >
 
Provides the filter with the list of Automation Instance Ids required, if applicable.
 
 

MarketBetInfo

Field name
Type
Description
selectionId
string
Selection Id
betRef
string
The unique reference of the bet
type
Indicates whether the bet is a Back or a Lay
price
double
The price of the bet
stake
double
The size of the bet
fullyMatched
bool
Indicates whether a matched bet is fully matched or only partially matched.
atInplay
Indicates how the bet should be treated by betfair when the market turns in-play. (CANCEL / KEEP / TAKE_SP)
bspBetType
If the bet is a BSP bet, this field indicates whether a price limit has been applied
bspPriceLimit
double
The BSP price limit, if applicable. This will be the minimum price for a BSP Back bet and the maximum price for a BSP Lay bet.
bspLiability
double
The liability of a BSP bet
linkedBetRef
string
Used by Offset and Stop bets to refer back to the initial bet they are linked with.
linkReason
When populated, indicates whether this bet was placed as an Offset or a Stop bet
 
 

MarketBetsFilter

Field name
Type
Required
Description
option
ü
The choice of how the bets should be filtered
betRefs
List< string >
 
Provides the filter with the list of betRefs required, use when the option has been set to SPECIFIED_BET_REFS
 
 

MarketIdNamePair

Field name
Type
Description
id
string
Market Id
name
string
Market Name
 
 

MarketInfo

Field name
Type
Description
id
string
Market Id
name
string
Market Name
marketType
string
Market Type (matches betfair types)
eventId
string
Event Id (with time suffix for horse racing)
eventTypeId
string
Event Type Id
startTime
DateTime
Market Start Time
inPlay
bool
set true when the market is in-play
selections
List of selection information objects (if either Selection Id or Selection Name was requested). One per selection in the market.
 
 

MarketPriceInfo

Field name
Type
Description
id
string
Market Id
status
Indicates if the market is OPEN, SUSPENDED or CLOSED
lastUpdated
DateTime
The time the market was last updated in Bet Angel
inPlay
bool
Set true when the market is in-play
inPlayTime
double
The number of seconds since the market turned in-play in Bet Angel
volume
double
The market's total matched volume
greenAllProfit
double
The market's Green All Profit value
selections
List of selection price information objects, one per selection in the market. Note: The contents of the objects will depend on the dataRequired provided in the instruction.
 
 

ModifyBetInfo

Field name
Type
Required
Description
betRef
string
ü
The reference of the bet to be modified
newPrice
double
 
If you wish to modify the price of the bet, set this field to the new price
newStake
double
 
If you wish to modify the stake of the bet, set this field to the new stake
newAtInplayOption
 
If you wish to modify what happens to the bet when the market turns in-play, set this field to the new option
 
 

ModifyBetsInstruction

Field name
Type
Required
Description
marketId
string
ü
The market in which you wish to modify bets
betsToModify
ü
The details of the bets that you wish to modify
async
bool
 
Set this to true if you wish to modify the bets asynchronously so that this call returns without delay
 
 

ModifyBetsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
contains the result of the modify bets instruction
pendingResultId
string
If the instruction requested that the bets were modified asynchronously, this provides the Id that can be used to lookup the results at a later time.
 
 

ModifyBetsResult

Field name
Type
Description
bets
List of results following bet modification (one item per bet)
 
 

ModifyBetResultInfo

Field name
Type
Description
betToModify
The details of the bet modification request that was sent in the instruction
status
Indicates if the bet has been modified
newBetRef
string
If the modification caused the price of the bet to change it will be given a new bet reference and that will be returned in this field.
priceMatched
double
If the modification caused the price of the bet to change and any of that bet was matched during modification, this field will be set with the average price of the amount matched.
stakeMatched
double
If the modification caused the price of the bet to change, this field with be set with the amount of the bet that was matched during that price change.
stakeCancelled
double
If the modification caused the stake of the bet to be reduced, this field will be set with the amount of that bet that was cancelled.
additionalBetRef
string
If a stake increase was requested as part of the modification, a new bet would have been created by betfair for the additional stake. This field will be set with the bet reference of that additional bet.
additionalPriceMatched
double
If the modification caused an additional bet to be placed and any of that bet was matched during placement, this field will be set with the average price of the amount of that bet matched.
additionalStakeMatched
double
If the modification caused an additional bet to be placed, this field will be set with the amount of that bet matched.
error
Set if an error occurred during processing of the bet modification
 
 

PlaceBetGlobalSettings

Field name
Type
Description
action
Choice of whether the opening bets need an offset and/or stop attached. (Default = NONE)
offsetTicks
int
When the action has been set to request an offset bet, set this value if you wish to offset by a number of ticks.
offsetPercent
double
When the action has been set to request an offset bet, set this value if you wish to offset by a percentage (e.g. set to 50 for a 50% offset)
offsetBatches
int
The number of offset batches required (Default = 1)
stopTriggerTicks
int
When the action has been set to request a stop, set this value if you wish to trigger the stop a number of ticks away from the opening bet.
stopTriggerPercent
double
When the action has been set to request a stop, set this value if you wish to trigger the stop a percentage away from the opening bet.
stopPlacementTicks
int
When the action has been set to request a stop, set this value if you wish to place the stop a number of ticks away from the opening bet.
stopPlacementPercent
double
When the action has been set to request a stop, set this value if you wish to place the stop a percentage away from the opening bet.
useFillOrKill
bool
Set to true to place fill or kill bets
killDelay
double
The Fill or Kill Delay to be used (in seconds)
 
 

PlaceBetInfo

Field name
Type
Required
Description
selectionId
string
ü
Selection Id
type
ü
Back or Lay bet
price
double
 
The price of the bet
stake
double
ü
The stake to be used
bspBetType
 
Set this to indicate that you wish to place the bet at BSP. If a price limit is required, the price field will be used.
 
 

PlaceBetsInstruction

Field name
Type
Required
Description
marketId
string
ü
The market into which you wish to place bets
betsToPlace
ü
The details of the bets that you wish to place
globalSettings
 
The details of any global settings that you wish to apply to the bets being placed
async
bool
 
Set this to true if you wish to place the bets asynchronously so that this call returns without delay
 
 

PlaceBetsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
contains the result of the place bets instruction
pendingResultId
string
If the instruction requested that the bets were placed asynchronously, this provides the Id that can be used to lookup the results at a later time.
 
 

PlaceBetsResult

Field name
Type
Description
bets
List of results following bet placement (one item per bet)
 
 

PlaceBetResultInfo

Field name
Type
Description
betToPlace
The details of the bet placement request that was sent in the instruction
status
Indicates if the bet has been placed
betRef
string
The reference of the bet (only set if successfully placed)
priceMatched
double
If any of the bet was matched during placement, this field will be set with the average price that was matched.
stakeMatched
double
The amount of the bet that was matched during placement.
error
Set if an error occurred during processing of the bet placement
 
 

PriceSizeInfo

Field name
Type
Description
prc
double
A market price
sz
double
The amount of money available at the price
 
 

RemoveMarketsInstruction

Field name
Type
Required
Description
marketsFilter
ü
The markets that you wish to remove
marketStatus
 
The market status must match this to be removed
 
 

RemoveMarketsResponse

Field name
Type
Description
status
Indicates if the operation was successful
result
Contains the markets that were removed
errors
List of any errors that occurred during processing
 
 

RemoveMarketsResult

Field name
Type
Description
marketsRemoved
List of the markets that were removed
 
 

RemoveRulesInstruction

Field name
Type
Required
Description
marketsFilter
ü
The choice of which markets will have their rules removed.
guardianRulesColumn
int
ü
The number of the Automation Rules column that will have its rules file removed. Value must be in the range [1 to 5]
 
 

RemoveRulesResponse

Field name
Type
Description
status
Indicates if the operation was successful
errors
List of any errors that occurred during processing
 
 

SelectionInfo

Field name
Type
Description
id
string
Selection Id
name
string
Selection Name
 
 

SelectionPriceInfo

Field name
Type
Description
id
string
Selection Id
back3
The third best back price being offered on the selection (and the amount of money available at that price)
back2
The second best back price being offered on the selection (and the amount of money available at that price)
back1
The best back price being offered on the selection (and the amount of money available at that price)
lay1
The best lay price being offered on the selection (and the amount of money available at that price)
lay2
The second best lay price being offered on the selection (and the amount of money available at that price)
lay3
The third best lay price being offered on the selection (and the amount of money available at that price)
ltp
double
Last Traded Price
projSP
double
Projected SP
actSP
double
Actual SP
vol
double
Volume
profIfWins
double
Profit if the selection wins
profIfLoses
double
Profit if the selection loses (only applicable to multi-winner markets such as Place markets)
closeProf
double
Close Trade Profit at best market price
closeProfGreen
double
Close Trade Profit With Greening at best market price
umbBack
A summary of the unmatched back bets on this selection
umbLay
A summary of the unmatched lay bets on this selection
mbBack
A summary of the matched back bets on this selection
mbLay
A summary of the matched lay bets on this selection
 
 

SetStoredValuesInstruction

Field name
Type
Description
betAngel
Holds the Stored Values that you wish to set at the Bet Angel level (all values at this level are Shared).  Note: if the field is null, no stored Values at this level will be set
events
Holds the Stored Values that you wish to set at the Event level (all values at this level are Shared).  The list should contain one StoredValuesContainer per Event that you wish to update. Note: if the field is null, no stored Values at this level will be set
markets
Holds the Stored Values that you wish to set at the Market and/or Selection level (either Shared or local to specific Automation Instances).  The list should contain one StoredValuesMarketContainer per Market that you wish to update. Note: if the field is null, no stored Values at this level will be set
writeToMarketLog
bool
If true, makes a note in the log of the market containing the Stored Value that the Stored Value has been set. Note: if the field is null, a false value is assumed
 
 

SetStoredValuesResponse

Field name
Type
Description
status
Indicates if the operation was successful
errors
List of any errors that occurred during processing
 
 

StoredValue

Field name
Type
Required
Description
n
string
ü
The name of the Stored Value
v
double
 
Populated with the value of the Stored Value if it is a Numeric type
t
string
 
Populated with the value of the Stored Value if it is a Text type
 
 

StoredValuesContainer

Field name
Type
Required
Description
id
string
ü
The Event Id or 'BetAngel' if used at Bet Angel level of containment
name
string
 
The Event Name or 'Bet Angel' if used at Bet Angel level of containment
sharedValues
ü
List of stored values that are shared at this level of containment
 
 

StoredValuesFilter

Field name
Type
Required
Description
excludeSharedValues
bool
 
When searching for Stored Values, set this to true you wish to exclude Shared values
excludeInstanceValues
bool
 
When searching for Stored Values, set this to true you wish to exclude values that are not marked as Shared and are therefore local to a specific Automation Instance
storedValueFilter
ü
The choice of how the stored values should be filtered
names
List< string >
 
Provides the filter with the list of Stored Value Names required, if applicable.
 
 

StoredValuesInstanceContainer

Field name
Type
Required
Description
instanceId
long
ü
The Id of the Automation Instance holding the Stored Values
values
 
List of stored values that are local to this instance
 
 

StoredValuesMarketContainer

Field name
Type
Required
Description
id
string
ü
The Market Id
name
string
 
The Market Name
sharedValues
 
List of stored values that are shared in this market
instances
 
List of stored values that are local to specific Automation Instances, grouped by Instance
selections
 
List of selections in the market that contain stored values
 
 

StoredValuesSelectionContainer

Field name
Type
Required
Description
id
string
ü
The Selection Id
name
string
 
The Selection Name
sharedValues
 
List of stored values that are shared in this selection
instances
 
List of stored values that are local to specific Automation Instances, grouped by Instance