investpy icon indicating copy to clipboard operation
investpy copied to clipboard

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1) when trying to get economic calendar.

Open Turum opened this issue 2 years ago • 2 comments

Hi, Could you please check, getting "raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 2 (char 1)" error when trying to get economic calendar. It falled on this string req = requests.post(url, headers=headers, data=data) root = fromstring(req.json()["data"]) May be I'm using it incorrectly, or investing stopped responded in xml format?

Turum avatar Sep 19 '22 16:09 Turum

I am also having this problem, example code:

import investpy

data = investpy.economic_calendar( from_date = '13/10/2022', to_date = '24/10/2022', importances = ['high'], countries = ['united states', 'euro zone'] ) print(data.head(100))

Error message: requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0).

Used to work fine. Maybe it has to do with investing.com adding cloudflare and/or changing their API?

mscharstrom avatar Oct 13 '22 06:10 mscharstrom

I am also facing same problem investpy.economic_calendar(time_zone = "GMT", countries = ["United States"], importances = ['high','medium','low'],from_date= get_exogs_from, to_date = get_exog_to) with error as follows

Expecting value: line 1 column 1 (char 0)

varshasahasrabuddhe avatar Oct 21 '22 18:10 varshasahasrabuddhe