Hello all,
Are there historical CSV files available on the Betfair website for horse races?
I would like to have a play with Excel and import some horse race data - in particular starting prices etc.
Can anyone point me in the direction of where to get the CSV files from?
Cheers!
Betfair Historical Horse Race Data/CSV files
https://promo.betfair.com/betfairsp/prices
It helps to have some code to loop through and download the files for each day
It helps to have some code to loop through and download the files for each day
I'm about to go on hols so dont have time to update this but something likes this works in Auto-It (very old script I dug out for getting dog files for a year)#include <String.au3>
#include <InetConstants.au3>
#include <Inet.au3>
#include <IE.au3>
#include <math.au3>
Local $aURLs[0]
$oIE = _IECreate("https://promo.betfair.com/betfairsp/prices", 0, 1, 1, 0)
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
If StringInStr($oLink.href, "dwbfgreyhoundwin") And StringInStr($oLink.href, "2023") Then
_ArrayAdd($aURLs, $oLink.href)
;MsgBox("","", $oLink.href)
EndIf
If StringInStr($oLink.href, "dwbfgreyhoundwin") And StringInStr($oLink.href, "2022") Then
_ArrayAdd($aURLs, $oLink.href)
;MsgBox("","", $oLink.href)
EndIf
Next
_ArrayDisplay($aURLs)
While ProcessExists("iexplore.exe")
ProcessClose("iexplore.exe")
WEnd
For $x = 0 To UBound($aURLs) - 1
;MsgBox("", "", $aURLs[$x])
;_IENavigate($oIE, $aURLs[$x])
$data = _INetGetSource($aURLs[$x])
;MsgBox("","", $data)
$aSplit = StringSplit($aURLs[$x], "/", 2)
;_ArrayDisplay($aSplit)
$OutFileLay = "c:\temp\greys\" & $aSplit[5]
FileDelete($OutFileLay)
FileOpen($OutFileLay)
FileWrite($OutFileLay, $data)
FileClose($OutFileLay)
Next