Coder Social home page Coder Social logo

Comments (9)

JECSand avatar JECSand commented on June 12, 2024 2

I was able to recreate the issue. Going to check to see if the API changed on Yahoo's end.

from yahoofinancials.

JECSand avatar JECSand commented on June 12, 2024 1

Just released v1.19 which includes a fix for this issue.

from yahoofinancials.

JECSand avatar JECSand commented on June 12, 2024

@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.

bjosun avatar bjosun commented on June 12, 2024

@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.

daniel-fcm avatar daniel-fcm commented on June 12, 2024

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.

bjosun avatar bjosun commented on June 12, 2024

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.

JECSand avatar JECSand commented on June 12, 2024

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&region=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.

daniel-fcm avatar daniel-fcm commented on June 12, 2024

i can confirm - it is working. thanks for taking the time on it.

from yahoofinancials.

bjosun avatar bjosun commented on June 12, 2024

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&region=US&corsDomain=finance.yahoo.com

from yahoofinancials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.