listRaceDetails for dog races

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NicolasW
    Junior Member
    • Nov 2017
    • 2

    #1

    listRaceDetails for dog races

    Hello,

    I am trying to know through the API where the race stands. I am using listRaceDetails as below. Although the website shows "PARADING" or "GOINGINTRAPS" I only receive "NO_LIVE_DATA_AVAILABLE" from the API.

    JSON query below - I don't think there is an issue with my query. API doc states this means no data is being provided (http://docs.developer.betfair.com/do...ace+Status+API)

    "{"jsonrpc": "2.0", "method": "ScoresAPING/v1.0/listRaceDetails", "params":{ "meetingIds": [my_market_ID]}}"

    Is it because dog races aren't supported (the doc says they should) or because I use the free development API (ie did not activate the £299 live data functionality). Or is there a better way to know when the dogs are parading, going to the traps?

    Many Thanks,
    Nic
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    The variable you have specified for "meetingIds" in your call is my_market_ID. The parameter should be an EventId. Is it possible that this is causing your problem?

    I haven't used listRaceDetails. If you specify meetingIds, does it return data for all the day's races at the meeting? I note there is an option to specify raceIds.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #3
      I've added some code to my program's test page and this is what the call and reply look like for a race which starts in around 72 minutes from now.

      SENT: for Event = 28461655

      {"jsonrpc": "2.0", "method": "ScoresAPING/v1.0/listRaceDetails", "params": {"raceIds": ["28461655.1856"]},"id": 1}

      REPLY

      {"jsonrpc":"2.0","result":[{"meetingId":"28461655","raceId":"28461655.1856"," lastUpdated":"2017-11-04T17:18:58.083Z","raceStatus":"DORMANT","response Code":"OK"}],"id":1}

      When I specified meetingIds and passed the value 28461655, I got all the races for the meeting. The raceId was taken from the URL displayed in my browser when I went to a random later race.



      When I tried using an EventId (pretending it was a meetingId) from a current football match (which started around 15 minutes ago), the following was returned:

      {"jsonrpc":"2.0","result":[{"meetingId":"28450948","responseCode":"NO_LIVE_DA TA_AVAILABLE"}],"id":1}
      Last edited by jabe; 04-11-2017, 06:47 PM.

      Comment

      • NicolasW
        Junior Member
        • Nov 2017
        • 2

        #4
        Thanks Jabe for your help!

        I was indeed silly with the event Id - I was using the mktID without "1.I even feel ashamed to write that on this forum!!

        It does work in the end but not for all tracks. It seems to work for the tracks that also have the video on Betfair - at least for dog races.

        Have a good evening!
        Nicolas

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Glad to help. We've all done it!

          There's another point I should make you aware of that might be worth your consideration to avoid future problems.

          The marketId codes and the raceId for the listRaceDetails both have the look of a number with a decimal part. With JSON, and with the Betfair API, these can be passed as a string without causing a problem. This might seem daft, but there have been instances of final digits disappearing from numbers.

          As an example, if I had a raceId that looked like this

          12341234.7890

          and I code it in the JSON string as a number, it is quite possible for it to be interpreted as

          12341234.789

          because if it is a number the final zero is to all intents and purposes useless. So when the Betfair API searches for race details of race 12341234.789, it doesn't find anything, and your program gets confused.

          In order to avoid this, you might consider arranging for such variables to have quotation marks around them so that the raceId is presented as a string, and the final zero is not lost.

          This should be easy enough in most or all languages. I'm using Visual Basic and one of the lines that gathers in my parameters looks like this (preparing a CancelOrders call)

          Code:
              Dim intext = """marketId"": """ & marketId & """,""instructions"": [{""betId"": """ & betId & """,""sizeReduction"":" & amount & "}]" ' and ?
          before it it passed. I'm a little surprised I haven't wrapped the variable amount in quotes, but I haven't tested this code yet, so I may well change it.

          Comment

          • only1jake
            Junior Member
            • Nov 2016
            • 29

            #6
            Hey Nicolas, I believe it only works for UK/IRE dog tracks. Do some of them not show the status?

            Comment

            Working...
            X