Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
A way to get "List of S&P 500 companies"

I think most of the new quantopianers would have such a question, how to get the S&P 500 component stocks.
Quantopian has a buildin Q500, but it is not the same as S&P 500.
I write a function to do it, all the data are from wikipedia.
I don't know how to attach .csv files, so I simply attached them in the notebook.

Only support date after year 2000. (There is no older data in wikipedia)
If you find more free data, please let me know.

2 responses

So a quick hack that might be easier then dealing with fetch_csv, is to use the Q500(), and select the top 500 stocks by market cap. It won't be perfect, but it will be a lot simpler.

You could also look for stocks with non-null prediction from the precog vertex dataset