Hello,
We want to pull settlement price data for commodity futures using lseg's data library for python. Currently we're using the workspace plug-in for excel, but we wish to migrate this to using the API. When I try to pull the data for ~900 contracts using the API there is a substantial amount of latency (we let it run for ~10 min and it did not complete) but when we pull this data in excel it is significantly faster (< 1min).
We run this query once a day at EOD. We are using the LSEG Data Library for Python, see the link below. We are connecting to the API through workspace by providing an APP KEY, and the code uses API calls that can be found in the samples in the codebook app in workspace.
https://developers.lseg.com/en/api-catalog/lseg-data-platform/lseg-data-library-for-python
Please see the sample code below: Note, ct list is a list of ~900 commodity future contracts
ld.open_session(app_key = APP_KEY)
df = ld.get_data(universe = ct_list,
fields = ['CF_LAST','CF_NETCHNG', 'OPEN_PRC', 'CF_HIGH', 'CF_LOW','SETTLE','CF_VOLUME','TR.OPENINTEREST','TR.InstrumentDescription', 'EXPIR_DATE', 'TR.FOFIRSTNOTICEDAY', 'LSTTRDDATE'],
parameters = {'SDate': '0CY', 'Curn': 'USD'})
ld.close_session()
Thanks!