Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    SmartConnect.getMarginApi() throws exception.

    Python SDK
    2
    3
    8
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sdrnaikinv last edited by

      This API was working fine earlier. Started throwing exception from last few days.

      Exception:

      Lib\site-packages\SmartApi\smartConnect.py", line 235, in _request
      raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format(
      SmartApi.smartExceptions.DataException: Couldn't parse the JSON response received from the server: b''
      Response: 200 b'{"status":true,"message":"SUCCESS","errorcode":"","data":{"net":"6356.4385","availablecash":"6356.4385","availableintradaypayin":"0.0000","availablelimitmargin":"0.0000","collateral":"0.0000","m2munrealized":"-2180.0000","m2mrealized":"0.0000","utiliseddebits":"44976.3715","utilisedspan":null,"utilisedoptionpremium":null,"utilisedholdingsales":null,"utilisedexposure":null,"utilisedturnover":null,"utilisedpayout":"6356.4385"}}'

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @sdrnaikinv last edited by

        @sdrnaikinv You can see in the API response posted by you that the data is available. It is your program which is not able to parse the data.

        S 1 Reply Last reply Reply Quote 0
        • S
          sdrnaikinv @admin last edited by

          @admin The response is not in a proper json format. That's why SmartConnect,py class throws error. As I observed, it's broke since Apilr01 2026.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post