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
- 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
- 684 Datastream
- 1.4K DSS
- 615 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
- 249 ETA
- 554 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.9K Refinitiv Data Platform
- 643 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 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 中文论坛