abettor is an R package for connecting to the online betting exchange Betfair, via their API-NG product, using JSON-RPC. The package can be used to retrieve market information, place bets, cancel bets and manage account information such as balance, statement and P&L.
The breadth of API calls covered is growing, although not yet complete. If your use case is not yet covered, raise an issue or write new functionality yourself. New contributors always welcome.
Install from GitLab
# install.packages("devtools") devtools::install_git("https://gitlab.com/phillc73/abettor.git") library("abettor")
Or install from GitHub if you prefer (identical mirror of GitLab)
# install.packages("devtools") devtools::install_github("phillc73/abettor") library("abettor")
Obtain a Betfair Developer Application Key
Betfair provided instructions to obtain an Application Key are available here, or follow the steps in the Place a Bet Tutorial linked below.
abettor package is an aid to developing Betfair applications in R. Developers will still need to apply for a Betfair Software Vendor Licence should they wish to develop commercial software using this package. Personal use of the
abettor package will only require a Betfair Application Key.
Only two additional R packages are required.
# Requires a minimum of version 1.95-4.3 require("RCurl") # Requires a minimum of version 0.9.12 require("jsonlite")
Place a Bet Tutorial
An initial tutorial describing how to place a bet with
abettor is available here.
?loginBF ?logoutBF ?listClearedOrders ?listCompetitions ?listCurrentOrders ?listEventTypes ?listEvents ?listCountries ?listMarketBook ?listMarketCatalogue ?listMarketTypes ?listMarketPandL ?listVenues ?placeOrders ?replaceOrders ?updateOrders ?cancelOrders ?checkBalance ?getAccountStatement ?keepAlive
Each function contains documented descriptions for their use and all supported arguments. Read them.
This package is under active development.
Current Version: 0.1.5
See current release notes for more details.
Problems? Something just doesn't work?
- More functions!
- More error handling
- Support in-play betting with live prices
- Develop a Shiny web app for demonstration purposes
- See if
data.tablemakes things quicker
- Betfair Online Betting Exchange
- Betfair Developer Program
- Betfair Exchange API Documentation
- Creator's Website
- Creator on Twitter
abettor package is provided with absolutely no warranty. All
abettor functions have been tested and should work, but they may not work as you think they do. Betting can be fun and profitable, but also risky. Be sensible and read the documentation.