Get racing results by marketId

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 1nner
    Junior Member
    • Mar 2011
    • 11

    #1

    Get racing results by marketId

    What is the best way to get the results of a racing market given its marketId? Is there a way to do this directly via the API?

    I have found two possible ways but both have problems:
    • form.timeform.betfair.com - Can't see a way to look up results by marketId
    • rss.betfair.com - Doesn't show full finish order, only winner


    Also, both the above would require parsing the HTML and matching the runner names rather than the selectionId, which is error prone.
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    listMarketBook contains the results. Winning selections have STATUS = "WINNER". Be prepared for STATUS = "REMOVED", which will happen for non-runners and in case of the event not finishing, for whatever reason.

    For racing, I guess you'll have to query the WIN and PLACE markets. I don't know how you can get the placed runners in finishing sequence.
    Last edited by jabe; 01-04-2016, 01:20 PM.

    Comment

    • Mr Magoo
      Junior Member
      • Jan 2011
      • 86

      #3
      Although you can't lookup a race by marketId on the timeform results pages, the HTML does include this ID in the individual race results. So you could grab them all and index them yourself.

      As Jabe says, the API can also provide a win/lose flag (but not finishing position) for each race. I think you can query races up to about 90 days old. AFAIK, you can't retrieve runner names for closed races, so you'll need to have previously recorded the names of each runnerId yourself. Non-runners are not always reliable - depending on how the market was settled, the API may not flag NRs or may mark some runners that took part as NRs.

      As you mention, rss.betfair.com can provide winner / NR lists and also includes the marketIds in some of its URLs. Again, the results are very flakey (e.g. a quick glance today shows that in the E/W market for the Wolverhampton 13:30 result, apparently '31-40 minutes' was a winner.) Non-runners are also often incorrect or missing, for example, the site has a bug with horses that have brackets in their names. Betfair don't care about fixing it and the service is in perpetual 'beta' status.

      Timeform's results are also not always correct, especially for non-GB races.

      In short, if you want to get reliable results, you are best off trying to check as many results services as you can!

      Comment

      • Mr Magoo
        Junior Member
        • Jan 2011
        • 86

        #4
        Also, for racing on the Australian exchange, Betfair provide a horses & greyhounds results service at batdata.betfair.com.au, or at least, they used to. I can't find a human-viewable page on the site any more, but the JSON results still work!

        For example, try fetching a URL like:

        http://batdata.betfair.com.au/racing...ate=2016-03-31

        The data contains market IDs and the complete finishing order. Or you can query a race directly by market ID, e.g.

        http://batdata.betfair.com.au/racing...etid=101432532

        Once again, results accuracy is not great and don't rely on the data for exact runner/non-runner status.

        Comment

        • 1nner
          Junior Member
          • Mar 2011
          • 11

          #5
          Many thanks both. I missed the status field on runners in listMarketBook.

          That JSON service looks promising, I guess there is no service like it for UK markets?

          Comment

          • Mr Magoo
            Junior Member
            • Jan 2011
            • 86

            #6
            I've not found one, but there might be another results service lurking around that Betfair provide. They seem to have so many, but no one service that provides all the data. The API is probably the closest to a complete results system there is.

            Just remembered yet another Betfair results service:

            https://promo.betfair.com/betfairsp/results.html

            This provided daily results for all markets that used Betfair's starting prices (BSP). However, it appears to be broken, despite being advertised by Betfair elsewhere on their site.

            EDIT: One more Betfair results service: There's the BSP archives at http://www.betfairpromo.com/betfairsp/prices/ (still working and is updated regularly) Again, it will just give a win/lose flag for each runner, but is naturally just for races that had BSP. And again, it is unreliable because sometimes non-runners are left in and their starting price is quoted. Other times, the BSPs are adjusted and recalculated to account for the non-runners.
            Last edited by Mr Magoo; 01-04-2016, 04:26 PM. Reason: Added yet more BF results pages

            Comment

            Working...
            X