这是我的代码,它似乎没有得到我想要的东西。它只是呈现匹配赔率的匹配数,而我想要赔率和价格数据
header = {'X-Application' : 'APP_KEY_HERE', 'X-Authentication':'SESSION_TOKEN' ,'content-type' : 'application/json' }
url="https://api.betfair.com/exchange/betting/json-rpc/v1"header = { 'X-Application' : 'APP_KEY_HERE', 'X-Authentication' : 'SESSION_TOKEN' ,'content-type' : 'application/json' }
jsonrpc_req='{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listMarketTypes", "params": {"filter": {"textQuery":"Tennis"}}, "id": 1}'
response = requests.post(url, data=jsonrpc_req, headers=header)
print(json.loads(response.text))
答案 0 :(得分:0)
您正在使用listMarketTypes端点。对于价格,您需要调用listMarketBook以及PriceProjection,OrderProjection和MatchProjection:
https://docs.developer.betfair.com/display/1smk3cen4v3lu3yomq5qye0ni/listMarketBook