Skip to content

JSONDecodeError: Expecting value: line 1 column 1 (char 0) #28

@bjacksonKOps

Description

@bjacksonKOps

Getting the following error when running any eiapy function (Series, Category).

JSONDecodeError Traceback (most recent call last)
in
----> 1 gulf_category = Category(296728).get_info()
2
3 # Find all child series and make a list of them.
4 gulf_childseries = gulf_category['category']['childseries']
5 gulf_series_ids = [i['series_id'] for i in gulf_childseries]

/databricks/python/lib/python3.8/site-packages/eiapy.py in get_info(self)
271 url = 'https://api.eia.gov/category/?api_key={}'.format(API_KEY)
272
--> 273 data = self._fetch(url)
274 return data
275

/databricks/python/lib/python3.8/site-packages/eiapy.py in _fetch(self, url)
262 else:
263 req = s.get(url)
--> 264 json_data = req.json()
265 return json_data
266

/databricks/python/lib/python3.8/site-packages/requests/models.py in json(self, **kwargs)
898 # used.
899 pass
--> 900 return complexjson.loads(self.text, **kwargs)
901
902 @Property

/databricks/python/lib/python3.8/site-packages/simplejson/init.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, use_decimal, **kw)
523 parse_constant is None and object_pairs_hook is None
524 and not use_decimal and not kw):
--> 525 return _default_decoder.decode(s)
526 if cls is None:
527 cls = JSONDecoder

/databricks/python/lib/python3.8/site-packages/simplejson/decoder.py in decode(self, s, _w, _PY3)
368 if _PY3 and isinstance(s, bytes):
369 s = str(s, self.encoding)
--> 370 obj, end = self.raw_decode(s)
371 end = _w(s, end).end()
372 if end != len(s):

/databricks/python/lib/python3.8/site-packages/simplejson/decoder.py in raw_decode(self, s, idx, _w, _PY3)
398 elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
399 idx += 3
--> 400 return self.scan_once(s, idx=_w(s, idx).end())

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions