downloading a company's market cap from yahoo
Asked Answered
N

1

5

I have seen that it is possible to download stock prices from yahoo from python with this project. I was wondering though if it was also possible to download the market cap of a company on a historical basis?

I can't seem to find a function to do such a thing?

Nomothetic answered 21/2, 2019 at 20:40 Comment(1)
would this help? Historical Chart Gallery of Market IndexesTorsion
E
11

For pandas_datareader version 0.7.0+47.g7522f75

data.get_quote_yaho in pandas_datareader will provide most of the current details for stocks. For market cap,

from pandas_datareader import data
tickers = ['AAPL','AMZN','TSLA','GOOG']
data.get_quote_yahoo(tickers)['marketCap']

AAPL    964416176128
AMZN    928656588800
GOOG    869718360064
TSLA     45642039296
Name: marketCap, dtype: int64

it also has the following details:

0 language
1 region
2 quoteType
3 quoteSourceName
4 epsForward
5 currency
6 sharesOutstanding
7 bidSize
8 trailingPE
9 priceToBook
10 dividendDate
11 regularMarketChangePercent
12 market
13 fiftyDayAverageChange
14 forwardPE
15 regularMarketPrice
16 regularMarketTime
17 regularMarketChange
18 regularMarketOpen
19 regularMarketDayHigh
20 regularMarketDayLow
21 regularMarketVolume
22 bookValue
23 ask
24 regularMarketPreviousClose
25 preMarketChangePercent
26 regularMarketDayRange
27 twoHundredDayAverageChange
28 bid
29 fiftyTwoWeekLowChange
30 askSize
31 financialCurrency
32 twoHundredDayAverage
33 gmtOffSetMilliseconds
34 shortName
35 longName
36 preMarketChange
37 twoHundredDayAverageChangePercent
38 trailingAnnualDividendYield
39 exchangeDataDelayedBy
40 fiftyTwoWeekLow
41 fiftyTwoWeekHigh
42 averageDailyVolume3Month
43 fiftyDayAverage
44 exchangeTimezoneShortName
45 esgPopulated
46 marketState
47 marketCap
48 epsTrailingTwelveMonths
49 fullExchangeName
50 earningsTimestampStart
51 earningsTimestampEnd
52 trailingAnnualDividendRate
53 earningsTimestamp
54 fiftyTwoWeekLowChangePercent
55 fiftyTwoWeekHighChangePercent
56 averageDailyVolume10Day
57 exchange
58 priceHint
59 exchangeTimezoneName
60 preMarketTime
61 fiftyDayAverageChangePercent
62 fiftyTwoWeekRange
63 tradeable
64 fiftyTwoWeekHighChange
65 preMarketPrice
66 sourceInterval
67 messageBoardId
68 price
Erdman answered 23/4, 2019 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.