Comments (9)
here is the pull request from yfinance that has fixed the encryption issue - ranaroussi/yfinance#1253
from yahoo_fin.
Just move all your stuff to yfinance, this dev gave up on this project already. The module has not been updated in almost 2 yrs. Since the Yahoo API issue occurred last week, yfinance has already issued out 2 patches to remedy the same issue we are requesting to fix right now.
from yahoo_fin.
Same issue here with for example:
aapl_earnings_hist = si.get_earnings_history("aapl")
from yahoo_fin.
Hi,
Seems that the issue is not related only to some functions.
Seems that is something in the api response that is coming from Yahoo Finance.
Let's take the following example:
- in stock_info.py we are having the following function = get_earnings_history .
With the help of _parse_earnings_json(url)**** we retrive information from Yahoo Finance.
the problem: is in the api response because key = "stores" is somehow encrypted.
In order to figure out if is something related to yahoo_fin (expected to not be since no updates happened) I checked the information in Postman and run an GET URL API:
Seems that Yahoo Fin is starting to encrypt some information (maybe I;m wrong).
from yahoo_fin.
Hi,
Seems that the issue is not related only to some functions.
Seems that is something in the api response that is coming from Yahoo Finance.
Let's take the following example:
- in stock_info.py we are having the following function = get_earnings_history .
With the help of _parse_earnings_json(url)**** we retrive information from Yahoo Finance.
the problem: is in the api response because key = "stores" is somehow encrypted.
In order to figure out if is something related to yahoo_fin (expected to not be since no updates happened) I checked the information in Postman and run an GET URL API:
Seems that Yahoo Fin is starting to encrypt some information (maybe I;m wrong).
If it is because Yahoo Finance encrypts some information, do you know of any user-side solutions?
from yahoo_fin.
Nope, but seems that not only yahoo_fin is having this issue.
Maybe to owner of the project is more familiar than me with the Yahoo Finance flow and with python.
from yahoo_fin.
Ok, so after some research, indeed the issue is coming from the Yahoo API.
I found that also other people that are using other libraries are having the some issues.
I don t know if is fine to specify the library but somehow they succeed to fix it.
The fix relates to the fact that they are decrypting the information with some AES parser & cipher.
I m not familiar to much with python, but in their cases seems to work and I have no idea if this library is still updated or not
from yahoo_fin.
Ok, so after some research, indeed the issue is coming from the Yahoo API.
I found that also other people that are using other libraries are having the some issues.
I don t know if is fine to specify the library but somehow they succeed to fix it.
The fix relates to the fact that they are decrypting the information with some AES parser & cipher.
I m not familiar to much with python, but in their cases seems to work and I have no idea if this library is still updated or not
I am not familiar with AES parser and cypher. Perhaps you could provide the links you referenced that address similar issues.
from yahoo_fin.
here is the pull request from yfinance that has fixed the encryption issue - ranaroussi/yfinance#1253
I was experiencing the issue when calling get_earnings_for_date(). Found a workaround using a snippet of the fix from yfinance.
Below is the workaround for my use case. This is not a proper fix, only posting it here for real developers to come up with a proper fix and update the yahoo_fin project. Until then, this workaround may work for others as well.
- Replace the stock_info.py in your python project (...\Lib\site-packages\yahoo_fin\stock_info.py) with the attached updated version
- Install additional python modules to handle the decryption
import hashlib
from base64 import b64decode
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
"changelog"
- added the import statements above
- added the function decrypt_cryptojs_aes()
- modified get_earnings_for_date()
changed "stores = result['context']['dispatcher']['stores']" to "stores = decrypt_cryptojs_aes(result)"'
from yahoo_fin.
Related Issues (20)
- get_earnings_for_date() Always Fails Now HOT 6
- get_balance_sheet doesn't return any data HOT 3
- Problem in get_earnings_history HOT 2
- How to export data into csv file ? HOT 1
- problem with get_income_data HOT 2
- How to add yahoo_fin to a project in pycharm
- Exceptions since last Yahoo updates HOT 4
- stock_info.tickers_sp500() returning strings of underscores HOT 4
- tickers_sp500() ERROR: ssl.SSLCertVerificationError HOT 1
- get_quote_data() - Invalid response from server HOT 1
- Issue with get_day_gainers() HOT 1
- get_quote_table -> error 'DataFrame' object has no attribute 'append' HOT 2
- OperationalError: unable to open database file
- requests_html error (not installed) HOT 1
- get_expiration_dates returns empty strings instead of dates HOT 11
- get_quote_table not working HOT 2
- get_stats_valuation not working | yahoo finance error?! HOT 1
- get_analysts_info not working
- stock_info.get_holders() not working as expected
- get_market_status() doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yahoo_fin.