scheb / yahoo-finance-api

PHP client for Yahoo Finance API 📈
MIT License
280 stars 56 forks source link

Average Volume Getting Wrong Value #28

Closed vedawebtech closed 3 years ago

vedawebtech commented 3 years ago

Hi! Thanks for create a great API. I am using it and its working fine. However I have issue in Average Volume. I am trying to fetch data of https://finance.yahoo.com/quote/SAFE?p=SAFE 1) in web portal average volume showing 106,239 but in our API response, its giving me 107524 I am not getting idea why its happening. Let me know if anyone here can help me about same. 2) in web portal Ex-Dividend Date is Dec 30, 2020 but in our response I am getting [dividendDate:Scheb\YahooFinanceApi\Results\Quote:private] => DateTime Object ( [date] => 2021-01-15 00:00:00.000000 [timezone_type] => 1 [timezone] => +00:00 ) Thanks a lot!

scheb commented 3 years ago

Well, the library is retrieving that data not from the website, but from an API endpoint, this one here: https://query1.finance.yahoo.com/v7/finance/quote?symbols=SAFE

That's the data Yahoo Finance provides, so that's the data you get from the library. I can't tell you why it's showing different data on the website. I'd suspect they have some kind of cache for the website, so it doesn't update so often. Values from the API seem more up-to-date to me.

But anyways, it's not an issue with the library, so nothing I can change about it. Therefore closing this issue.