I'm wondering what API methods there are to determine a company's market cap, i.e. (number of shares issued) * (price per share).
I know IQfeed and perhaps Yahoo will do this - does anyone know of any other API's that will do the job?
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It only takes a minute to sign up.
Sign up to join this communityI know you mentioned that you already know about Yahoo's ability to do this. However, I thought I'd add the following snippet on how to do this with Yahoo. It's a trivial HTTP Get, and is likely the quickest and easiest way to get the information you're after:
> curl "http://download.finance.yahoo.com/d/quotes.csv?s=CSCO&f=j1"
86.991B
That will return a single result with one entry, which is the market cap of the stock you supplied. You can also supply more than one stock:
> curl "http://download.finance.yahoo.com/d/quotes.csv?s=CSCO,AAPL&f=j1"
86.991B
355.9B
See Yahoo Query Language (YQL) blog: Getting stock information with YQL and open data tables.
Go to the YQL console, and use the following query:
select MarketCapitalization from yahoo.finance.quotes where symbol in ("YHOO","AAPL")
Here is key part of the result:
<results>
<quote>
<MarketCapitalization>20.508B</MarketCapitalization>
</quote>
<quote>
<MarketCapitalization>317.5B</MarketCapitalization>
</quote>
</results>
Once you have the result in .xml, its easy to query it using LINQ in C#.
The Zacks API should have this data, see http://www.zacksdata.com/zacks-data-api
(Disclosure: The API is managed by my company)