durtal / betfair Goto Github PK
View Code? Open in Web Editor NEWR package for the Betfair API
Home Page: http://durtal.github.io/betfaiR/
License: Other
R package for the Betfair API
Home Page: http://durtal.github.io/betfaiR/
License: Other
Betfair price charts are available using the marketId and selectionId, is it possible to retrieve these plot them, save them, etc?
example url:
https://sportsiteexweb.betfair.com/betting/LoadRunnerInfoChartAction.do?marketId=123456789&selectionId=123456
NB. the marketId doesn't include the domain prefix for each exchange.
the marketPnL
method might need a little work, fails to parse response if the market has close.
a collection of small helper functions are required to help users place bets, cancel bets, filter markets, think about how best to organise these, naming conventions, etc.
create a single function which could be used to help periodically collect betfair market data, similar to the process found in vignette two
hi!
can you make changes to let users access other betfair exchanges (.it, .es, .ro), alongside the global one (.com)?
I've looked through the code, but I'm not really an advanced R user to do it myself without errors.
I did add a jur
argument to bf_login
function, that changes the endpoint string (this is the only difference between jurisdictions), with "com"
as default value, then making necessary changes to bf_account
and betfair
.
this let me login no problem, but can't use the other methods. lol.
At the moment the only way to use the methods is to use them via the betfair
function, allow use outside of environment.
Should the environment keep track of queries/requests made?
Hi,
I have been trying to use the size parameter in the cancel_inst function when using the cancelOrders method but can't get it to cancel part of the bet. Instead it cancels the entire bet.
Please see example below:
cancel <- bf$cancelOrders(
cancel_inst(size = 35,
betId = 158757475816),
marketId = "1.156666122"
)
summary(cancel)
Status: SUCCESS
Orders:
status betId sizeCancelled cancelledDate
SUCCESS 158757475816 65 2019-03-27T15:57:39.000Z
When filtering markets with the marketFilter
function, some of the parameters can be tricky to remember. For example, the withOrders
parameter needs to be either EXECUTABLE or EXECUTION_COMPLETE, could these be simplified, to TRUE/FALSE values.
Other functions/methods have parameters which call for specific (and hard to remember) values, such as priceProjection, etc.
Nice work building this package, it looks really interesting and I'm keen to take a look.
I'm having trouble installing the package. after running
devtools::install_github("durtal/betfaiR")
`* installing source package 'betfaiR' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error in namespaceExport(ns, exports) : undefined exports: collect_data
Error: loading failed
Execution halted
*** arch - x64
Error in namespaceExport(ns, exports) : undefined exports: collect_data
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
Any thoughts?
explore as.data.frame
methods for the lists returned by the methods found in betfair
Not sure how to test a package like this which requires authentication, but can probably use testthat
to test that requests are correctly formatted.
Other packages to look at for testing
package | link | test dir |
---|---|---|
gistr |
link | tests |
googlesheets |
link | tests |
rgbif |
link | tests |
rstudioapi |
link | tests |
I will add others when I find them, but these are packages which should serve as good examples of how testing an API package like betfaiR
should be carried out. Read Hadley on testing
The print
method for marketCatalogue
could be simplified to print just data on the market and event (if available), with the addition of a summary
method.
The current print
method can be found here which is perhaps more suitable for summary.marketCatalogue_list
One of the methods marketBook
returns the unparsed response from Betfair's API. This is due to the response being heavily nested and making life difficult to write a function to organise it into useful data structures for R users to work on.
see lines
The betfair_parse
method will likely look like the parse method for marketCatalogue
(see here), but I need to explore the data that can be returned.
Explore possibility of adding Australian markets.
Looks like the endpoint is the only difference?
Domain | Endpoint |
---|---|
UK | https://api.betfair.com/exchange/betting/json-rpc/v1 |
Aus | https://api-au.betfair.com/exchange/betting/json-rpc/v1 |
Might be as simple as including a switch
statement in the bf_post
function?
This relates specifically to the marketBook
function.
Rather than have the user store any queries from the available methods in objects and leave them to explore the data, it might be beneficial to also store queries inside the betfair
environment.
Providing them with functions (in the environment):
bf$findSelection()
bf$findMarketId
making it easier for them to explore that data.
OR
return an environment, with various functions to explore the data, return the raw data, etc.
suggestions welcome
with the addition of more methods some of the code could use a bit of clean up. Functions like replaceInstructions
and limitOnCloseOrder
are doing very similar things, rather than having multiple little functions perhaps think about storing them in a similar fashion to the [betfair
] environment.
This would reduce the number of functions being exported.
Also look to change names from betfair_parse
to shorter bf_parse
Hello!
Just started using the package when the gambling law changed in Sweden the 1st of January. Can you please add..
"sweden" = "https://identitysso.betfair.se/api/login"
..to the rest of the countries in the jurisdiction switch in betfair_login.R?
Thank you for a good package!
Documentation (in R package and docs on web) could use a clean up, so it is more in line with Betfair API docs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.