When I try to retrieve data using the Pyhon API, I get a JSONDecodeError. I am using Python 3.8.5 (64-bit) on Windows 10 and version 1.1.6.post3 of the eikon package. The same code worked fine, i.e. produced the expected results, a couple of months ago. I updated the eikon package after I got the error message. But this did not resolve the problem.
The following request
ek.get_timeseries('.STOXX50E', start_date='2018-10-01', end_date='2020-09-30')
now produces this error message:
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-9-99d1fe36af3b> in <module>
----> 1 df_eurostoxx = ek.get_timeseries('.STOXX50E', start_date='2018-10-01', end_date='2020-09-30')
c:\users\dietmar\venv\python38_finance\lib\site-packages\eikon\time_series.py in get_timeseries(rics, fields, start_date, end_date, interval, count, calendar, corax, normalize, raw_output, debug)
180 raise ValueError(error_msg)
181 --> 182 ts_result = eikon.json_requests.send_json_request(TimeSeries_UDF_endpoint, payload, debug=debug)
183 184 # Catch all errors to raise a warning
c:\users\dietmar\venv\python38_finance\lib\site-packages\eikon\json_requests.py in send_json_request(entity, payload, debug)
99 100 if response.status_code == 200:
--> 101 result = response.json()
102 logger.trace('Response size: {}'.format(sys.getsizeof(json.dumps(result))))
103
c:\users\dietmar\venv\python38_finance\lib\site-packages\httpx\_models.py in json(self, **kwargs)
1081 except UnicodeDecodeError:
1082 pass
-> 1083 return jsonlib.loads(self.text, **kwargs)
1084 1085 @property
C:\Program Files\Python38\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
355 parse_int is None and parse_float is None and
356 parse_constant is None and object_pairs_hook is None and not kw):
--> 357 return _default_decoder.decode(s)
358 if cls is None:
359 cls = JSONDecoder
C:\Program Files\Python38\lib\json\decoder.py in decode(self, s, _w)
335 336 """
--> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
338 end = _w(s, end).end()
339 if end != len(s):
C:\Program Files\Python38\lib\json\decoder.py in raw_decode(self, s, idx)
353 obj, end = self.scan_once(s, idx)
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 3 column 1 (char 4)