question

Upvotes
Accepted
16 2 2 9

It takes like 30 seconds to get the response back even after using respond-async. Could you please tell me how to decrease the time taken? Attached full query in detail - REST API

respond-async.txt

tick-history-rest-api
respond-async.txt (2.1 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
11.3k 25 8 13

@Manigandan.R

If you just want to decrease the response time when API returns the HTTP status 202 for asynchronous request, you can add the "wait" option in the Prefer header of the request message to chage the wait time. For example, "Prefer: respond-async, wait=5" means that it will respond either with the results, or with a 202 if the results could not be returned in 5 seconds.

For more information, please see the Async Key Mechanism page.


waitoption.png (23.1 KiB)
icon clock
10 |1500

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

Upvotes
13.7k 26 8 12

@Manigandan.R, the behavior you observe is normal, and there is nothing you can do to accelerate the time it takes for an extraction request to complete (apart from limiting its scope to what you need, i.e. limiting the number of instruments, data fields, and date/time range).

If the data is available in less than 30 seconds you will receive it directly. This is very rarely the case, most extraction requests take more than 30 seconds to complete. Your extraction is for 2 weeks of tick data, it will take several minutes to extract.

If the data is not available in 30 seconds an HTTP status 202 is returned, and you can subsequently check the status of the request by polling the location URL that is in the header of the 202 response.

For more details see the Async Key Mechanism page.

I also see that the date range for your query is in the future, no data will be returned. I tried your request, changing the year to 2016. The extraction took slightly less than 2 minutes.

icon clock
10 |1500

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

Click below to post an Idea Post Idea