API Refresh

Please note the meaning of the terms used in this article:

  • Refresh intervals describes how often you send API calls to Betfair. The values are set using the API Refresh tab in the Settings Window.
  • Durations describes the actual roundtrip time for a call to travel through the internet to Betfair and back to you (i.e. the roundtrip duration)

They are not the same thing!

This article will help you learn how to ensure that prices and bets travel as fast as possible and are updated with high frequency.

At the end of this article you will set the API Refresh rates as fast as you can. However, and this is important, if you set them too fast you might cause your internet connection to struggle and then the calls will take longer to reach Betfair – resulting in the opposite of what you want.

If you are in the UK then the default refresh intervals will probably work well without any adjustment needed.

If you are not in the UK, then I suggest you start with very slow refresh intervals, as shown below.

In the Cymatic software, go to the File Menu | Settings | API Refresh tab:

API Refresh tab:
Primary Secondary
Prices 3000 3000

API Latency tab:
Pause trading if API call duration >= 3500
Timeout - Exchange Service 30000

The numbers shown above should work for everyone, even on very poor internet connections.

The goal at this stage is to choose very slow intervals so that you know you wont be overloading your internet connection. This will enable your API calls to have the fastest possible DURATIONS, because your connection will be stable and not overloaded. So, now that your connection is stable, observe the API durations displayed across the bottom of the main window (or in the API Monitor). You should now know how fast the durations (round-trip) can be for your connection.

The duration that is achieved varies considerably based on your connection and location, here are some typical values:

Betfair Customers - registered NOT in UK:
(Users report that calls may be diverted via Malta)
Connecting to Betfair from outside the UK 120 - 1000ms

Betfair Customers - registered in UK:
Connecting to Betfair from a UK home broadband: 50 - 200ms
Connecting to Betfair from a VPS in a UK data centre 15 - 25ms

Now gradually choose faster refresh intervals (smaller numbers on the API Refresh tab in the Settings Window) and keep doing it so long as you don’t see the roundtrips taking longer. Eventually you'll get a feel for what the limits are of your connection without causing bottlenecks.

Many users outside the UK find that these numbers work well:

API Refresh tab:
Primary Secondary
Prices 1000 1000

API Latency tab:
Pause trading if API call duration >= 3500
Timeout - Exchange Service 20000

You can also learn how to use the API Monitor to examine the speed of your API calls and whether they are suffering from congestion or are bottlenecking.