CAn someone show me how to make a request to get a list of s&p500 stocks? I can't seem to find this anywhere. What can I do do make a request? Is there a simple get request endpoint?
I want to feed the results into this request to get all csv order book data:
json_blob = {
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryMarketDepthExtractionRequest",
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{
"Identifier": f"{ticker}",
"IdentifierType": "Ric",
}],
"ValidationOptions": {
"AllowHistoricalInstruments": "true"
},
"UseUserPreferencesForValidationOptions": "false",
},
"Condition": {
"View": "RawMarketByPrice",
"MessageTimeStampIn": "GmtUtc",
"ReportDateRangeType": "Range",
"DisplaySourceRIC": "true",
"DateRangeTimeZone": "UTC",
"QueryStartDate": query_start_date,
"QueryEndDate": query_end_date,
},
}
}
post_url = URL_BASE + "/Extractions/ExtractRaw"
response = post_request_with_auth(post_url, refinitiv_auth_token, json_blob)
job_id = response.json()["JobId"]
logger.info("Starting CSV download...")
response = requests.get(
URL_BASE + f"/Extractions/RawExtractionResults('{job_id}')/$value",
headers = {"Authorization": f"Token {refinitiv_auth_token}"},
stream = True
)
response.raise_for_status()
job_id = response.json()["JobId"]
logger.info("Starting CSV download...")
response = requests.get(
URL_BASE + f"/Extractions/RawExtractionResults('{job_id}')/$value",
headers = {"Authorization": f"Token {refinitiv_auth_token}"},
stream = True
)
response.raise_for_status()