Horse Racing MarketId's

The sport of kings.
Post Reply
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

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!
poklius
Posts: 105
Joined: Sun May 17, 2009 11:58 am

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. :roll:
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

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. :roll:
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
Posts: 105
Joined: Sun May 17, 2009 11:58 am

So why not just put todays ids online from your database and let users connect to it?
spreadbetting
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
Zapata
Posts: 213
Joined: Thu Jan 21, 2010 11:58 pm

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.
LinusP
Posts: 1918
Joined: Mon Jul 02, 2012 10:45 pm

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
Bingo, thats exactly what I want thanks!

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 :D I also want something that doesn't rely on anything but betfair / an internet connection.
spreadbetting
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.
Post Reply

Return to “Trading Horse racing”