Use the KeyLineDescription from the listMarketBook response to identify and display the handicap that's currently being displayed via the Betfair website.
For example, you'd receive the following from the listMarketBook response, indicating that the currency key line is selectionId is 19484 and handicap :5.5 for this market:
Request
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params": {"marketIds":["1.139230347"]}, "id": 1}]
Response (showing key fields only)
..................
"keyLineDescription": {
"keyLine": [
{
"selectionId": 19484,
"handicap": 5.5
},
{
"selectionId": 19484,
"handicap": 5.5
}
]
Once you've identified the KeyLine you can make a request for that single selection using the listRunnerBook operation. This will restrict the response to return the prices available at the key line only, significantly reducing the size of the response.
Request (for single runner only)
[{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listRunnerBook", "params": {"marketId":"1.139230347","selectionId":"19484","handicap":"5.5","priceProjection":{"priceData":["EX_BEST_OFFERS"],"virtualise":"true"}}, "id": 1}]
Response (for single runner only)
[{"jsonrpc":"2.0","result":[{"marketId":"1.139230347","isMarketDataDelayed":false,"status":"OPEN","betDelay":0,"bspReconciled":false,"complete":true,"inplay":false,"numberOfWinners":0,"numberOfRunners":402,"numberOfActiveRunners":402,"lastMatchTime":"2018-01-24T12:52:56.942Z","totalMatched":12267.62,"totalAvailable":26527.81,"crossMatching":true,"runnersVoidable":false,"version":2022983656,"runners":[{"selectionId":19484,"handicap":5.5,"status":"ACTIVE","lastPriceTraded":1.96,"totalMatched":8780.24,"ex":{"availableToBack":[{"price":1.94,"size":146.21},{"price":1.92,"size":1330.56},{"price":1.88,"size":1201.74}],"availableToLay":[{"price":1.98,"size":2976.8},{"price":1.99,"size":129.43},{"price":2.0,"size":20.0}],"tradedVolume":[]}}],"keyLineDescription":{"keyLine":[{"selectionId":19484,"handicap":5.5},{"selectionId":56294,"handicap":-5.5}]}}],"id":1}]
Comments
0 comments
Article is closed for comments.