We get quite a few questions about marketcap. We provide that data going back to 2008 for US securities. If you want to access that data through the API, here is a great tutorial walking you through the web API.
If you want to work with Excel, here is the tutorial for the Excel add in:
In the API, a historical marketcap call would look like this:
To get the current marketcap, you would use this:
In Excel, historical marketcap:
=IntrinioHistoricalData("AAPL", "marketcap", 2, "2009-01-01", "2011-01-01")
Or, the most recent marketcap in Excel: