I am currently making a simple program that scrapes various bits of data from the betfair website (graphs/silks e.t.c) However I can't seem to find an easy way to get the marketId's / selectionId's of UK/IRE horse racing markets without using the API.
The plan is to make the program open source hence why I don't want to use the API. Using python I have wasted a lot of time trying use BeautifulSoup but it seems that the betfair website has so many nested div's it struggles...
Any ideas appreciated!
Horse Racing MarketId's
Timeform racecard ids are same as betfair market ids, but runners ids differ. So the only way of getting market and runners ids I can think of now is to:
Create database of runner names and runner ids from betfair sp files http://www.betfairpromo.com/betfairsp/prices/
Scrap timeform for marketids and runner names
Cross match runner names and runner ids
pain in the bottom as you will need to constantly update db for new runners.
Create database of runner names and runner ids from betfair sp files http://www.betfairpromo.com/betfairsp/prices/
Scrap timeform for marketids and runner names
Cross match runner names and runner ids
pain in the bottom as you will need to constantly update db for new runners.

I already scrape data from betfairsp and timeform daily into a db so I have all marketId's / selectionsIds but I am after a simple way of getting todays Ids. So I want something that is nice and simple that other users can use.poklius wrote:Timeform racecard ids are same as betfair market ids, but runners ids differ. So the only way of getting market and runners ids I can think of now is to:
Create database of runner names and runner ids from betfair sp files http://www.betfairpromo.com/betfairsp/prices/
Scrap timeform for marketids and runner names
Cross match runner names and runner ids
pain in the bottom as you will need to constantly update db for new runners.
-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
I use the API for all my stuff these days but previously have just scraped the todays racing menu and just parsed the data out . Here's the link , a bit of regex and it's easy enough to organise, remember if you want to use the marketID's with the NGAPI you add the 1. or 2. to the ID for UK or AUS servers
http://site.sports.betfair.com//menu/Lo ... &locale=en
To get the initial market data you'd just call up the market using the website links
http://uk.site.sports.betfair.com/betti ... $marketIdE
http://site.sports.betfair.com//menu/Lo ... &locale=en
To get the initial market data you'd just call up the market using the website links
http://uk.site.sports.betfair.com/betti ... $marketIdE
Sorry if I am totally misreading this, apologies if I am (been to the pub).
I get individual Betfair race ids from cell A1 and horse ids from cell A9 downwards in the first excel sheet.
This allows me to open BF source etc from excel using vba - no API coding required.
I get individual Betfair race ids from cell A1 and horse ids from cell A9 downwards in the first excel sheet.
This allows me to open BF source etc from excel using vba - no API coding required.
Bingo, thats exactly what I want thanks!spreadbetting wrote:I use the API for all my stuff these days but previously have just scraped the todays racing menu and just parsed the data out . Here's the link , a bit of regex and it's easy enough to organise, remember if you want to use the marketID's with the NGAPI you add the 1. or 2. to the ID for UK or AUS servers
http://site.sports.betfair.com//menu/Lo ... &locale=en
To get the initial market data you'd just call up the market using the website links
http://uk.site.sports.betfair.com/betti ... $marketIdE
Is that using the old website though?
My RDS his hosted in the cloud but I don't fancy making it open to the public as it has tb of betfair data on it

-
- Posts: 3140
- Joined: Sun Jan 31, 2010 8:06 pm
Not sure if they use the new or old site but even when that's switched off they'll always be simple URL's you can use to navigate the site without being logged in.
Those pages use the current json data so I'm guessing they'll be active once the old site goes as I did change things once they moved to using their data in json formats. If they do stop it'll only be a case of using some http sniffer to see what pages they use to populate the website. Just remember if you don't have a logged in session cookie the website data is delayed, if your grabbing is price sensitive.
Those pages use the current json data so I'm guessing they'll be active once the old site goes as I did change things once they moved to using their data in json formats. If they do stop it'll only be a case of using some http sniffer to see what pages they use to populate the website. Just remember if you don't have a logged in session cookie the website data is delayed, if your grabbing is price sensitive.