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("remotes")
library("remotes")
remotes::install_gitlab("phillc73/abettor")
library("abettor")
Or install from GitHub if you prefer (identical mirror of GitLab)
# install.packages("remotes")
library("remotes")
remotes::install_github("phillc73/abettor")
library("abettor")
Betfair provided instructions to obtain an Application Key are available here, or follow the steps in the Place a Bet Tutorial linked below.
The 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.7.2
library("jsonlite")
# Requires a minimum of version 1.4.2
library("httr")
-
An initial tutorial describing how to place a bet with
abettor
is available here. -
Betfair API tutorials in R - an excellent series of tutorials using
abettor
from the data science team at Betfair Australia. Their Awesome Betfair page is also worth reading.
?loginBF
?logoutBF
?keepAlive
?cancelOrders
?listClearedOrders
?listCompetitions
?listCountries
?listCurrentOrders
?listEvents
?listEventTypes
?listMarketBook
?listMarketCatalogue
?listMarketPandL
?listMarketTypes
?listRunnerBook
?listTimeRanges
?listVenues
?placeOrders
?updateOrders
?replaceOrders
?checkBalance
?getDeveloperAppKeys
?getAccountDetails
?getAccountStatement
?listCurrencyRates
?listRaceDetails
?heartbeat
?GetMyData
Each function contains documented descriptions for their use and all supported arguments. Read them.
This package is under active development.
Problems? Something just doesn't work?
- More functions!
- More error handling
- Support in-play betting with live prices
The 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.