Programming/Coding on Betfair

LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

spreadbetting wrote:
Fri Nov 29, 2019 2:24 pm
PeterLe wrote:
Fri Nov 29, 2019 2:03 pm
...Just to add...
When you install Python, the BetfairLightweight wrapper is only certified up to and incl 3.7
Regards
Peter
Current python is 3.8, what do you mean by certified,Peter? That it's only been tested on up to 3.7 or it'll only run on 3.7 and below? Can't imagine anything drastic would have been introduced between 3.7 to date.
Currently only tested up to 3.7, 3.8 should be fine but I haven't tested yet (working on v2.0)

https://travis-ci.org/liampauling/betfair
https://travis-ci.org/liampauling/betfa ... /600776505
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

Sorry SB, I intended to say Tested rather than certified; Thanks for clarifying Liam
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Thanks.
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Haven't had much time, or more likely inclination, to get much further with the python course, about 45% done. But I have just written a script to log into the interactive API and get a session key returned :o

Now able to pull down the markets, just have to figure out how to order the json data within python now into some kind of order I can visualise it as I'm so used to std class multidimensional arrays from php
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

Nice one! You're further ahead than me; just maxed with my day job 12 hour days at the mo...will be clear by end of jan...
Have you joined the Slack group? There's lot of people willing to help on there if you get stuck..
Im making progress in the right direction; The problem I have is one of frustration, I have some very good ideas and cant implement them (yet!) but Ill get there.

Also, Ive just posted in the good book thread..about the book "the man who solved the markets" I thought of you, xitan and Liam to name a few who would really enjoy this book...
Regards
Peter
spreadbetting
Posts: 3140
Joined: Sun Jan 31, 2010 8:06 pm

Yep finding time is probably the hardest thing, I thought I'd have a tinker as racing finished early and no night stuff.

Slowly figuring out the structures but dictionaires within lists within dictionaries etc and when you try and look online most examples are for python 2 so it's a right pain in the ass.
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

Evening
Im just looking for the best source to scrape the following day greyhounds and horse racing runners.
Ill use Python, but wondered if some sites are easier than others to do this from ?
Any help appreciated
Thanks in advance,
Regards
Peter
dragonzed
Posts: 1
Joined: Tue Mar 17, 2020 9:36 pm

I keep seeing this thing about £299 for an API key but I have a "live" key yet I've never had to give Betfair any money. I signed up for my key years ago, before NG, I think even then there was some tiered pricing but the delayed pricing was sufficient for what I was doing.

Have I somehow got lucky in getting this key for free?
User avatar
johnsheppard
Posts: 283
Joined: Mon Feb 04, 2019 6:00 am
Location: Cairns Australia

dragonzed wrote:
Tue Mar 17, 2020 9:53 pm
I keep seeing this thing about £299 for an API key but I have a "live" key yet I've never had to give Betfair any money. I signed up for my key years ago, before NG, I think even then there was some tiered pricing but the delayed pricing was sufficient for what I was doing.

Have I somehow got lucky in getting this key for free?
I think so. They used to do it for free. Way back, but someone that's been around longer than I might confirm.

As an aside, if anyone is serious about doing any coding...$300 is a pittance compared with the labour/opportunity cost of doing any real coding that might return a profit... you should probably not be too concerned about that price tag (well other than ignorance/noobiness and resulting lofty expectation)... you're gonna be sinking months/years/decades into coding... pay for the things that make you more efficient is smarter...

I would guess Betfair started charging for api keys to reduce support costs....
User avatar
ShaunWhite
Posts: 9731
Joined: Sat Sep 03, 2016 3:42 am

+1 John.
£299 for lifetime access is the bargain of the century. And I agree it's chicken feed compared to the bottom line cost in terms of time.
LinusP
Posts: 1871
Joined: Mon Jul 02, 2012 10:45 pm

The fee was added to try and stop the data scrapers however send me a message if you want a live key.
Xeres
Posts: 52
Joined: Mon Jun 03, 2019 2:56 pm

I do all my own coding in R, I never really got on with Python, I found R so much easier to set up and it had all the libraries I needed. There is also a really nice IDE to work in which wasn't really available in Python back then.

In terms of the API there is already a library to do most of what you want, you can place orders, amend, cancel etc. You can collect all the price/volume data and all the metadata too.

I start collecting data from 8am each day and then at increments which get shorter up to the time the race starts, this data feeds straight into my predictive model which was also developed in R so I get near real time predictions. It's not even that much code because R is very functional so a lot of the work is done for you, it's also very very fast if you use the correct libraries.

If you have large data or complex models running things in parallel is also quite easy and some libraries do it straight out the box.

If you want to get started you just go to here for R
https://mran.microsoft.com/

and here for the IDE
https://rstudio.com/

I would use Linux so you can connect to R on local host from say your windows laptop or something similar.

It's a great thing to get into, even as a hobby but it can really transform what you do and open up many more doors in terms of strategies you are able to test/deploy etc.
User avatar
johnsheppard
Posts: 283
Joined: Mon Feb 04, 2019 6:00 am
Location: Cairns Australia

Speaking of R....Another investment I found useful is pluralsight...it's expensive...but pretty useful if you're not hanging around professional programmers all day......

They have a fair bit of data science stuff with R (I haven't watched any)...yet...but it seems to be R and python that data science specific stuff revolves around...

Lots of machine learning stuff there too...(I haven't watched that yet either)...one day... once I make my millions doing the basics... :)

I am a c# guy, and I have found a lot of their C# stuff really useful...(also the DDD stuff is super helpful too depending on what you are doing)...
DaveJSimonds
Posts: 1
Joined: Thu Jan 02, 2020 3:00 pm

Hey All

I’ve been working on my Bot for approx 2 years, I’ve had some really good success too.

Obviously I’m going through a dry spell with the lack of racing/football so tonight I’m doing a bit of research and I’ve stumbled across this forum topic....I’m so happy to have found a group of people doing the same as I am.

I believe their is a slack group that people can join?! How would one go about joining this group?

Thanks
PeterLe
Posts: 3715
Joined: Wed Apr 15, 2009 3:19 pm

Morning Dave
Anyone can join the BetfairLightWeight Slack group (Started by betangel member LinusP - Liam). I can see that you have already joined last night
There are some smart folk on there and you will find people are always keen to help.
Out of interest; what language do you use?
Regards
Peter
Post Reply

Return to “Betfair Exchange API”