Betfair Exchange API : Programming/Coding on Betfair

Post Reply
PeterLe
Posts: 3580
Joined: Wed Apr 15, 2009 3:19 pm

Wed Nov 13, 2019 12:30 pm

In a recent post, i mentioned that it may be nice to have a separate topic for those interested in writing their own code to connect to the API for trading extracting data etc
So if you use C#; Python, Java or whatever, then maybe we can share ideas/help

The idea stemmed from this post by Liam/Wolf:-
[/quote]

viewtopic.php?f=55&t=13909

Basically you need to sign up to use the betfair API which is £300 and then build the software the access the API.
LinusP has a public github repo with some generic python code to access the API streaming data. I think his github repo has the code used to access the API only, so you would still need to develop a shed load of code for yourself once you have a set of working API connection functions in order to achive anything resembling what he has built for his own personal use.
[/quote]

Pretty much however flumine allows you to record the raw streaming data that betfair charges a fortune for. Recording parsed data as it comes through is good but having the raw data available is invaluable.

https://github.com/liampauling/betfair
https://github.com/liampauling/flumine
[/quote]

Ive been playing around with C#, but recently decided to take a look at Python too. It's early days but Im finding it easier to learn Python than C#
For anyone interested in learning Python, this course is interesting (on Udemy) :

The Modern Python 3 Bootcamp - by Colt Steele (Course cost £13)

Regards
Peter

User avatar
Derek27
Posts: 8745
Joined: Wed Aug 30, 2017 11:44 am
Location: UK

Wed Nov 13, 2019 4:13 pm

PeterLe wrote:
Wed Nov 13, 2019 12:30 pm
Basically you need to sign up to use the betfair API which is £300 and then build the software the access the API.
I haven't yet got round to looking at accessing the API directly but I thought it is free to use and test (with a 20-second delay) so you only need to cough up when you're ready to run or test live?

spreadbetting
Posts: 2953
Joined: Sun Jan 31, 2010 8:06 pm

Wed Nov 13, 2019 4:19 pm

Only thing that put me off python when I had a quick look was that it seemed very much command line type of stuff rather than a GUI. Can you code GUI with python and also what program/compiler would people recommend, my daughter at uni uses spyder(?).

User avatar
northbound
Posts: 736
Joined: Mon Mar 20, 2017 11:22 pm

Wed Nov 13, 2019 4:48 pm

I recommend learning Nodejs, which is Javascript that runs on a server, which was built from day one to be asynchronous.

For example, my horse Telegram alerts application is written in Nodejs, reading the Betfair Stream data. When it sees a fav getting beaten at low BSP, it hits the Telegram API to deliver the alert.

All the while it keeps reading the incoming Betfair Stream data, without waiting for the Telegram API request to complete its execution.

Asynchronous.

The added benefit of Javascript is that you can reuse some of the skills to write visual applications and charts that you can access with a web browser.

The learning process could be:

- Learn Javascript basics.

- Learn Nodejs basics.

- Learn basics of running a Nodejs application on Linux, as you can get a VPS for only $5/month.

- Write a Nodejs application that reads Betfair Stream data and stores it somewhere, e.g. snapshot of horse racing markets at post time.

- Make your Nodejs application expose an API that serves that data.

- Learn a Javascript front-end framework (Reactjs, Angular) to create a GUI that you can access in a browser to display that data served by your Nodejs API.

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

Wed Nov 13, 2019 5:43 pm

Derek,
I was lucky enough not to have paid anything for the API keys, I got mine converted before the charges were brought in
(I think they are £200/Key now??)

Northbound, Thanks, but I think if I try anything else just now, my head will explode! (just spent two hours just being able to get the latest version of python on my mac and getting Sublime working with it :D
The reason i wanted to try Python was because Liam has already uploaded files to github and I wanted to play around..

...There could be another Voler la Vedette error coming up soon from my account :D

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

Wed Nov 13, 2019 5:47 pm

spreadbetting wrote:
Wed Nov 13, 2019 4:19 pm
Only thing that put me off python when I had a quick look was that it seemed very much command line type of stuff rather than a GUI. Can you code GUI with python and also what program/compiler would people recommend, my daughter at uni uses spyder(?).
I had that question too Spreadbetting; id be keen to know the answer also

User avatar
ShaunWhite
Posts: 6188
Joined: Sat Sep 03, 2016 3:42 am

Wed Nov 13, 2019 6:28 pm

PeterLe wrote:
Wed Nov 13, 2019 5:43 pm
(I think they are £200/Key now??)
£299

User avatar
ruthlessimon
Posts: 2015
Joined: Wed Mar 23, 2016 3:54 pm

Wed Nov 13, 2019 7:02 pm

PeterLe wrote:
Wed Nov 13, 2019 12:30 pm
you would still need to develop a shed load of code for yourself once you have a set of working API connection
In your opinion, if average joe was plucked off the street (& only has gcse maths).

What kinda timeframe/hrs are we looking at, for developing something similar to what Liam has at his disposal?

(i.e. absolutely nothing -> rough ability to simulate the ladders)

User avatar
ShaunWhite
Posts: 6188
Joined: Sat Sep 03, 2016 3:42 am

Wed Nov 13, 2019 7:46 pm

ruthlessimon wrote:
Wed Nov 13, 2019 7:02 pm
PeterLe wrote:
Wed Nov 13, 2019 12:30 pm
you would still need to develop a shed load of code for yourself once you have a set of working API connection
In your opinion, if average joe was plucked off the street (& only has gcse maths).
It's a tough question.
I wouldn't worry about maths, there's none in coding. It's more about people's ability to break tasks down into small steps and choosing the right actions to perform them, while considering every evenuality such as missing info etc.

I'd say the people most suited to coding are people who have an aptitude for languages rather than maths, afterall most programming languages are an assembly of verbs, performed on nouns which themselves have adjectives... Like Excel, cells (nouns) have properties (adjectives) and you do stuff to them (verbs).

Given decent sample lumps of code, learning in a structured way, to get average Joe with zero experience to the point where they can read/write data from SQL or an API you might be looking at.... a monthish, or two ???? ...but most of that is just getting used to the development envoironment/tools/language basics etc. All stuff which you then don't need to do again for the next stage, progress accelerates. A project can be as big as your imagination though so something major can take years.

The hardest part is usually the visualisation and user forms/buttons etc, personally my stuff doesn't even have much of a display, just text in a command window to show how it's doing. Creating something visual like a ladder you can click on that does stuff is a whole different world of pain.

So hard to estimate though, sat with someone who understands how you like to learn, with decent sample code, you could probably get something simple working like reading and writing a file, inside a couple of days. But like poker, mins to learn and a lifetime to master. The probelm when you start is that you need to have a decent plan/idea of how it's going to work, but without knowing what you can do or how you do it, that's a bit of a Catch22.

Best thing might be to try some beginners stuff on Udemy and it'll either click in a week or it won't. The choice of language will probably be dictated by what you want to do. As I said a dumb data collection app or even trading bot is a very different thing to something with a recognisable functional front-end display. VBA is never a bad place to start though to see if you have the knack, because Excel does a lot of the heavy lifting on the display/data handling side and there's a ton of samples and tutorials. But you will need to move on to do something more suitable pretty soon.

User avatar
ruthlessimon
Posts: 2015
Joined: Wed Mar 23, 2016 3:54 pm

Wed Nov 13, 2019 8:08 pm

Really interesting take ty :)

Post Reply

Return to “Betfair Exchange API”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests