One of the questions I often see in various forums is, "How do you extract live Betfair market data without having to use the Betfair API?". So in this short article I will demonstrate to you exactly how to do this. Not only will you be extracting the live data directly from Betfair, but you will also be able to save that data to a text file for further processing or for use in other applications once it has been parsed.

Please note: We do not advocate using Betfair Data in the manner setout in this article, but there may be times when you require a "one-off" snapshot of a market on Betfair, in which case here's how to achieve that. The alternative is to subscribe to the Betfair Developers Program where you will gain full access to their Data through the Betfair API. 

1. Decide which market you want to extract the data from. Go to the Betfair site and if the market is listed on the main page then hover your mouse over the link to it and the Market ID will be displayed in the left hand corner of your status bar at the bottom of your browser in the following form: javascript:GoToMarket('XXXXXXX',false,HFL); where XXXXXXX is the actual numerical ID.

If you are unable to locate the ID of the market this way, simply click on the link from the list of markets on the main left hand menu and watch the bottom left hand corner of your browser in the status bar for the ID to appear in the link. You have to be quick though, but it is definitely visible.

2. Armed with the above information, type the following into your browser address bar: http://www.betfair.com/betting/LoadMarketDataAction.do?mi=XXXXXXX where XXXXXXX is the Market ID. Voila! You should now have a blank page appear. It is what is behind this blank page that interests us. To view an example of the raw output in a file saved in PDF format download the article attachment (located at the bottom of this article). The Market ID in this instance was 2270144 so the above URL became: http://www.betfair.com/betting/LoadMarketDataAction.do?mi=2270144 in order to retrieve the data for that particular market.

3. If you are using Internet Explorer, put your mouse over the blank page and click once on the right mouse key. Choose "View Source" and notepad should appear, complete with all the event data in a text file.

4. The format of the data is simple: Basically it provides all the necessary ID's for the event and selections, and also provides you with the odds (and the amount of money available at those odds).

All you have to do now is parse the file to remove any unwanted "clutter" and process the data in any way you see fit.

If you are unsure how to write a script or application to parse the data click here where you will find someone who will do it for you at a very low cost.

Retrieving data in this way opens up a whole new realm of possibilities for analyzing market movements over a period of time. For example, it would not be difficult to write a script that automatically retrieved data in the above manner, parsed it, processed it and stored it in a time-stamped record for insertion into a database. This data could then be imported into an Excel spreadsheet, etc.

At the time of writing this article the above information was correct, but the preferred manner of accessing Betfair data is through the channel of the official Betfair Developers Program.

Copyright © 2004 - www.laytheodds.com