In order to use the Betting API, you need to have an Application Key. The Application Key identifies your API client. Two App Keys are assigned to a single Betfair account, one live App Key and one delayed App Key.
You must pass the Application Key with every HTTP request. You do this by setting the HTTP header with the value of the key assigned by Betfair.
X-Application: APP_KEY_ASSIGNED
How to Create An Application Key
You can create an Application Key for your Betfair account using the Accounts API Visualiser and createDeveloperAppKeys operation
- Click on the Accounts API Visualiser link.
- Select the createDeveloperAppKeys operation from the list of Operations on the top left hand side of the visualiser.
- Enter a sessionToken in the 'Session Token (ssoid)' text box. You can find instructions on how to find your sessionToken via your browser here.
- Enter your Application Name in the 'Request' column.
- Press Execute at the bottom of the 'Request' column.
Two Application Keys will then be created and displayed in the Developer Apps column of the Visualiser, one of which will be a Delayed Application Key (see details below)
Please note: the X-Application header is not required when using the createDeveloperAppKeys or the getDeveloperAppKeys service.
Delayed Application Keys
The createDeveloperAppKeys service will assign two Application Keys (App Keys) to your Betfair account.
One 'live' App Key and one 'delayed' App Key. A delayed App Key is displayed as 'Version 1.0-DELAY' via createDeveloperAppKeys/getDeveloperAppKeys
- The delayed App Key returns delayed price data and does not allow betting transactions to be performed (placeOrders,replaceOrders,updateOrders, cancelOrders)
- The delayed App Key should be used for development and any functional testing that doesn't require the use of live data and betting functionality.
- The delayed App Key should also be used in simulation/practice applications where the facility to bet into live Betfair markets is not available.
- The delayed App Key does not return traded volume data 'EX_TRADED' via listMarketBook.