JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
896 stars 214 forks source link

Financials retrieved very different from the Yahoo Finance site #102

Closed Slepetys closed 1 year ago

Slepetys commented 2 years ago

Hi ! The values retrieved through the module are completely different from what YahooFinance is showing.

from yahoofinancials import YahooFinancials
yahoo_financials = YahooFinancials('ABF.L')
yahoo_financials.get_financial_stmts('annual', 'income')

Resulting in the JSON:

{'incomeStatementHistory': {'ABF.L': [{'2021-09-18': {'researchDevelopment': None,
     'effectOfAccountingCharges': None,
     'incomeBeforeTax': 725000000,
     'minorityInterest': 83000000,
     'netIncome': 478000000,
     'sellingGeneralAdministrative': 2256000000,
     'grossProfit': 3131000000,
     'ebit': 875000000,
     'operatingIncome': 875000000,
     'otherOperatingExpenses': None,
     'interestExpense': -111000000,
     'extraordinaryItems': None,
     'nonRecurring': None,
     'otherItems': None,
     'incomeTaxExpense': 227000000,
     'totalRevenue': 13884000000,
     'totalOperatingExpenses': 13009000000,
     'costOfRevenue': 10753000000,
     'totalOtherIncomeExpenseNet': -150000000,
     'discontinuedOperations': None,
     'netIncomeFromContinuingOps': 498000000,
     'netIncomeApplicableToCommonShares': 478000000}},
   {'2020-09-12': {'researchDevelopment': None,
     'effectOfAccountingCharges': None,
     'incomeBeforeTax': 686000000,
     'minorityInterest': 84000000,
     'netIncome': 455000000,
     'sellingGeneralAdministrative': 2244000000,
     'grossProfit': 3137000000,
     'ebit': 893000000,
     'operatingIncome': 893000000,
     'otherOperatingExpenses': None,
     'interestExpense': -124000000,
     'extraordinaryItems': None,
     'nonRecurring': None,
     'otherItems': None,
     'incomeTaxExpense': 221000000,
     'totalRevenue': 13937000000,
     'totalOperatingExpenses': 13044000000,
     'costOfRevenue': 10800000000,
     'totalOtherIncomeExpenseNet': -207000000,
     'discontinuedOperations': None,
     'netIncomeFromContinuingOps': 465000000,
     'netIncomeApplicableToCommonShares': 455000000}},
   {'2019-09-14': {'researchDevelopment': None,
     'effectOfAccountingCharges': None,
     'incomeBeforeTax': 686000000,
     'minorityInterest': 84000000,
     'netIncome': 0,
     'sellingGeneralAdministrative': 2244000000,
     'grossProfit': 0,
     'ebit': 0,
     'operatingIncome': 893000000,
     'otherOperatingExpenses': None,
     'interestExpense': -124000000,
     'extraordinaryItems': None,
     'nonRecurring': None,
     'otherItems': None,
     'incomeTaxExpense': 0,
     'totalRevenue': 0,
     'totalOperatingExpenses': 0,
     'costOfRevenue': 0,
     'totalOtherIncomeExpenseNet': 0,
     'discontinuedOperations': None,
     'netIncomeFromContinuingOps': 465000000,
     'netIncomeApplicableToCommonShares': 455000000}},
   {'2019-09-14': {'researchDevelopment': None,
     'effectOfAccountingCharges': None,
     'incomeBeforeTax': 1173000000,
     'minorityInterest': 98000000,
     'netIncome': 878000000,
     'sellingGeneralAdministrative': 2324000000,
     'grossProfit': 3637000000,
     'ebit': 1313000000,
     'operatingIncome': 1313000000,
     'otherOperatingExpenses': None,
     'interestExpense': -42000000,
     'extraordinaryItems': None,
     'nonRecurring': None,
     'otherItems': None,
     'incomeTaxExpense': 277000000,
     'totalRevenue': 15824000000,
     'totalOperatingExpenses': 14511000000,
     'costOfRevenue': 12187000000,
     'totalOtherIncomeExpenseNet': -140000000,
     'discontinuedOperations': None,
     'netIncomeFromContinuingOps': 896000000,
     'netIncomeApplicableToCommonShares': 878000000}}]}}

Reference dates showed in the results:

But, in Yahoo Finance (https://finance.yahoo.com/quote/ABF.L/financials?p=ABF.L) for the same ticker at the same time, the periods, values and rows are very different:

image

Any clue what is happening ?

Thank you

gwaitsi commented 1 year ago

i got exactly the same issue with BHP.AX

JECSand commented 1 year ago

@gwaitsi and @Slepetys Could I ask which countries you are executing the code from? I have some theories on this, but am trying to narrow them down. For me (executing from the US), the numbers match.

Also can you confirm that this is still an issue with v1.9? I added country specification to the URLs, which may alleviate this issue.

RafiAIProj commented 10 months ago

I get the same issue repeatedly

Results are: {'VYGR': [{'2022-06-30': {'totalRevenue': 712000.0, 'operatingIncome': -19367000.0, 'otherGandA': 7552000.0, 'researchAndDevelopment': 12527000.0, 'otherIncomeExpense': 61000.0, 'dilutedEPS': -0.5, 'netIncome': -19087000.0, 'netIncomeContinuousOperations': -19087000.0, 'taxEffectOfUnusualItems': 0.0, 'sellingGeneralAndAdministration': 7552000.0, 'operatingRevenue': 712000.0, 'dilutedNIAvailtoComStockholders': -19087000.0, 'operatingExpense': 20079000.0, 'pretaxIncome': -19087000.0, 'netNonOperatingInterestIncomeExpense': 219000.0, 'dilutedAverageShares': 38298426.0, 'taxRateForCalcs': 0.0, 'otherNonOperatingIncomeExpenses': 61000.0, 'interestIncomeNonOperating': 219000.0, 'netInterestIncome': 219000.0, 'ebit': -19367000.0, 'reconciledDepreciation': 1204000.0, 'basicAverageShares': 38298426.0, 'basicEPS': -0.5, 'normalizedIncome': -19087000.0, 'interestIncome': 219000.0, 'netIncomeFromContinuingAndDiscontinuedOperation': -19087000.0, 'totalExpenses': 20079000.0, 'netIncomeFromContinuingOperationNetMinorityInterest': -19087000.0, 'netIncomeCommonStockholders': -19087000.0, 'totalOperatingIncomeAsReported': -19367000.0, 'netIncomeIncludingNoncontrollingInterests': -19087000.0, 'normalizedEBITDA': -18163000.0, 'generalAndAdministrativeExpense': 7552000.0}}, {'2022-09-30': {'totalRevenue': 41086000.0, 'operatingIncome': 14442000.0, 'otherGandA': 7307000.0, 'researchAndDevelopment': 19337000.0, 'otherIncomeExpense': 2637000.0, 'dilutedEPS': 0.45, 'netIncome': 17624000.0, 'netIncomeContinuousOperations': 17624000.0, 'taxEffectOfUnusualItems': 0.0, 'sellingGeneralAndAdministration': 7307000.0, 'operatingRevenue': 41086000.0, 'dilutedNIAvailtoComStockholders': 17624000.0, 'operatingExpense': 26644000.0, 'pretaxIncome': 17624000.0, 'netNonOperatingInterestIncomeExpense': 545000.0, 'dilutedAverageShares': 39570394.0, 'taxRateForCalcs': 0.4, 'otherNonOperatingIncomeExpenses': 2637000.0, 'interestIncomeNonOperating': 545000.0, 'netInterestIncome': 545000.0, 'ebit': 14442000.0, 'reconciledDepreciation': 1341000.0, 'basicAverageShares': 38507542.0, 'basicEPS': 0.46, 'normalizedIncome': 17624000.0, 'interestIncome': 545000.0, 'netIncomeFromContinuingAndDiscontinuedOperation': 17624000.0, 'totalExpenses': 26644000.0, 'netIncomeFromContinuingOperationNetMinorityInterest': 17624000.0, 'netIncomeCommonStockholders': 17624000.0, 'totalOperatingIncomeAsReported': 14442000.0, 'netIncomeIncludingNoncontrollingInterests': 17624000.0, 'normalizedEBITDA': 15783000.0, 'generalAndAdministrativeExpense': 7307000.0}}, {'2022-12-31': {'totalRevenue': 40907000.0, 'operatingRevenue': -1550000.0, 'operatingIncome': -50837000.0, 'otherGandA': 30980000.0, 'netIncomeContinuousOperations': -23626000.0, 'researchAndDevelopment': 60764000.0, 'otherIncomeExpense': 2653000.0, 'totalOperatingIncomeAsReported': -24563000.0, 'dilutedEPS': -0.61, 'reconciledDepreciation': 834000.0, 'netIncomeFromContinuingOperationNetMinorityInterest': -23626000.0, 'normalizedEBITDA': -24563000.0, 'netIncomeIncludingNoncontrollingInterests': -23626000.0, 'netIncome': -46408000.0, 'taxEffectOfUnusualItems': 0.0, 'sellingGeneralAndAdministration': 30980000.0, 'otherNonOperatingIncomeExpenses': 953000.0, 'operatingExpense': 23013000.0, 'dilutedNIAvailtoComStockholders': -46408000.0, 'pretaxIncome': -46392000.0, 'netNonOperatingInterestIncomeExpense': 1792000.0, 'taxProvision': 16000.0, 'normalizedIncome': -23626000.0, 'dilutedAverageShares': 38549749.0, 'netIncomeCommonStockholders': -23626000.0, 'taxRateForCalcs': 0.4, 'totalExpenses': 23013000.0, 'ebit': -24563000.0, 'netInterestIncome': 1792000.0, 'eBITDA': -44646000.0, 'basicAverageShares': 38549749.0, 'basicEPS': -0.61, 'netIncomeFromContinuingAndDiscontinuedOperation': -23626000.0, 'totalOtherFinanceCost': -1792000.0, 'generalAndAdministrativeExpense': 30980000.0}}, {'2023-03-31': {'totalRevenue': 190729000.0, 'operatingRevenue': 150480000.0, 'operatingIncome': 93397000.0, 'otherGandA': 32349000.0, 'netIncomeContinuousOperations': 124044000.0, 'researchAndDevelopment': 64983000.0, 'totalOperatingIncomeAsReported': 122884000.0, 'dilutedEPS': 2.94, 'reconciledDepreciation': 1075000.0, 'netIncomeFromContinuingOperationNetMinorityInterest': 124044000.0, 'normalizedEBITDA': 122884000.0, 'netIncomeIncludingNoncontrollingInterests': 124044000.0, 'netIncome': 98955000.0, 'taxEffectOfUnusualItems': 0.0, 'sellingGeneralAndAdministration': 32349000.0, 'operatingExpense': 27596000.0, 'dilutedNIAvailtoComStockholders': 98955000.0, 'pretaxIncome': 99675000.0, 'netNonOperatingInterestIncomeExpense': 3625000.0, 'taxProvision': 720000.0, 'normalizedIncome': 124044000.0, 'dilutedAverageShares': 42161326.0, 'netIncomeCommonStockholders': 124044000.0, 'taxRateForCalcs': 0.007223, 'totalExpenses': 27596000.0, 'ebit': 122884000.0, 'interestIncomeNonOperating': 1864000.0, 'netInterestIncome': 3625000.0, 'eBITDA': 97851000.0, 'basicAverageShares': 40632087.0, 'basicEPS': 3.05, 'netIncomeFromContinuingAndDiscontinuedOperation': 124044000.0, 'interestIncome': 1864000.0, 'generalAndAdministrativeExpense': 32349000.0}}, {'2023-06-30': {'totalRevenue': 194869000.0, 'operatingRevenue': 4853000.0, 'operatingIncome': 87337000.0, 'otherGandA': 33091000.0, 'netIncomeContinuousOperations': -22208000.0, 'researchAndDevelopment': 74441000.0, 'otherIncomeExpense': 2617000.0, 'totalOperatingIncomeAsReported': -25426000.0, 'dilutedEPS': -0.51, 'reconciledDepreciation': 1086000.0, 'netIncomeFromContinuingOperationNetMinorityInterest': -22208000.0, 'normalizedEBITDA': -24340000.0, 'netIncomeIncludingNoncontrollingInterests': -22208000.0, 'netIncome': 95834000.0, 'taxEffectOfUnusualItems': 0.0, 'sellingGeneralAndAdministration': 33091000.0, 'otherNonOperatingIncomeExpenses': 3000.0, 'operatingExpense': 30279000.0, 'dilutedNIAvailtoComStockholders': 95834000.0, 'pretaxIncome': 96613000.0, 'netNonOperatingInterestIncomeExpense': 6659000.0, 'taxProvision': 779000.0, 'normalizedIncome': -22208000.0, 'dilutedAverageShares': 43520137.0, 'netIncomeCommonStockholders': -22208000.0, 'taxRateForCalcs': 0.008063, 'totalExpenses': 30279000.0, 'ebit': -25426000.0, 'interestIncomeNonOperating': 3274000.0, 'netInterestIncome': 6659000.0, 'eBITDA': 91673000.0, 'basicAverageShares': 43520137.0, 'basicEPS': -0.51, 'netIncomeFromContinuingAndDiscontinuedOperation': -22208000.0, 'interestIncome': 3274000.0, 'generalAndAdministrativeExpense': 33091000.0}}]}

While Yahoo web shows: image

I execute the code in Israel, but the issue appears also when i use a VPN through a US server