Up until now I have been using the yahoo finance api which provides lots of data already that I can use for my analysis. Unfortunately I need the historical number of outstanding shares for multiple calculations including the historical market capitalization. Useful would also be the bid ask spread but that is not the focus here. I am writing my project in python and ideally want to pass a function the stock symbols. Using the stock symbols, the function would return the monthly market capitalizations reaching as far back as 2013

I have tried via the yahoo finance api but that only provides the current markt cap. Haven't found solutions via alpha vantage either and want to avoid paying for access. University Databases don't seem to provide the necessary information and are slow to access.

If any of you have some experience in that area, help would be greatly appreciated.

Thanks a lot :)


1 Answer 1


If you are at a University you likely have access to CRSP. CRSP is very fast to access and has the information you need. See a list of variables below.

You have bid, ask and if you multiply the variables prc and shrout you get market caps.

You can do this for all US stocks at once. It's pretty straightforward.

enter image description here

  • $\begingroup$ thanks for your answer, but unfortunately only master students get access to that... I now got the data from an employee of the university. Still ineresting to see if I could have gotten it elsewhere without paying for Tiingo or Quandl $\endgroup$
    – Valentin
    Commented Aug 10, 2023 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.