Last Updated: Jan 2026
Introduction
This article will discuss a quick and easy wrapper approach for running parallel Tick History requests. We are going to use TickHistoryTimeAndSalesExtractionRequest as an example request, while the analogous steps can be used with other Tick History and Datascope Select requests.
The companion example code is a Python Jupyter notebook* and is based on Tick History Python Code Samples*:
With this in mind, let us embark on a little coding voyage.
Approach in Brief
- Authentication- token request
- Parametrize request (TickHistoryTimeAndSalesRequest)
- On Demand extraction request
- Define
- Extraction status polling
- Extraction notes retrieval
- Parallelize
- Data retrieval and save to disk (includes AWS download)
- Define
- Parallelize
* see References section for the links to download example code
Import Required Modules and Define Required Parameters
This includes the definition of a "cookie-cutter" request:
Read Credentials from File
It is not essential how credentials are acquired, they can be entered as input pramterese or hard-coded, most importantly, that we have them at hand, for the required authentication step.
Authentication - Datascope Token Request
Parametrise Our Request
resulting in required requests to be ready to go:
Send On-demand Extraction Request - Define
We define a helper function to issue a request, that can consequently be issued in parallel
Send On-demand Extraction Request - Parallelize
This example code shows 2 requests issued in parallel. We can issue more requests in parallel, using the same pre-defined helper function. However, for TickHistoryTimeAndSalesRequest per Tick History REST API User Guide*, at the time of this writing, the number of concurrent processing requests is 2, same as for most other Tick History Templates. The maximum number of the requests that can be submitted is 50.
Therefore, per design, we should never submit more then 50 requests - maximum accepted. If we wish to only submit requests that will be immediately accepted for processing, we should submit 2 requests at a time. If we prefer to submit more and have some requests awaiting their turn, we can submit up to maximum allowed to be submitted, up to 50 requests.
if we are running in Jupyter notebook, event loop is already running and our tasks are executing in parallel, for example:
all that we need to do is await their completion:
Retrieve Results and Save to File - Define a Helper Function
- Request the extraction results, using the known jobId
- Save the compressed data as GZIP
- Display a few lines of the result
Retrieve Results and Save to File - Parallelize
Now all that is left for us to do is obtain the results:
that should look something like:
this concludes our discussion for the moment, a good next step is downloading and running the example code listed in References
Get In Touch
Related Articles
Source Code
Related APIs
Request Free Trial
Call your local sales team
Americas
All countries (toll free): +1 800 427 7570
Brazil: +55 11 47009629
Argentina: +54 11 53546700
Chile: +56 2 24838932
Mexico: +52 55 80005740
Colombia: +57 1 4419404
Europe, Middle East, Africa
Europe: +442045302020
Africa: +27 11 775 3188
Middle East & North Africa: 800035704182
Asia Pacific (Sub-Regional)
Australia & Pacific Islands: +612 8066 2494
China mainland: +86 10 6627 1095
Hong Kong & Macau: +852 3077 5499
India, Bangladesh, Nepal, Maldives & Sri Lanka:
+91 22 6180 7525
Indonesia: +622150960350
Japan: +813 6743 6515
Korea: +822 3478 4303
Malaysia & Brunei: +603 7 724 0502
New Zealand: +64 9913 6203
Philippines: 180 089 094 050 (Globe) or
180 014 410 639 (PLDT)
Singapore and all non-listed ASEAN Countries:
+65 6415 5484
Taiwan: +886 2 7734 4677
Thailand & Laos: +662 844 9576