Hello,
I would like to get the odds exactly as they are on the Betfair website, I did it as in the example shown in the pdf but it didn't work.
Could anyone show what is wrong or how to solve this problem ?
The code is:
import requests
import json
url="https://api.betfair.com/exchange/betting/json-rpc/v1"
header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN_HERE' ,'content-type' : 'application/json' }
req = '{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params":{"marketIds":["1.220230988"],"priceProjection":{"priceData":["EX_ALL_OFFERS"],"virtualise":"True"}}, "id": 1}'
response = requests.post(url, data=req, headers=header)
print(json.dumps(json.loads(response.text), indent=3))
The result is:
...
"availableToLay": [
{
"price": 2.1,
"size": 497.62
},
{
"price": 2.12,
"size": 4776.93
},
{
"price": 2.14,
"size": 517.96
}
],
Thanks
I would like to get the odds exactly as they are on the Betfair website, I did it as in the example shown in the pdf but it didn't work.
Could anyone show what is wrong or how to solve this problem ?
The code is:
import requests
import json
url="https://api.betfair.com/exchange/betting/json-rpc/v1"
header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN_HERE' ,'content-type' : 'application/json' }
req = '{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketBook", "params":{"marketIds":["1.220230988"],"priceProjection":{"priceData":["EX_ALL_OFFERS"],"virtualise":"True"}}, "id": 1}'
response = requests.post(url, data=req, headers=header)
print(json.dumps(json.loads(response.text), indent=3))
The result is:
...
"availableToLay": [
{
"price": 2.1,
"size": 497.62
},
{
"price": 2.12,
"size": 4776.93
},
{
"price": 2.14,
"size": 517.96
}
],
Thanks


Comment