How to filter trade date for CompositeExtractionRequest
Hallo All,
I have below CompositeExtractionRequest where i want to fetch the response on specific date based on trade date. So i want to get the data from 01.07.2022, 02.07.2022 and 06.07.2022 and i want to filter this with trade date. How to specify this filter in the extraction request ?
requestHeaders = {
"Prefer": "respond-async",
"Content-Type": "application/json",
"Authorization": "token " + token
}
requestBody = {
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.CompositeExtractionRequest",
"ContentFieldNames": [
"ISIN","RIC","Trade Date","Market MIC","Market Segment MIC","Average Volume - 30 Days","Average Volume - 90 Days","Close on Close Volatility - 90 Days","Dollar Daily Value Average - 30 Days","Outstanding Shares - Issue Shares Amount","Contributor Code","Ask Price","Bid Price"
],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers":
dc
,
"ValidationOptions": {
"AllowInactiveInstruments": "false"
},
"UseUserPreferencesForValidationOptions": "false"
},
"Condition": {
"ScalableCurrency": "true"
}
}
}
Best Answer
-
You can not specify the query date in the CompositeExtractionRequest, as shown in the REST API Reference Tree.
To get Trade on the specific dates, you need to use other requests, such as
PriceHistoryExtractionRequest which supports the QueryStartDate and QueryEndDate parameters.
For example, the request looks like this:
{
"ExtractionRequest": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest",
"ContentFieldNames": [
"File Code",
"RIC",
"Trade Date",
"Last Trade Price",
"Official Close Price",
"Universal Close Price",
"High Price",
"Low Price",
"Open Price",
"Turnover",
"Volume"
],
"IdentifierList": {
"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{
"Identifier": "ALVG.DE",
"IdentifierType": "Ric"
},
{
"Identifier": "IBM.N",
"IdentifierType": "Ric"
},
{
"Identifier": "DE000A168205",
"IdentifierType": "Isin"
}
],
"ValidationOptions": {
"AllowHistoricalInstruments": true
},
"UseUserPreferencesForValidationOptions": false
},
"Condition": {
"AdjustedPrices": true,
"QueryStartDate": "2022-07-01T00:00:00.000Z",
"QueryEndDate": "2022-07-06T00:00:00.000Z"
}
}
}The output is:
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Extractions.ExtractionRequests.ExtractionResult",
"Contents": [
{
"IdentifierType": "Ric",
"Identifier": "ALVG.DE",
"File Code": "62",
"RIC": "ALVG.DE",
"Trade Date": "2022-07-01",
"Last Trade Price": null,
"Official Close Price": 182,
"Universal Close Price": 182,
"High Price": 183.46,
"Low Price": 179.18,
"Open Price": 179.42,
"Turnover": 148841435.98,
"Volume": null
},
{
"IdentifierType": "Ric",
"Identifier": "ALVG.DE",
"File Code": "62",
"RIC": "ALVG.DE",
"Trade Date": "2022-07-04",
"Last Trade Price": null,
"Official Close Price": 183.02,
"Universal Close Price": 183.02,
"High Price": 184.36,
"Low Price": 182.48,
"Open Price": 182.92,
"Turnover": 92968189.64,
"Volume": null
},You can use the HTTP GET method with the Extractions/GetValidContentFieldTypes(ReportTemplateType=DataScope.Select.Api.Extractions.ReportTemplates.ReportTemplateTypes'PriceHistory') endpoint to see all available fields in the PriceHistoryExtractionRequest .
0
Answers
-
@Gurpreet do you idea how to provide filter based on date in the extraction request ?0
-
@Jirapongse thanks! i tried to use "QueryStartDate": "2022-07-01T00:00:00.000Z", "QueryEndDate": "2022-07-06T00:00:00.000Z" but the python code is failing ..i dont know the date format is issue here ?
0 -
0
-
@Jirapongse sorry i was using the Query date in the CompositeExtractionRequest...actually the problem is i am saving the data at the same time in our database table so i want to have the same field provided in the extraction request...in your extraction request the fields are different...Is it not possible to use any other date rather than trade date to get the response on the CompositeextractionRequest for the fields which i am using ?0
-
@Jirapongse any idea on using the same Composite extraction request to fetch the data for certain dates ? Because if we use different extraction request with different fields, we have to change the entire implementation structure0
-
The Composite extraction request doesn't support date parameters so we can not specify dates in the Composite extraction request.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛