When do CSVs become available for download for all exchanges? I'm download ticker order book ric
Hi I'm making requests to download TickHistoryMarketDepth data.
"ExtractionRequest": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryMarketDepthExtractionRequest", "IdentifierList": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{ "Identifier": f"{ticker}", "IdentifierType": "Ric", }],
When does this data become available for all exchanges? I'm making a post request to post_url = URL_BASE + "/Extractions/ExtractRaw".
The exchanges I'm trying to download ticker data from are suffixes = [".NYO", ".ARC", ".ITC", ".DEX", ".BAT"]
I notice if I download too early, the csvs aren't there or are empty. If I'm trying to download data for 2025-02-24… when should I start the download process?
Answers
-
Hello @Jwan622
There is an embargo for every exchange. Tickhistory can not release data for that exchange, until the exchange mandated embargo time has passed; which is typically few minutes or hours after trading end.
You can see some of the embargo information for an instrument in the IntraDayPricingExtraction request.
{ "ExtractionRequest": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [ { "Identifier": "VOD.L", "IdentifierType": "Ric" } ] }, "Condition": { "ScalableCurrency": true } } }
0 -
that doesn't seem to work. Could you take a look at this code?
# Base API URL (Update with the correct endpoint)URL_BASE = "https://selectapi.datascope.refinitiv.com/RestApi/v1"REFINITIV_AUTH_TOKEN = get_cached_refinitiv_auth_token() # Replace with valid authentication tokendef get_embargo_info(ticker="VOD.L"): logger.info(f"Fetching embargo information for {ticker}...") # Construct request payload json_blob = { "ExtractionRequest": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{"Identifier": ticker, "IdentifierType": "Ric"}] }, "Condition": {"ScalableCurrency": True} } } # API endpoint for extraction request post_url = f"{URL_BASE}/Extractions/ExtractRaw" # Send the request response = requests.post( post_url, headers={"Authorization": f"Token {REFINITIV_AUTH_TOKEN}", "Content-Type": "application/json"}, json=json_blob ) # Check if request was successful if response.status_code == 200: embargo_data = response.json() logger.info(f"Embargo info retrieved successfully for {ticker}.") return embargo_data else: logger.error(f"Failed to fetch embargo data. Status Code: {response.status_code}, Response: {response.text}") return None# Example callif __name__ == "__main__": embargo_info = get_embargo_info("VOD.L") if embargo_info: print(json.dumps(embargo_info, indent=4))
I am getting thsi error:
Failed to fetch embargo data. Status Code: 400, Response: {"error":{"message":"Malformed request payload: Unexpected @odata.type 'DataScope.Select.Api.Extractions.ExtractionRequests.ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest' in payload"}}0 -
that doesn't seem to work. Could you take a look at this code?
# Base API URL (Update with the correct endpoint)URL_BASE = "https://selectapi.datascope.refinitiv.com/RestApi/v1"REFINITIV_AUTH_TOKEN = get_cached_refinitiv_auth_token() # Replace with valid authentication tokendef get_embargo_info(ticker="VOD.L"): logger.info(f"Fetching embargo information for {ticker}...") # Construct request payload json_blob = { "ExtractionRequest": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{"Identifier": ticker, "IdentifierType": "Ric"}] }, "Condition": {"ScalableCurrency": True} } } # API endpoint for extraction request post_url = f"{URL_BASE}/Extractions/ExtractRaw" # Send the request response = requests.post( post_url, headers={"Authorization": f"Token {REFINITIV_AUTH_TOKEN}", "Content-Type": "application/json"}, json=json_blob ) # Check if request was successful if response.status_code == 200: embargo_data = response.json() logger.info(f"Embargo info retrieved successfully for {ticker}.") return embargo_data else: logger.error(f"Failed to fetch embargo data. Status Code: {response.status_code}, Response: {response.text}") return None# Example callif __name__ == "__main__": embargo_info = get_embargo_info("VOD.L") if embargo_info: print(json.dumps(embargo_info, indent=4))
I am getting this error:
Failed to fetch embargo data. Status Code: 400, Response: {"error":{"message":"Malformed request payload: Unexpected @odata.type 'DataScope.Select.Api.Extractions.ExtractionRequests.ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest' in payload"}}
0 -
@Gurpreet that doesn't seem to work. Could you take a look at this code?
import requests
URL_BASE = "https://selectapi.datascope.refinitiv.com/RestApi/v1" REFINITIV_AUTH_TOKEN = get_cached_refinitiv_auth_token()
def get_embargo_info(ticker="VOD.L"): logger.info(f"Fetching embargo information for {ticker}...")
# Construct request payload json_blob = { "ExtractionRequest": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{"Identifier": ticker, "IdentifierType": "Ric"}] }, "Condition": {"ScalableCurrency": True} } } # API endpoint for extraction request post_url = f"{URL_BASE}/Extractions/ExtractRaw" # Send the request response = requests.post( post_url, headers={"Authorization": f"Token {REFINITIV_AUTH_TOKEN}", "Content-Type": "application/json"}, json=json_blob ) # Check if request was successful if response.status_code == 200: embargo_data = response.json() logger.info(f"Embargo info retrieved successfully for {ticker}.") return embargo_data else: logger.error(f"Failed to fetch embargo data. Status Code: {response.status_code}, Response: {response.text}") return None
if name == "main": embargo_info = get_embargo_info("VOD.L") if embargo_info: print(json.dumps(embargo_info, indent=4))0 -
Request:
{ "ExtractionRequest": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{ "Identifier": "VOD.L", "IdentifierType": "Ric" } ] }, "Condition": { "ScalableCurrency": "true" } } }
Response:
{ "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Extractions.ExtractionRequests.ExtractionResult", "Contents": [{ "IdentifierType": "Ric", "Identifier": "VOD.L", "Exchange Code": "LSE", "File Code": "691", "PE Code": "5625", "Real Time Permitted": "N", "Exchange Requiring Embargo": "LDI (LSE LEVEL 1 DOMESTIC AND INTERNATIONAL - PDA ONLY), LSE1D (LONDON SE UK MARKET L1), LSE2D (LONDON SE DOMESTIC L1 L2)", "Embargo Times": "Monday-Friday 03:00:00 AM-11:30:00 AM", "Embargo Window": null, "Current Embargo Delay": 0, "Maximum Embargo Delay": 15, "Instrument Snap Time": "25/02/2025 05:50:30 PM", "Last Update Time": "25/02/2025 03:10:37 PM" } ], "Notes": [...] }
0 -
The code should handle response.status_code == 202 which indicates the the extraction is still in-progress.
Please refer to the REST API Tutorial 3: On Demand intraday extraction, embargo tutorial in the Embargo section.
0 -
It's a post request right?
URL_BASE = "https://selectapi.datascope.refinitiv.com/RestApi/v1" REFINITIV_AUTH_TOKEN = get_cached_refinitiv_auth_token() def get_intraday_data(ticker: str): """ Fetch intraday pricing data for a given ticker. Logs when request is accepted (202) but does not poll. Matches the exact request format from the Refinitiv Customer Service Engineer. """ logger.info(f"Fetching intraday data for {ticker}...") # API endpoint (matches Customer Service Engineer's request) post_url = f"{URL_BASE}/Extractions/ExtractWithNotes" # Construct request payload json_blob = { "ExtractionRequest": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.IntradayPricingExtractionRequest", "ContentFieldNames": [ "Exchange Code", "File Code", "PE Code", "Real Time Permitted", "Exchange Requiring Embargo", "Embargo Times", "Embargo Window", "Current Embargo Delay", "Maximum Embargo Delay", "Instrument Snap Time", "Last Update Time" ], "IdentifierList": { "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [{ "Identifier": "VOD.L", "IdentifierType": "Ric" } ] }, "Condition": { "ScalableCurrency": "true" } } } # Send request response = requests.post( post_url, headers={ "Authorization": f"Token {REFINITIV_AUTH_TOKEN}", "Content-Type": "application/json", "Prefer": "respond-async" }, json=json_blob ) # If successful, return the extracted data if response.status_code == 200: intraday_data = response.json() logger.info(f"Intraday data retrieved successfully for {ticker}.") return intraday_data # If request is still processing, log and return None elif response.status_code == 202: logger.info(f"Request for {ticker} is being processed (202 Accepted). Data is not yet available.") return None # Log other errors else: logger.error(f"Failed to fetch intraday data for {ticker}. Status Code: {response.status_code}, Response: {response.text}") return None # Example usage: if __name__ == "__main__": intraday_data = get_intraday_data("SPX500") if intraday_data: print(json.dumps(intraday_data, indent=4))
My response is this:
INFO:main:Fetching intraday data for SPX500...
ERROR:main:Failed to fetch intraday data for SPX500. Status Code: 403, Response: {"error":{"message":"No permission for template "IntradayPricingReportTemplate"."}}
does that mean I have to upgrade my API key?the whole point of this is to see if I can download the market order book right? Is there a general time of day when the books are all ready for download? Around 6pm EST right? My api key needs to be upgraded to see if I can download the order book it seems right?
0 -
I get this resopnse
INFO:main:Fetching intraday data for SPX500...
ERROR:main:Failed to fetch intraday data for SPX500. Status Code: 403, Response: {"error":{"message":"No permission for template "IntradayPricingReportTemplate"."}}0 -
{"error":{"message":"No permission for template "IntradayPricingReportTemplate"."}}
You will need to speak with your LSEG account manager to get entitlements for these report templates.
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 33 Data Model Discovery
- 682 Datastream
- 1.4K DSS
- 613 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
- 248 ETA
- 552 WebSocket API
- 37 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.8K Refinitiv Data Platform
- 625 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 83 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛