What is an Application Key?
In order to use the Betting & Accounts 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 for testing.
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
Commercial Usage
Please note: App Key generation is for personal betting purposes only. All data/API usage in any commercial context must be approved by Betfair. Please see the following licensing information for further details (https://developer.betfair.com/get-started/)
Unauthorised commercial usage will be identified & blocked.
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 & ensure the the Endpoint "UK" is selected.
- 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 (this must be unique) in the 'Request' column. The Application Name can be any name of your choice, but like your Betfair username, must be unique.
- 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 demo tool
Please note:
- The X-Application header is not required when using the createDeveloperAppKeys or the getDeveloperAppKeys service.
- The Application Name must be unique.
We are aware that when using some browser versions to create App Keys the Visualiser throws an UNEXPECTED_ERROR when requesting createDeveloperAppKeys. Using an alternative browser/s should resolve this problem. You should also ensure that your Application Name is unique as attempts to create a duplicate Application Name will return an UNEXPECTED_ERROR response.
Live & 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
Upon creation, the Live Application Key will be inactive.
- To apply for a Live Application key please click here and select Exchange API > For My Personal Betting and complete the application form at the bottom of the page. A one-off activation fee of £299 applies; this is debited directly from your Betfair account once access is approved
- The Delayed App Key operates on the live Betfair Exchange and not a testbed/sandbox environment.
The Delayed App Key should be use for development purposes and any functional testing and provides delayed Betfair price data (EX_BEST_OFFERS only). The delay is variable between 1-60 second snapshots.
- The Delayed App Key must 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 'totalMatched' or EX_ALL_OFFERS via listMarketBook.
- The Stream API is only available via the Live Application Key subject to approval.
* Historical Data is additionally made available for testing and analysis purposes. Please see the App Directory for further information on these services.
Personal Betting Access - Application Key Overview
Please see below table for a summary of the data/services available to Delayed & Live Application Keys.
Delayed Application Key | Live Application Key | |
---|---|---|
Use For | Development | Live betting applications |
Activation Fee | None | £299 |
Live Price Data | Delayed* | Yes |
Bet Placement (Live Exchange) | Yes | Yes |
Stream API | Not Available | Yes (on application) |
Price Levels | 3 | All |
Total Matched by Selection | Not Available | Yes |
Total Matched by Market | Yes | No |
*Delay is variable between 1-60 seconds |