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

JSONDecodeError: Expecting value: line 1 column 1 (char 0) al intentar descargar datos de Yahoo Finance #783

Closed
akitxu opened this issue Jul 15, 2021 · 15 comments

Comments

@akitxu
Copy link

akitxu commented Jul 15, 2021

I have python 3.8.10 and yfinance 0.1.63 installed. I try to import quotes of a value and it returns the error

JSONDecodeError: Expecting value: line 1 column 1 (char 0) when trying to download data from Yahoo Finance

How can i solve this problem. I will appreciate help

@DivyanshP2020
Copy link

I am facing the same error right now.

@brianhaines
Copy link

brianhaines commented Jul 15, 2021

I am also facing this issue. The response from the api request session.get is 'Forbidden'

@brianhaines
Copy link

Resolved after updating. Run this:
pip install yfinance --upgrade --no-cache-dir

@bowling-knight
Copy link

Great tip @brianhaines, thanks a lot for sharing!

@guccipepito
Copy link

mvp

@sanjkm
Copy link

sanjkm commented Jul 18, 2021

Thanks @brianhaines !

@hansiniupadhyay
Copy link

Still getting this error:

Exception in thread Thread-212:
Traceback (most recent call last):
File "C:\Users\aashi\anaconda3\lib\threading.py", line 932, in _bootstrap_inner
self.run()
File "C:\Users\aashi\anaconda3\lib\threading.py", line 870, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\aashi\anaconda3\lib\site-packages\multitasking_init
.py", line 102, in _run_via_pool
return callee(*args, **kwargs)
File "C:\Users\aashi\anaconda3\lib\site-packages\yfinance\multi.py", line 169, in _download_one_threaded
data = _download_one(ticker, start, end, auto_adjust, back_adjust,
File "C:\Users\aashi\anaconda3\lib\site-packages\yfinance\multi.py", line 184, in download_one
return Ticker(ticker).history(period=period, interval=interval,
File "C:\Users\aashi\anaconda3\lib\site-packages\yfinance\base.py", line 162, in history
data = data.json()
File "C:\Users\aashi\anaconda3\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\aashi\anaconda3\lib\json_init
.py", line 357, in loads
return _default_decoder.decode(s)
File "C:\Users\aashi\anaconda3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\aashi\anaconda3\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)

Any help is appreciated ....

@akitxu
Copy link
Author

akitxu commented Jul 19, 2021

I recommend seeing this link
https://es.stackoverflow.com/questions/469043/ya-no-es-posible-acceder-a-yahoo-finanzas

@parkheedo
Copy link

I am still having the JSON error after the upgrade. Please help!

@super6liu
Copy link

Adding requests_cache session cache worked for me.

@hansiniupadhyay
Copy link

@super6liu Can you please share your code that you have added ?

@byteatwork
Copy link

Besides upgrade to the latest version of yfinance. You can also consider upgrade library requests to the latest where there is a fix on this particular error message [https://github.com/psf/requests/pull/5856]

@milkywade
Copy link

milkywade commented Aug 5, 2021

still having JSON errors after updating to yfinance-0.1.63

#764 (comment)

@FlynnMa
Copy link

FlynnMa commented Nov 3, 2021

I got this error on 0.1.64

@steveberdy
Copy link

Besides upgrade to the latest version of yfinance. You can also consider upgrade library requests to the latest where there is a fix on this particular error message [https://github.com/psf/requests/pull/5856]

That code was recently released in the Requests 2.27.0 release. The latest version is 2.27.1 as of now. Perhaps updating Requests would solve this.

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