How to get Account Balance using python?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wagons
    Junior Member
    • May 2019
    • 3

    #1

    How to get Account Balance using python?

    I'm trying to get my account balance using python but getting the following error : {'jsonrpc': '2.0', 'error': {'code': -32700, 'message': 'DSC-0008'}}.

    Could anybody share the request and header structure should look like to get back a successful response?

    i'm currently using the end point
    EXCHANGE_ENDPOINT = "
    https://api.betfair.com/exchange/account/json-rpc/v1"

    following request : {'jsonrpc': '2.0', 'method': 'AccountAPING/v1.0/getAccountFunds'}

    and the following header : {'X-Authentication': **********, 'X-Application': **************}

    Any help would be greatly appreciated.
    Last edited by Wagons; 29-05-2022, 01:39 PM.
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    DSC-0008 is a JSON Deserialisation Parse Failure.

    See if you can isolate the final JSON string that your program sends and paste it on here so we can see what's wrong with it. I assume you've logged in successfully.

    Comment

    • bfexplorer
      Senior Member
      • Sep 2018
      • 212

      #3
      Use this python library

      https://github.com/betcode-org/betfair

      Comment

      • Wagons
        Junior Member
        • May 2019
        • 3

        #4
        Thanks a lot for the responses, i'll do that jabe and come back to you, yes i've logged in sucessfully. I don't want to use the library as i've built the whole application from scratch myself.

        Thanks bfexplorer.

        Comment

        • Wagons
          Junior Member
          • May 2019
          • 3

          #5
          jabe - i actually found the issue. I wasn't using json.dumps for the request and so was sending it through as you said incorrectly. Appreciate your input.

          Comment

          Working...
          X