For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
1 0 1 1

HTTP status 400 for tick datascope query

hello,

I have a python scripts which work fine for 1 min bars.

I am trying to use similar script to fetch tick data for tickers between stated times. This script fails with 400 HTTP response. I am uploading python file as well.

Refinitiv_tick.txt

Thank you!

request body is:

{'ExtractionRequest': {'@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest',

'ContentFieldNames': ['Trade - Price',

'Trade - Volume',

'Quote-Bid Price',

'Quote-Bid Size',

'Quote-Ask Price',

'Quote-Ask Size',

'Trade-Bid Price',

'Trade-Ask Price',

'Trade-Sequence Number',

'Trade-QualifierTrade - Exchange Time'],

'IdentifierList': {'@odata.type': '#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList',

'InstrumentIdentifiers': [{'Identifier': 'LYB', 'IdentifierType': 'Ric'},

{'Identifier': 'AXP', 'IdentifierType': 'Ric'},

{'Identifier': 'VZ', 'IdentifierType': 'Ric'}],

'UseUserPreferencesForValidationOptions': 'false'},

'Condition': {'MessageTimeStampIn': 'GmtUtc',

'ReportDateRangeType': 'Range',

'QueryStartDate': '2021-11-09T08:45:00.000Z',

'QueryEndDate': '2021-11-09T12:30:00.000Z',

'DisplaySourceRIC': 'True'}}}

pythondss-rest-apidsstick-data
refinitiv-tick.txt (9.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
29k 33 11 15

Hello @ankur.tyagi

When I run this request through Postman tool, I see the following error:

"{ "error": { "message": "Validation Error:\r\n\r\nInvalid content FieldName \"Quote-Bid Price\"\r\nInvalid content FieldName \"Quote-Bid Size\"\r\nInvalid content FieldName \"Quote-Ask Price\"\r\nInvalid content FieldName \"Quote-Ask Size\"\r\nInvalid content FieldName \"Trade-Bid Price\"\r\nInvalid content FieldName \"Trade-Ask Price\"\r\nInvalid content FieldName \"Trade-Sequence Number\"\r\nInvalid content FieldName \"Trade-QualifierTrade - Exchange Time\"" }}"

Several of the content field names requested are not valid for TickHistoryTimeAndSales template.

The list of valid content fields for TickHistoryTimeAndSalesRequest can be found via

{
                {protocol}}{
                {host}}{
                {api}}Extractions/GetValidContentFieldTypes(ReportTemplateType=DataScope.Select.Api.Extractions.ReportTemplates.ReportTemplateTypes'TickHistoryIntradaySummaries')

Please note that you should have Tick History as product (be permissioned for RTH) to access TickHistory content sets.

It may be helpful to refer to tutorial REST API Tutorial 4: On Demand tick data extraction for more details on extracting TickHistoryTimeAndSales.

This is a valid example request from tutorial:

{
  "ExtractionRequest": {
    "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryIntradaySummariesExtractionRequest",
    "ContentFieldNames": [
      "Close Ask",
      "Close Bid",
      "High",
      "High Ask",
      "High Bid",
      "Last",
      "Low",
      "Low Ask",
      "Low Bid",
      "No. Asks",
      "No. Bids",
      "No. Trades",
      "Open",
      "Open Ask",
      "Open Bid",
      "Volume"
    ],
    "IdentifierList": {
      "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",  
      "InstrumentIdentifiers": [{
        "Identifier": "CARR.PA",
        "IdentifierType": "Ric"
      }],
      "ValidationOptions": null,
      "UseUserPreferencesForValidationOptions": false
    },
    "Condition": {
      "MessageTimeStampIn": "GmtUtc",
      "ReportDateRangeType": "Range",
      "QueryStartDate": "2016-09-29T00:00:00.000Z",
      "QueryEndDate": "2016-09-30T00:00:00.000Z",
      "SummaryInterval": "OneHour",
      "TimebarPersistence": true,
      "DisplaySourceRIC": true
    }
  }
}

Hope this information helps

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.