question

Upvotes
Accepted
1 0 0 1

Filter tick history by Type

I'm using the rest API to pull tick history using python. This pulls Quote and trades. Is there a way to only pull records where Type=Trade?


{
 "ExtractionRequest": {
 "@odata.type":
"#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryRawExtractionRequest",
 "ContentFieldNames": [


 ],
 "IdentifierList": {
 "@odata.type":
"#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
 "InstrumentIdentifiers": [
 {
 "Identifier": "SPXA192420000.U",
 "IdentifierType": "Ric"
 }
 ],
 "ValidationOptions": null,
 "UseUserPreferencesForValidationOptions": false
 },
 "Condition": {
 "MessageTimeStampIn": "GmtUtc",
 "ReportDateRangeType": "Range",
 "QueryStartDate": "2021-08-02T17:00:00.000Z",
 "QueryEndDate": "2021-08-02T19:59:59.000Z",
 "DisplaySourceRIC": true
 }
 }
}

1682102948980.png


#productdatascope-selecttick-history-rest-apitrth-rest-api
1682102948980.png (64.1 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

· Write an Answer
Upvotes
Accepted
86.2k 292 53 79

@brian.collins

Thanks for reaching out to us.

I checked and found that the TickHistoryRawExtractionRequest extraction doesn't have a condition to filter the data by the update type.

You may need to use different report templates, such as TickHistoryTimeAndSalesExtractionRequest. You can specify trade-related fields in the content fields of this report template.

{
  "ExtractionRequest": {
    "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.TickHistoryTimeAndSalesExtractionRequest",
    "ContentFieldNames": [
      "Trade - Exchange/Contributor ID",
      "Trade - Price",
      "Trade - Volume",
      "Trade - Market VWAP",
      "Trade - Block Trade",
...

You can refer to the REST API Reference Tree for more information.

I hope that this information is of help.

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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