<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[UNABLE TO GET MARGIN DATA]]></title><description><![CDATA[<p dir="auto">obj.getMarginApi(params) gives these error --</p>
<h2>obj.getMarginApi(params)</h2>
<p dir="auto">JSONDecodeError                           Traceback (most recent call last)<br />
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\<a href="http://smartConnect.py:231" target="_blank" rel="noopener noreferrer nofollow ugc">smartConnect.py:231</a>, in SmartConnect._request(self, route, method, parameters)<br />
229 try:<br />
230     #print("RAW RESPONSE:", r.content)<br />
--&gt; 231     data = json.loads(r.content.decode("utf8"))<br />
234 except ValueError:</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\json_<em>init</em>_.py:346, in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)<br />
343 if (cls is None and object_hook is None and<br />
344         parse_int is None and parse_float is None and<br />
345         parse_constant is None and object_pairs_hook is None and not kw):<br />
--&gt; 346     return _default_decoder.decode(s)<br />
347 if cls is None:</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\json\<a href="http://decoder.py:337" target="_blank" rel="noopener noreferrer nofollow ugc">decoder.py:337</a>, in JSONDecoder.decode(self, s, _w)<br />
333 """Return the Python representation of <code>s</code> (a <code>str</code> instance<br />
334 containing a JSON document).<br />
335<br />
336 """<br />
--&gt; 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())<br />
338 end = _w(s, end).end()</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\json\<a href="http://decoder.py:355" target="_blank" rel="noopener noreferrer nofollow ugc">decoder.py:355</a>, in JSONDecoder.raw_decode(self, s, idx)<br />
354 except StopIteration as err:<br />
--&gt; 355     raise JSONDecodeError("Expecting value", s, err.value) from None<br />
356 return obj, end</p>
<p dir="auto">JSONDecodeError: Expecting value: line 1 column 1 (char 0)</p>
<p dir="auto">During handling of the above exception, another exception occurred:</p>
<p dir="auto">DataException                             Traceback (most recent call last)<br />
Cell In[40], line 1<br />
----&gt; 1 obj.getMarginApi(params)</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\<a href="http://smartConnect.py:528" target="_blank" rel="noopener noreferrer nofollow ugc">smartConnect.py:528</a>, in SmartConnect.getMarginApi(self, params)<br />
527 def getMarginApi(self,params):<br />
--&gt; 528     marginApiResult=self._postRequest("api.margin.api",params)<br />
529     return marginApiResult</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\<a href="http://smartConnect.py:265" target="_blank" rel="noopener noreferrer nofollow ugc">smartConnect.py:265</a>, in SmartConnect._postRequest(self, route, params)<br />
263 def _postRequest(self, route, params=None):<br />
264     """Alias for sending a POST request."""<br />
--&gt; 265     return self._request(route, "POST", params)</p>
<p dir="auto">File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\SmartApi\<a href="http://smartConnect.py:235" target="_blank" rel="noopener noreferrer nofollow ugc">smartConnect.py:235</a>, in SmartConnect._request(self, route, method, parameters)<br />
231     data = json.loads(r.content.decode("utf8"))<br />
234 except ValueError:<br />
--&gt; 235     raise ex.DataException("Couldn't parse the JSON response received from the server: {content}".format(<br />
236         content=r.content))<br />
238 # api error<br />
239 if data.get("error_type"):<br />
240     # Call session hook if its registered and TokenException is raised</p>
<p dir="auto">DataException: Couldn't parse the JSON response received from the server: b''</p>
]]></description><link>https://smartapi.angelone.in/smartapi/forum/topic/5554/unable-to-get-margin-data</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 21:02:20 GMT</lastBuildDate><atom:link href="https://smartapi.angelone.in/smartapi/forum/topic/5554.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Apr 2026 15:50:09 GMT</pubDate><ttl>60</ttl></channel></rss>