Get Race Status data for horse racing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nutic
    Junior Member
    • Apr 2019
    • 1

    #1

    Get Race Status data for horse racing

    Hello,

    I am trying to pull Race Details info for Horse Racing. I need flags like: `going behind` `at the post` etc.

    Seems that I can get that only from: https://docs.developer.betfair.com/d...ace+Status+API

    I am using NodeJS with JSON REST interface for betting API so I can't really make it work with JSON-RPC....
    I am also using Dev API key, not sure if that's causing a problem....

    Here is what I did

    Code:
    const request = require('request');
    
     let options = {
        url: "https://api.betfair.com/exchange/scores/json-rpc/v1",
        method: "post",
        headers:
            {             "content-type": "application/json",             "x-application": 'xxxx'         },
        body: JSON.stringify({
            "jsonrpc": "v1.0",
            "method": "ScoresAPING/v1.0/listRaceDetails",
            "params": []
        })
    };  
    
    request(options, (error, response, body) => {    
        if (error) {
            console.error('An error has occurred: ', error);
        } else {
            console.log('Post successful: response: ', body);
        } });
    And as response, I get
    Post successful: response: {"jsonrpc":"2.0","error":{"code":-32099,"message":"SANGX-0004","data":{"APINGException":{"requestUUID" :"null","errorCode":"INVALID_APP_KEY","errorDet ail s":""},"exceptionname":"APINGException"}}}
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    The app key appears to be invalid. Did you get it to log in okay?

    Comment

    • WTPooh
      Member
      • May 2012
      • 88

      #3
      Add "X-Authentication": "your app key" to headers.

      Comment

      Working...
      X