Skip to content

JSON decode Error #6

Description

@nectario

When I call:
result = ondemand.history("AAPL", "minutes", interval=60, maxRecords=100)

I am getting this error:

`Barchart OnDemand Client: https://ondemand.websol.barchart.com/service?wsdl
Traceback (most recent call last):
File "C:\Development\Python\Python376\lib\site-packages\ondemand\ondemand_client.py", line 58, in do_call
result = resp.json()
File "C:\Development\Python\Python376\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Development\Python\Python376\lib\json_init
.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Development\Python\Python376\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Development\Python\Python376\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Development/Projects/DeepTradingAI/DJIAHistorical.py", line 57, in
data = djia_historical.get_historical_stock_prices("AAPL")
File "C:/Development/Projects/DeepTradingAI/DJIAHistorical.py", line 17, in get_historical_stock_prices
result = ondemand.history("AAPL", "minutes", interval=60, maxRecords=1000)
File "C:\Development\Python\Python376\lib\site-packages\ondemand\ondemand_client.py", line 121, in history
return self._do_call(self.endpoint + 'getHistory.json', kwargs)
File "C:\Development\Python\Python376\lib\site-packages\ondemand\ondemand_client.py", line 61, in _do_call
'Failed to parse JSON response %s. Resp Code: %s. Text: %s' % (e, resp.status_code, resp.text))
ondemand.ondemand_client.OnDemandError: Failed to parse JSON response Expecting value: line 1 column 1 (char 0). Resp Code: 200. Text:
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions