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

Problems with getting news data #1054

Closed
ming-afk opened this issue Aug 28, 2022 · 5 comments
Closed

Problems with getting news data #1054

ming-afk opened this issue Aug 28, 2022 · 5 comments

Comments

@ming-afk
Copy link

Hello yfinance community,

Thanks for checking. Rather than an issue, my post is more like a consultation. First of all, thank you for bringing us yfinance to analyze financial data. It is been used heavily in my team to extract stock data and perform asset allocation.

Recently, we started a task on analyzing stock-specific news sentiments, which requires us to get news articles from Yahoo Finance. We noticed that the yahoofinance api consistently returns 8 news articles by investigating the Ticker().get_news() method. However, we have no idea based on what criteria were the 8 articles retrieve. This is important to us as by manually checking these articles, we find some news are very relevant, while others only touch on the ticker we are looking at.

If this is out of the scope of this community, could you point me to some resources where I can learn about the implementation or behaviors of the yahoofinance api? Thank you

@ValueRaider
Copy link
Collaborator

This appears to be the original PR, give it a read: #837

You may have to get someone on team to experiment with query URL parameters then submit a fix/improvement.

@ming-afk
Copy link
Author

ming-afk commented Aug 29, 2022

Hello @ValueRaider . Thanks for the reply. But I'm actually wondering how does yfinance api give the relevant news, not how the crawler in yfinance process the query. I also noticed the order of results I got on yahoo website is different from that with their api, so I guess their search engine does not rank the results specifically. I know this is not related to what yfinance is doing, that's also why I asked if there are other resources I can look to. Tks

@ValueRaider
Copy link
Collaborator

ValueRaider commented Aug 29, 2022

@ming-afk That link describes the parameters available on the API. yfinance does not crawl nor process. get_news() is basically just a web request.

No official Yahoo API documentation unfortunately, everything in yfinance was coded by reverse-engineering website - clicking buttons, intercepting requests, experimenting with parameters.

@ming-afk
Copy link
Author

I see. Well thank you so much. These information are valuable. I indeed learned something from this.

@ValueRaider
Copy link
Collaborator

Next time inspect the source code first.

@ValueRaider ValueRaider closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2022
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

2 participants