bf_account
takes three arguments, your Betfair username, your password and your API key, if entered correctly then the function will return an environment with a few methods for retrieving data and performing actions on your Betfair account.
acc <- bf_account(usr = username,
pwd = password,
key = api_key,
jurisdiction = "default")
If using the account
method found in the betfair
environment, then only the password is required, which is checked against the previously entered password.
param | details |
---|---|
usr |
Betfair username |
pwd |
Betfair password |
key |
Betfair API key (see Betfair documentation on how to get an API key) |
jurisdiction |
Sign into different jurisdictions, the default logs into .com, enter ‘italy’ for the Italian exchange, ‘spain’ for the Spanish and ‘romania’ for the Romanian |
The function returns an environment (stored as acc
in the usage section) with a few methods for retrieving account data. To view the available methods you can print the environment.
acc
<betfaiR API>
Methods available:
$details()
$funds()
$statement(after = NULL, before = NULL, n = NULL, wallet = NULL, include = "ALL")
$transfer(from = "UK", to = "AUSTRALIAN", amount = 2)
method | details |
---|---|
details |
account details, such as first name, last name, etc |
funds |
account funds, available to bet balance, exposure, points balance, etc |
statement |
account statement, returns a list with transactions, can be filtered according to date, wallet, number of records, etc. |
transfer |
transfer funds from one wallet to another |
I won’t show examples of these functions as it could accidently involve me sharing some sensitive data, but they are simple enough. funds
and details
require no parameters to be entered, transfer
requires from
, to
and amount
to be entered (from and to are wallets, UK and AUSTRALIAN). statement
can be left blank also, but it’s probably best to see the help pages ?statement
, the response of statment
can be passed to plot
.