Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON decode Error #6

Open
nectario opened this issue Mar 3, 2020 · 1 comment
Open

JSON decode Error #6

nectario opened this issue Mar 3, 2020 · 1 comment

Comments

@nectario
Copy link

nectario commented Mar 3, 2020

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:
`

@mvberg
Copy link
Member

mvberg commented Nov 7, 2020

sorry for the late reply @nectario

the proper end_point is: https://ondemand.websol.barchart.com/ or for the free/sandbox api it's: https://marketdata.websol.barchart.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants