Betfair Price Files Download Manager

Post Reply
Hugo219
Posts: 1
Joined: Sun Jun 10, 2018 5:50 pm

You're amazing DUDE!!/DUDe/Dud-ette ; Surprised at how few youtube views on there though, but your stuff is gold, good work and keep it up sensei !! Many thanks ;) :)

Also worth mentioning that WHEN running the files on a 64-bit machine, like mine, you'd have to mark declare statements with 'PtrSafe' ...... i.e. Using a very generic example below to demonstrate :
"Declare Function GetActiveWindow Lib "user32" () As Long"
becomes :
"Declare PtrSafe Function GetActiveWindow Lib "user32" () As Long"

If running on 32 bit machines, no changes to code required. ----Just my lil contribution
User avatar
gstar1975
Posts: 615
Joined: Thu Nov 24, 2011 11:59 am

nigelk wrote:
Sun Jun 18, 2017 12:35 pm
Finding the files here a pain to sort out exactly what you need? How long does it take to sort out & download 1 years worth of files?

www.betfairpromo.com/betfairsp/prices/

Heres a spreadsheet that does away with all the hard work & eyestrain.

Betfair Price Files v5.7z

Note: Any files created on your C drive must be named the same as shown on the download manager. I've made a you tube video thats gives a quick demonstration:

https://www.youtube.com/watch?v=AMpchy4 ... e=youtu.be

and also shows you what VBA reference libraries I've got ticked.

https://www.youtube.com/watch?v=r6rhQ95 ... e=youtu.be

The update button will process any info that is held in the spreadsheet, then looks for any updates for the current year from then on
For example, if you've download 2017 to date, when you run it tomorrow/next week, it will download any updated files. Some files are not listed such as " bfprices_26072008.csv" where there is no indication of win or place or even which country it is

If you look at the UK Win files from 2007, there are only two that we can be sure contain only the win info
Where can I find the Betfair SP matched Volume. Not Total Volume but just the matched money that was matched at Betfair SP. In these SP data files on the Promo site only have the columns for Morning Volume, Pre Off volume and In Play volume but no BSP volume matched for example:
280718 Gabrials King BSP matched Volumes.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
gstar1975
Posts: 615
Joined: Thu Nov 24, 2011 11:59 am

Can anyone also explain the discrepancies on the Picture below?

The BSP volume matched does not work out correctly or am I missing something...
280718 Gabrials King BSP matched Volumes.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
Euler
Posts: 24700
Joined: Wed Nov 10, 2010 1:39 pm
Location: Bet Angel HQ

That does look a bit anomalous because one should be related to the other.
dougkpga
Posts: 11
Joined: Wed Aug 22, 2018 4:12 pm

Hi Nigel,
That is an awesome help.
Far be it from me to complain as I am very grateful for the work you have saved me so this is not a complaint but when I downloaded, say 2015 (UK Win) and it said 365 files were available but it downloaded 163 files.
The other years 2016 (152 days) and 2017 (156) were a bit short too.
I'm not sure if I am doing anything wrong and still very happy with the results.
Cheers Doug
neilovan
Posts: 13
Joined: Sun Nov 18, 2018 11:12 am

Hello All,

Was just curious as to how things work.
I downloaded a few months data from betfair (the free stuff).
You get a stack of directories with 2 sub folder extracts.

How can you recursively extract each of these 2 files in each subfolder (using 7zip) to one central directory.
At this point you can make a dir list and process each file.

Any help appreciated,

Thanks,

Neil.
User avatar
ShaunWhite
Posts: 9731
Joined: Sat Sep 03, 2016 3:42 am

Maybe you could go to the root folder of the tree your files are in, search for all files, then copy & paste them all from the search window, to a single folder somewhere. Then unzip them in there? If you have duplicate file names windows can rename them for you when you do the copy.

Then as you say...you can open a command window, cd to the unzipped files folder and merge them with a dos Copy or Type command.
User avatar
firlandsfarm
Posts: 2688
Joined: Sat May 03, 2014 8:20 am

I'm getting a 'Compile Error' with Betfair Price Files v5.7z. :(

CompileError.JPG

STOP PRESS: Sorry, my fault, I hadn't seen Hugo219's patch for this before posting (see above). The "PtrSafe" addition works fine. Thanks Hugo … I will leave this post here just to advertise the patch. :)
You do not have the required permissions to view the files attached to this post.
User avatar
shortcut
Posts: 14
Joined: Tue Jun 23, 2015 12:29 pm

There was a problem accessing the files, it turned out to be that the URL had changed. They switched to a secure server. Make sure you change VBA code to add "s" after the http.

Double check your URLs and make sure the real life addresses match the ones your program is using.

I attached corrected spreadsheet in any case.
You do not have the required permissions to view the files attached to this post.
User avatar
firlandsfarm
Posts: 2688
Joined: Sat May 03, 2014 8:20 am

shortcut wrote:
Tue Apr 16, 2019 12:26 am
Make sure you change VBA code to add "s" after the http.
Well spotted Shortcut and thanks for the fresh download. I've delved into the code before and changed the target directories for saving the files. I look for "DestinationFolder = "C:\" & FolderName & "\" & DownloadFileName" and put my new path in place of the "C\". I use a D: drive for all personal stuff so changed the code to read "DestinationFolder = "D:\Data\BetfairSP's" & FolderName & "\" & DownloadFileName" and then added the Country and Market sub-folders (e.g. "UK Win" etc.) to the BetfairSP's folder just as I would have done on the C: drive.

However one change that I can't figure is downloading some files the spreadsheet misses. There are 491 files previous to the current naming convention, they are named "bfprices_DDMMYYYY.csv", "bfpricesire_DDMMYYYY.csv", "bfpricesireplace_DDMMYYYY.csv" and "bfpricesplace_DDMMYYYY.csv". I've tried changing/substituting every occurrence I can find of one of the existing file name types to say "bfprices" to download these files but cannot get it to work. :( I'm not a VB coder but I used to write in original BASIC so I have some idea what is going on with the code. Is there something obvious you think I may have missed?

Something else users of this data may not be aware of is that many price files have changed after first publication. Why? I don't know. Some of us may refer to the files daily to top-up our databases, some maybe make it a weekend job and some monthly … I admit I am a "when I think of it" type of guy because I don't need the data to be fully up to date for my purposes but I also don't like basing my decisions on known to be inaccurate data! Let's say you are a 'monthly' guy. :) There are currently 165 files in the list that were 'modified' 30 days or more after they were first published and so far this year 22 files have been modified at least once. And I'm sorry to say that if you are a Daily guy then 822 files have been modified since first published … just something to be aware of. The problem is identifying the modified files as they are sorted in order of "Date Created" on the webpage. I right click on the page, Select All, give it time to copy the selection, it is not immediate because of the size of the page. I then Paste the Text into a spreadsheet for sorting by "Date Last Modified" … you will need to do some manipulating of the date for Excel to read it (I use =DATEVALUE(MID(D2,5,2)&"/"&LEFT(D2,3)&"/"&MID(D2,9,4)) where the Date Last Modified is in column D. You can then compare the last Modified Date with the original Date Created and decide if you want to look at the modified file.
User avatar
shortcut
Posts: 14
Joined: Tue Jun 23, 2015 12:29 pm

MemphisFlash wrote:
Fri May 04, 2018 6:57 pm
If only i,d found this on tuesday. took me 10 hours getting the info i wanted. This way took less than an hour
As I was going through the downloaded data I noticed that there are missing items in the spreadsheets. E.g. half a day of races not there, BSP absent for the entire day. How did you go about missing data? Input manually or there's alternative download source?
eightbo
Posts: 2154
Joined: Sun May 17, 2015 8:19 pm
Location: Malta / Australia

Nigel you are a proper naughty geezer, never seen these XML/HTML commands before.

Horrendous that Betfair provides all this data then doesn't put any thought behind the filtering options — you can't even select "Horse racing only" on their site, let alone just UK horse racing data. They should really switch to a checkbox system but I suspect the price files haven't been in anyone's job description for a long time, possibly in the 2010-2012 window when they last changed the filters

...from:
Image

to:
Image
weemac
Posts: 1216
Joined: Mon Sep 16, 2013 8:16 pm

eightbo wrote:
Wed Apr 17, 2019 2:56 am

...........I suspect the price files haven't been in anyone's job description for a long time, possibly in the 2010-2012 window when they last changed the filters
I suspect you're right. It's done in a very haphazard, pretty amateurish way. A couple of times a year you can tell when the guy who normally does it goes on holiday, because the uploading just grinds to a halt for several days. And their Twitter helpdesk guy didn't even know of the existence of the download page when I contacted them after the page disappeared into the ether for 2 or 3 days.

You can't help but feel betfair is a company whose employees don't understand their own product, outwith their own specific area of expertise. You see it all the time on their forum; people describing in frustration how they have to explain to BF staff how the basics work.
eightbo
Posts: 2154
Joined: Sun May 17, 2015 8:19 pm
Location: Malta / Australia

I don't expect them to train their staff on all aspects as there's so much going on but if you're not going provide training then you should really have documentation ready as a reference point for whoever's handling the issue. Problem is it's just not there and they have to keep bouncing you to other people until someone actually knows what you're talking about.
User avatar
firlandsfarm
Posts: 2688
Joined: Sat May 03, 2014 8:20 am

shortcut wrote:
Tue Apr 16, 2019 12:26 am
There was a problem accessing the files, it turned out to be that the URL had changed. They switched to a secure server. Make sure you change VBA code to add "s" after the http.

Double check your URLs and make sure the real life addresses match the ones your program is using.

I attached corrected spreadsheet in any case.
Just found another 'update' … the VB code looks for file names that contain "uswin" and "usplace" whereas the Betfair files are "usawin" and "usaplace" (renamed?) … you need to insert the "a" in the FileType variable for the USWin and USPlace sub-routines.
Post Reply

Return to “Betfair Data”