question

Upvotes
Accepted
1 0 0 0

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


datascope-select#producttick-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.

@brian.collins

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

@brian.collins

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
78.8k 250 52 74

@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.