This is a project which uses Scala, Spray and the Play JSON lib to make calls to Betfair's New Generation API ie JSON-RPC
To use the service, you'll need a Betfair username and password, and an AppKey. The config file also contains the betfair urls. These need to be placed in a file called betfair-service-ng.conf which is referenced by the application.conf file. Example configuration is below:
betfairService.appKey = "appkey"
betfairService.username = "username"
betfairService.password = "password"
betfairService.apiUrl = "https://api.betfair.com/exchange/betting/json-rpc/v1"
betfairService.isoUrl = "https://identitysso.betfair.com/api"
Before any of the Betting API calls can be made a session token needs to be obtained and this can be done via the loginRequest method. This will cache the session token for future calls.
The ExampleBetfairServiceNG file contains the below sample calls:
login
list event types
list competitions
list football competitions
list all horse racing markets in the next 24 hour period
get the next UK Win horse racing market
list a market book with exchange best offers
get a market book exchange favourite
place a bet
cancel a bet
BSD Licence - see LICENCE.txt
- Add the remaining betting api calls
- Add more convenience methods to the service API eg get all runners between two prices
- Add a Spray REST API to the whole service
- Repackage the domain classes
- Push the local tests to master
- Make this README more complete!