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

No results #128

Closed trexthemullaman closed 1 year ago

trexthemullaman commented 1 year ago

Running the following, simple: from yahoofinancials import YahooFinancials

tech_stocks = ['AAPL', 'MSFT', 'INTC'] bank_stocks = ['WFC', 'BAC', 'C']

yahoo_financials_tech = YahooFinancials(tech_stocks)

yahoo_financials_banks = YahooFinancials(bank_stocks)

banks_net_ebit = yahoo_financials_banks.get_ebit()

print(yahoo_financials_tech) print(yahoo_financials_banks) print(banks_net_ebit)

Results are: <yahoofinancials.yf.YahooFinancials object at 0x7fc6a02c5070> <yahoofinancials.yf.YahooFinancials object at 0x7fc6a02db040> {'WFC': 0, 'BAC': 0, 'C': 0}

JECSand commented 1 year ago

@trexthemullaman Going to attempt recreating this issue now.

JECSand commented 1 year ago

@trexthemullaman I'm able to replicate. I'll look into this, my initial suspicions are that Yahoo: 1) Paywalled this info 2) Divide up their encrypted data store 3) Changed the labels of some of the records in the data store.

I'll post again when I know more.

JECSand commented 1 year ago

@trexthemullaman Yahoo Finance is now returning an ebit value of 0 unfortunately.

For now you can use this function to get data from any of the fields below:

out = self._financial_statement_data('income', 'incomeStatementHistory', 'ebit', 'annual')

where the field key can be referenced in place of 'ebit'.

Example data response from Citigroup: {'C': [{'2022-12-31': {'researchDevelopment': None, 'effectOfAccountingCharges': None, 'incomeBeforeTax': 18807000000, 'minorityInterest': 649000000, 'netIncome': 14845000000, 'sellingGeneralAdministrative': 39118000000, 'grossProfit': 70560000000, 'ebit': 0, 'operatingIncome': 18807000000, 'otherOperatingExpenses': 12635000000, 'interestExpense': None, 'extraordinaryItems': None, 'nonRecurring': None, 'otherItems': None, 'incomeTaxExpense': 3642000000, 'totalRevenue': 70560000000, 'totalOperatingExpenses': 51753000000, 'costOfRevenue': 0, 'totalOtherIncomeExpenseNet': 0, 'discontinuedOperations': -231000000, 'netIncomeFromContinuingOps': 15165000000, 'netIncomeApplicableToCommonShares': 13465000000}}, {'2021-12-31': {'researchDevelopment': None, 'effectOfAccountingCharges': None, 'incomeBeforeTax': 27469000000, 'minorityInterest': 700000000, 'netIncome': 21952000000, 'sellingGeneralAdministrative': 36766000000, 'grossProfit': 74990000000, 'ebit': 0, 'operatingIncome': 27469000000, 'otherOperatingExpenses': 10755000000, 'interestExpense': None, 'extraordinaryItems': None, 'nonRecurring': None, 'otherItems': None, 'incomeTaxExpense': 5451000000, 'totalRevenue': 74990000000, 'totalOperatingExpenses': 47521000000, 'costOfRevenue': 0, 'totalOtherIncomeExpenseNet': 0, 'discontinuedOperations': 7000000, 'netIncomeFromContinuingOps': 22018000000, 'netIncomeApplicableToCommonShares': 20758000000}}, {'2020-12-31': {'researchDevelopment': None, 'effectOfAccountingCharges': None, 'incomeBeforeTax': 13632000000, 'minorityInterest': 758000000, 'netIncome': 11047000000, 'sellingGeneralAdministrative': 33147000000, 'grossProfit': 59572000000, 'ebit': 0, 'operatingIncome': 13632000000, 'otherOperatingExpenses': 12793000000, 'interestExpense': None, 'extraordinaryItems': None, 'nonRecurring': None, 'otherItems': None, 'incomeTaxExpense': 2525000000, 'totalRevenue': 59572000000, 'totalOperatingExpenses': 45940000000, 'costOfRevenue': 0, 'totalOtherIncomeExpenseNet': 0, 'discontinuedOperations': -20000000, 'netIncomeFromContinuingOps': 11107000000, 'netIncomeApplicableToCommonShares': 9879000000}}, {'2019-12-31': {'researchDevelopment': None, 'effectOfAccountingCharges': None, 'incomeBeforeTax': 23901000000, 'minorityInterest': 704000000, 'netIncome': 19401000000, 'sellingGeneralAdministrative': 32354000000, 'grossProfit': 66849000000, 'ebit': 0, 'operatingIncome': 23901000000, 'otherOperatingExpenses': 10594000000, 'interestExpense': None, 'extraordinaryItems': None, 'nonRecurring': None, 'otherItems': None, 'incomeTaxExpense': 4430000000, 'totalRevenue': 66849000000, 'totalOperatingExpenses': 42948000000, 'costOfRevenue': 0, 'totalOtherIncomeExpenseNet': 0, 'discontinuedOperations': -4000000, 'netIncomeFromContinuingOps': 19471000000, 'netIncomeApplicableToCommonShares': 18171000000}}]}

JECSand commented 1 year ago

@trexthemullaman This issue has been resolved with v1.13. We are able to get ebit data again. Let me know if you keep having issues.