I am trying to find an API which will return the current market cap of US stocks for a financial data visualization project, and I haven't had much luck finding anything. Preferably, I'd like to have market cap data for all S&P 500 stocks, though I realize that something like this might not be available and that I may just need to create that list myself with other data.
Has anyone had luck getting market cap data from an API, or is there a relatively simple way that I could calculate the market caps?
I've checked out this old post where someone suggested Yahoo finance and YQL, but the links are unfortunately dead and it appears as though this service is no longer offered.
Thanks for any insight/advice!