Closed giraygokirmak closed 6 years ago
Hello,
Could you update to 3.4.4
and see if this issue still occurs? Additionally, which specific version of python 3.5 are you using?
I'm having the same problem on 3.4.4 with Python 3.5.2 and 3.6.7 versions with the code example below: import quandl quandl.ApiConfig.api_key = '***' data = quandl.get("FRED/GDP")
I've attempted to make that same call using both Python 3.5.2 and Python 3.6.7 in addition to making the request using the api_key associated with the Quandl account linked to the email visible on your github profile page and I get successful responses.
I finally figured out the problem, it seems like my server's ip is banned by cloudflare somehow (probably all subnet is banned because of some stupid abuser) I debugged the request and saw that i'm acutally receiving this: "
data = quandl.get("FRED/GDP") print(data.head()) With correct api key (already renewed api key and checked with curl the same request as https://www.quandl.com/api/v3/datasets/FRED/GDP/data.json?api_key=XXXXXXXXXX and it returns correct formatted json) but Quandl 3.4.3 does return:
JSONDecodeError Traceback (most recent call last) /usr/local/lib/python3.5/dist-packages/quandl/connection.py in parse(cls, response) 54 try: ---> 55 return response.json() 56 except ValueError:
/usr/local/lib/python3.5/dist-packages/requests/models.py in json(self, kwargs) 895 pass --> 896 return complexjson.loads(self.text, kwargs) 897
/usr/lib/python3.5/json/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 318 parse_constant is None and object_pairs_hook is None and not kw): --> 319 return _default_decoder.decode(s) 320 if cls is None:
/usr/lib/python3.5/json/decoder.py in decode(self, s, _w) 338 """ --> 339 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 340 end = _w(s, end).end()
/usr/lib/python3.5/json/decoder.py in raw_decode(self, s, idx) 356 except StopIteration as err: --> 357 raise JSONDecodeError("Expecting value", s, err.value) from None 358 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
QuandlError Traceback (most recent call last)