Slow querying of DDS intraday summaries

I have used the Python Example code to query intraday summaries. It takes 4 minutes to download the basic data for 24 hour period for 2 stocks. How can this be optimised?
def request_intraday_summaries(token, rics, start_date, end_date):
url = "https://selectapi.datascope.refinitiv.com/RestApi/v1/Extractions/ExtractRaw"
headers = {
"Prefer": "respond-async",
"Content-Type": "application/json",
"Authorization": f"token {token}"
}
# Define the content fields you want to retrieve
content_fields = [
"Volume",
"Last",
]
# Build the request body
body = {
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",
"ContentFieldNames": content_fields,
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [{"Identifier": ric, "IdentifierType": "Ric"} for ric in rics],
"UseUserPreferencesForValidationOptions": False
},
"Condition": {
"MessageTimeStampIn": "GmtUtc",
"ReportDateRangeType": "Range",
"QueryStartDate": start_date,
"QueryEndDate": end_date,
"SummaryInterval": "FifteenMinutes",
"TimebarPersistence": True,
"DisplaySourceRIC": True
}
}
}
# Send the extraction request
response = requests.post(url, json=body, headers=headers)
print(f"Response received: {response}")
if response.status_code in [200, 202]:
if response.status_code == 202:
# Extraction is not immediately available, poll the status
location = response.headers.get("location")
return poll_extraction_status(token, location)
else:
# Extraction is ready
return response.json()["JobId"]
else:
print("Extraction request failed.")
print(f"Status Code: {response.status_code}")
print(f"Message: {response.text}")
return None
def poll_extraction_status(token, location_url):
headers = {
"Authorization": f"token {token}"
}
while True:
response = requests.get(location_url, headers=headers)
if response.status_code == 200:
# Extraction is ready
job_id = response.json()["JobId"]
print(f"Extraction completed. Job ID: {job_id}")
return job_id
elif response.status_code == 202:
# Extraction is still in progress
print("Extraction in progress. Waiting for 30 seconds...")
time.sleep(30)
else:
print("Error while polling extraction status.")
print(f"Status Code: {response.status_code}")
print(f"Message: {response.text}")
return None
# Request the extraction and get the Job ID
job_id = request_intraday_summaries(token, rics, start_date, end_date)
Best Answer
-
Thank you for reaching out to us.
Please refer to the following articles:
You can check the extraction Notes for the extraction time.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 685 Datastream
- 1.4K DSS
- 616 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 252 ETA
- 556 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 652 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛