atreadw1492 / yahoo_fin

Scrape stock price history from new (Spring 2017) Yahoo Finance layout
MIT License
286 stars 125 forks source link

get_balance_sheet() does not return "Invested Capital" #30

Closed cdumez closed 3 years ago

cdumez commented 3 years ago

get_balance_sheet() does not return "Invested Capital", even though it is present on Yahoo Finance.

For example, for AAPL:

>>> si.get_balance_sheet("AAPL")
endDate                    2020-09-26    2019-09-28    2018-09-29    2017-09-30
Breakdown                                                                      
totalLiab                258549000000  248028000000  258578000000  241272000000
totalStockholderEquity    65339000000   90488000000  107147000000  134047000000
otherCurrentLiab          47867000000   43242000000   39293000000   38099000000
totalAssets              323888000000  338516000000  365725000000  375319000000
commonStock               50779000000   45174000000   40201000000   35867000000
otherCurrentAssets        11264000000   12352000000   12087000000   13936000000
retainedEarnings          14966000000   45898000000   70400000000   98330000000
otherLiab                 46108000000   50503000000   48914000000   43251000000
treasuryStock              -406000000    -584000000   -3454000000    -150000000
otherAssets               33952000000   32978000000   22283000000   18177000000
cash                      38016000000   48844000000   25913000000   20289000000
totalCurrentLiabilities  105392000000  105718000000  115929000000  100814000000
shortLongTermDebt          8773000000   10260000000    8784000000    6496000000
otherStockholderEquity     -406000000    -584000000   -3454000000    -150000000
propertyPlantEquipment    45336000000   37378000000   41304000000   33783000000
totalCurrentAssets       143713000000  162819000000  131339000000  128645000000
longTermInvestments      100887000000  105341000000  170799000000  194714000000
netTangibleAssets         65339000000   90488000000  107147000000  134047000000
shortTermInvestments      52927000000   51713000000   40388000000   53892000000
netReceivables            37445000000   45804000000   48995000000   35673000000
longTermDebt              98667000000   91807000000   93735000000   97207000000
inventory                  4061000000    4106000000    3956000000    4855000000
accountsPayable           42296000000   46236000000   55888000000   44242000000

But on Yahoo Finance:

Breakdown   9/30/2020 9/30/2019 9/30/2018 9/30/2017
Total Assets    323,888,000 338,516,000 365,725,000 375,319,000
Total Liabilities Net Minority Interest 258,549,000 248,028,000 258,578,000 241,272,000
Total Equity Gross Minority Interest    65,339,000  90,488,000  107,147,000 134,047,000
Total Capitalization    164,006,000 182,295,000 200,882,000 231,254,000
Common Stock Equity 65,339,000  90,488,000  107,147,000 134,047,000
Net Tangible Assets 65,339,000  90,488,000  107,147,000 126,032,000
Working Capital 38,321,000  57,101,000  14,473,000  27,831,000
Invested Capital    177,775,000 198,535,000 221,630,000 249,727,000
Tangible Book Value 65,339,000  90,488,000  107,147,000 126,032,000
Total Debt  112,436,000 108,047,000 114,483,000 115,680,000
Net Debt    74,420,000  59,203,000  88,570,000  95,391,000
Share Issued    16,976,763  17,772,944  19,019,944  20,504,804
Ordinary Shares Number  16,976,763  17,772,944  19,019,944  20,504,804
atreadw1492 commented 3 years ago

This seems to be a restriction from Yahoo Finance's API at the moment. If there's a workaround, I'll update the package in the future with this.