As the title suggests, I am currently (and consistently) getting awful response times from the betfair server. I was hesitant to submit this to the forum since I don't see anyone else with a similar problem (which suggests that I'm doing something daft), but I am completely stumped so I am hoping someone can help.
Below is an example of the json-rpc request I'm sending:
I've tried using my delayed app key, and my live app key; with and without gzip compression requested and connecting to this endpoint: https://api.betfair.com/exchange/betting/json-rpc/v1
I have sent hundreds of requests one after the other whilst timing the responses and I consistently get response times of ~5.30 seconds. I have tried on multiple machines, multiple operating systems, routers in my house and my python code is as trimmed down as can be (a function to log in and return a session code, which is then used to send further requests).
What's odd is that using the same machine, I get ~50ms response times from various other servers (which is a typical time to expect) and the ping and download speed of the internet at my house is great, so I can only narrow it down to communication with the betfair servers!!
The API is unusable at this speed, does anyone have any suggestion at all as to what it might be, I'm very much hoping that's it's something I can do on my end and not just the BF servers.
Thanks,
Pat
Below is an example of the json-rpc request I'm sending:
Code:
common_headers = {
"X-Application": application_key_live,
"X-Authentication": session_token,
"content-type": "application/json",
"Accept-Encoding": "gzip"
}
mrktBook_req = '\
{\
"jsonrpc": "2.0",\
"method": "SportsAPING/v1.0/listMarketBook",\
"params": {\
"marketIds": ["' + market_id + '"], \
"priceProjection":{\
"priceData": ["EX_BEST_OFFERS"]\
}\
},\
"id": 1\
}'
I have sent hundreds of requests one after the other whilst timing the responses and I consistently get response times of ~5.30 seconds. I have tried on multiple machines, multiple operating systems, routers in my house and my python code is as trimmed down as can be (a function to log in and return a session code, which is then used to send further requests).
What's odd is that using the same machine, I get ~50ms response times from various other servers (which is a typical time to expect) and the ping and download speed of the internet at my house is great, so I can only narrow it down to communication with the betfair servers!!
The API is unusable at this speed, does anyone have any suggestion at all as to what it might be, I'm very much hoping that's it's something I can do on my end and not just the BF servers.
Thanks,
Pat



Comment