0

I am looking for some way to get index ticker lists. I'd like an up to date source and a practical way to get data. Exemple for sp500 I currently use:

import pandas as pd
import numpy as np

sp500 = pd.read_html('https://en.wikipedia.org/wiki/List_of_S%26P_500_companies') sp500_list = np.array(sp500[0]['Symbol'])

I am not entirely happy with this solution as wikipedia might not be entirely up to date, the thing to scrap depend on the index (for cac40 we need to scrap the second or third table in the page) and the pipeline depend on the read_html pandas function. I'd like something a bit more polished, with additional indices. Know something that could do the job ?

Lucas Morin
  • 140
  • 1
  • 5

1 Answers1

1

In general you will have a tough time finding constituents, let alone for free, let alone open. You might want to check the primary source, i.e. the website of the index provider like https://www.spglobal.com/spdji/en/indices/equity/sp-500/.

There's also resellers, like https://www.quantrocket.com/data/?filter=sharadar. Of course the big shops (Bloomberg, Refinitiv, Factset) cover index constituents, too.

Most of the indices are cap-weighted with a fixed schedule and rules of entries and exits. If you try and apply these you will see rather quickly why this is high maintenance data.

hroptatyr
  • 246
  • 1
  • 6