how and if possible what is the code to retrieve in a live odds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stephanmorel
    Junior Member
    • Apr 2023
    • 3

    #1

    how and if possible what is the code to retrieve in a live odds

    want to know in a live horse race if its possible to get live horse odds from the horses with little to no delay in program run time also is my code capable of doing this if request it multple times I'm enquiring about help with the api for horseracing based on the free api key, essentially not only is it 3 seconds before I get any kind of odds or python output which is a detriment if I want to do betting with live races but also it only allows me to get one horses odds at a time regardless if I use a for loop and try and chain requests. Is this a code issue or betfair issue?
    payload = 'username=' + my_username + '&password=' + my_password
    headers = {'X-Application': my_app_key, 'Content-Type': 'application/x-www-form-urlencoded'}
    resp = requests.post('https://identitysso-cert.betfair.com/api/certlogin',data=payload,cert=('c:/Users/steph/OneDrive/Documents/2023/WORK/BETTING/client-2048.crt','c:/Users/steph/OneDrive/Documents/2023/WORK/BETTING/client-2048.pem.'),headers=headers)
    json_resp=resp.json()
    print(json_resp['loginStatus'])
    SSOID = json_resp['sessionToken']
    bet_url="https://api.betfair.com/exchange/betting/json-rpc/v1"
    event_req = '{"jsonrpc": "2.0", "method": "SportsAPING/v1.0/listEventTypes", "params": {"filter":{ "eventTypeIds":["7"],"marketCountries":["GB","AU"]}}, "id": 1}'
    headers = {'X-Application': my_app_key, 'X-Authentication': SSOID, 'content-type': 'application/json'}
    req = requests.post(bet_url, data=event_req.encode('utf-8'), headers=headers)​
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    The free key is more accurately described as a test key or development key. It has restrictions built in. Here is a link showing the difference between the keys.

    https://docs.developer.betfair.com/d...ationKeysUsage
    Last edited by jabe; 01-04-2023, 05:11 PM.

    Comment

    Working...
    X