BetFair API (in Perl)
Posted by mattc at Dec 27, 06 07:20 PM ... Comments (6)
I've released some code I wrote over the summer in the hope I can find someone with a few hours to help me finish it off. As in, someone who writes better Perl than me.
I've called the project betfairfree and, as the description on Google's subversion hosting says, it's an 'interface to the free version of BetFair's Sports Exchange API', and to liberally quote from BetFair themselves ...
"With the Exchange API, you can communicate directly with the Betfair database in XML format via a SOAP interface. By using the Exchange API, your application can provide a custom interface, functionality and specialized operations not otherwise afforded by the web interface."
The code is in a usable state, but certainly not finished, and suffice to say I don't make my living writing Perl.
The main things on the todo list are a) to get a complete coverage of the free API (probably only implements 60% of it at the moment), b) as always, the code deserves a second pass with some areas needing refactoring, and c) some decent examples of what one might do with it, which will of course be the fun part.
It's not going to get finished in a hurry, by me at least, but I'll try to transfer my own notes in to the various areas of the now-public project wiki, issues etc.
The API is described in SOAP, which I've not used before, but I enjoyed working with strongly typed XML documents, and Matt Sergeant's XML::Xpath module was great for removing the headache from working with the heavily nested nodes and multiple namespaces that seem to come hand in hand with SOAP.
So if you have any interest, do download the project files and drop me a line if you have anything to contribute.
Comments (6)
Hi Matt, I'm not sure if you know but betfair are changing their API version and dropping support for the version of the API your code uses. I've changed the templates and the code for this, also added some bits I'm happy to share. Let me know if you want the svn diffs. regards, Paul
Posted by Paul Orrock at May 16, 07 02:22 PM
Do you know if the latest release is using the current Betfair API? Also I would just like to say thanks for providing the perl code, I've been looking for something like this for some time now. Even though I would like to contribute to the project in some way I don't think my perl skills are quite up to the challenge.
Posted by Julian Moors at Jun 18, 07 10:09 AM
Yup, Paul (see above) kindly contributed a couple of patches that means it should be working on the latest version of the API. I'll double check tonight and release a new tar file in the distributions area. Simple things like submitting bugs, feedback and suggestions for improvements would be gratefully received. If you do write anything using betfairfree that others might want to use then post it somewhere for the world to see. Thanks, M
Posted by Matt Chadburn at Jun 18, 07 11:36 AM
hi, and thanks , my perl is certainly no better, but i am working my way through the code, and i seem to be missing something, .... The third function in the README, the "log best prices" one , seems to be broken, it only logs the first price of the first runner in the race , the response of course contains all of the runners (3 deep ....) i am trying to debug that but i can't figure out xpath, maybe i'll move to xml::simple . anyone got that running ?
Posted by stalih at Jun 28, 07 02:57 PM
stalih> I've made some changes this afternoon and package them up as version 0.63 - see the downloads section of the site. The most interesting thing, based on your point, is some improvements to the logging application. Rather than (pointlessly) logging just the price of the top runner it now logs the prices for all runners at a given interval and outputs to a easily parseable format. See the ./trunk/docs/sample-logs/ for an idea of the output.
Posted by Matt Chadburn at Jul 8, 07 06:50 PM
cool, thanks . i've changed to xml::simple, which in conjunction with forcearray gives a very nice structure.
Posted by stanlih at Jul 12, 07 11:45 AM
Post Your Comments
random bookmark
link summary
month
October 2009 (1)
September 2009 (14)
August 2009 (16)
July 2009 (21)
June 2009 (24)
May 2009 (16)
April 2009 (2)
March 2009 (22)
February 2009 (11)
January 2009 (11)
December 2008 (9)
November 2008 (16)
October 2008 (18)
September 2008 (11)
August 2008 (12)
July 2008 (20)
June 2008 (15)
May 2008 (27)
April 2008 (9)
March 2008 (10)
February 2008 (8)
January 2008 (8)
December 2007 (12)
November 2007 (10)
October 2007 (10)
September 2007 (6)
August 2007 (13)
July 2007 (8)
June 2007 (10)
May 2007 (12)
April 2007 (5)
March 2007 (12)
February 2007 (13)
January 2007 (22)
December 2006 (21)
November 2006 (28)
August 2006 (1)
category
code (15)
food (4)
notes (4)
photo (18)
project (2)
quote (12)
sketch (13)
soup (10)
travel (2)
matt chadburn . wiki . 2010