Comments (9)
I was able to recreate the issue. Going to check to see if the API changed on Yahoo's end.
from yahoofinancials.
Just released v1.19 which includes a fix for this issue.
from yahoofinancials.
@bjosun Are you running a VPN or anything similar? I can't recreate this on my end.
No you do not need to authenticate. It seems the crumb being passed to the url is an empty string.
from yahoofinancials.
@JECSand No i'm not running it on a vpn, running it on a 23.0.0 Darwin Kernel Version 23.0.0 and Python 3.8.0. And the source ip is in Europe. And your right i don't get the crumb with the new url.
from yahoofinancials.
may i add some findings from my side, while having the same issue mentioned above:
YahooFinancials(symbol).get_stock_data() --> this leads to an empty result: {'AAPL': {}, 'dataType': ''}
YahooFinancials(symbol).get_financial_stmts('quarterly', 'balance') --> leads to a proper result
If it would be VPN related, than we should get same response regardless of the function used, or not?
from yahoofinancials.
may i add some findings from my side, while having the same issue mentioned above: YahooFinancials(symbol).get_stock_data() --> this leads to an empty result: {'AAPL': {}, 'dataType': ''} YahooFinancials(symbol).get_financial_stmts('quarterly', 'balance') --> leads to a proper result If it would be VPN related, than we should get same response regardless of the function used, or not?
Yes, same issue here YahooFinancials(symbol).get_financial_stmts('quarterly', 'balance') works as expected.
from yahoofinancials.
may i add some findings from my side, while having the same issue mentioned above: YahooFinancials(symbol).get_stock_data() --> this leads to an empty result: {'AAPL': {}, 'dataType': ''} YahooFinancials(symbol).get_financial_stmts('quarterly', 'balance') --> leads to a proper result If it would be VPN related, than we should get same response regardless of the function used, or not?
get_stock_data() is a method primarily used by other public methods and returns as an empty response when executed without parameters. This is due to how the yahoo finance url is constructed (based on the function inputs).
In short, when you call get_stock_data like this:
yf.get_stock_data(statement_type='profile', tech_type='assetProfile', report_name='assetProfile')
The URL yf will execute will resemble this:
https://query1.finance.yahoo.com/v10/finance/quoteSummary/c?modules=assetProfile&formatted=False&lang=en-US®ion=US&corsDomain=finance.yahoo.com
However if you call the method without params, i.e.
yf.get_stock_data()
The URL generated looks like this:
https://query1.finance.yahoo.com/ws/fundamentals-timeseries/v1/finance/timeseries/c
Since the url has no parameters, yahoo's API returns no data. This method being public is a vestige from the days when we used web scraping to grab the data. Back then executing this function with no parameters would return data.
I can either make this method private or give it parameter defaults that return useful data.
On a different note I have a fix for yahoo_financials.get_key_statistics_data almost ready.
from yahoofinancials.
i can confirm - it is working. thanks for taking the time on it.
from yahoofinancials.
Thanks for taking the time on it. Downloaded the latest version, managed to get the get_key_statistic_data once but now I get the same error:
yahoofinancials.etl.ManagedException: Server replied with server error code, HTTP 401 code while opening the url: https://query1.finance.yahoo.com/v10/finance/quoteSummary/msft?modules=defaultKeyStatistics&formatted=False&lang=en-US®ion=US&corsDomain=finance.yahoo.com
from yahoofinancials.
Related Issues (20)
- KeyError: 'incomeBeforeTax
- Get the last trading hour
- get_stock_earnings_data always fails HOT 8
- Error when running test script HOT 4
- .get_key_statistics_data() http 401 yahoofinancials version 1.19 HOT 2
- get_key_statistic_data: 401 error HOT 2
- Problem with Demo.py HOT 4
- TypeError: can only concatenate str (not "NoneType") to str HOT 2
- get_net_income() provides the Net Income of 9/29/2020 (for AAPL) HOT 1
- get_historical_price_data() end_date HOT 4
- Can't fetch anything HOT 1
- unsupported operand type(s) for -: 'datetime.datetime' and 'str' HOT 5
- sessions.py _get_crumb does not get the crumb, it's empty HOT 6
- not working - get_financial_data() HOT 4
- TypeError: 'NoneType' object is not subscriptable
- Sleeping and retrying for a long time HOT 1
- get_historical_price_data() error HOT 1
- get_summary_data() freezes the application with a delisted stock symbol
- Unable to get any examples working.
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 yahoofinancials.