Can we download an ETF universe with the API?

Hi all (and P123 folks)

Has anyone downloaded ETF data? I would like to get things like the ETF prices and such for reference with future machine learning projects. However, when I specify an ETF universe to download in the wrapper I get an error that it does not exist.


Hi Jonpaul. Which API endpoint are you using? Below is some code that user data_universe and it ran with no issues. Make sure you have the “type”: “ETF” line.

    data = client.data_universe(
            "universe": 'All ETFs',
            "asOfDt": "2023-08-25",
            # Optional parameters
            "precision": 2,
            "type": "ETF",
            "includeNames": False,
            "currency": "USD",
            'formulas': ['close(0)','Mktcap']
        }, True)  #True to output to dataframe

I’ve tried it for the /rank/ranks endpoint but the type parameter is not supported, so I cannot get it to work for ETFs either.

There is a bug in ranks/ranks. It fails if you use the ranking system name but it will work if you use the ranking system id number. The id is the number that appears in the URL when you are in that ranking system. I’ll create a bug report to get it fixed, but you can use the id for now.

This was my issue… Thanks for the fast response and the debugging for the rank id!