question

Upvotes
Accepted
5 0 0 1

Error429 in ElektronTimeseriesExtractionRequest

Hi, I make 22 requests to the API every 10 seconds. And do this twice a day.

~~~~~~~~~~~~

"ExtractionRequest": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions"
".ExtractionRequests."
"ElektronTimeseriesExtractionRequest",
"ContentFieldNames": [
"Trade Date", "Open", "High", "Low",
"Last", "Ask", "Bid", "Volume"
],
"IdentifierList": {
"@odata.type": "#ThomsonReuters.Dss.Api.Extractions."
"ExtractionRequests.InstrumentIdentifierList",
"InstrumentIdentifiers": [
{
"Identifier": {
  {product}}, #For example .SPX .N225 ....
"IdentifierType": "Ric"
}
],
"UseUserPreferencesForValidationOptions": "false"
},
"Condition": {
"StartDate": "{0:%Y-%m-%dT00:00:00.000Z}".format(datetime(1985, 1, 1)),
"EndDate": "{0:%Y-%m-%dT00:00:00.000Z}".format(datetime.now())
}
}

But rarely "HTTP 202 StatusCode" or "HTTP 429 Error" is returned. For 202code, it is solved by repeating the retry, but for 429error, the retry also fails.

Error code 429 | Client Error: Too Many Requests - Too many requests, please try again later.

Looking at other questions, there seems to be a limit (For example, 5 times per second). Please tell me all other limits.

Many thanks in advance.

tick-history-rest-apierror-429
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.

1 Answer

Upvotes
Accepted
13.7k 26 8 12

@mdt,

Yes, there are limits that apply to the API calls. If you exceed a limit, then you receive an HTTP status 429. To understand the limits I suggest you start by looking at the TRTH Best Practices and Limits document, as well as the extractions limit page.

That said, I am a bit intrigued by this statement: "For 202 code, it is solved by repeating the retry". A 202 is not an error, it is a normal message that occurs when a request takes longer than 30 seconds to extract all the data (which is a frequent occurrence). If you receive a 202 you should not repeat the request, as that adds an additional request in parallel that burdens the server. When you receive a 202 you should poll the location URL to detect when the extraction is complete. The workflow is described in the TRTH REST Tutorial 3. This is because requests are asynchronous (for more details, see the async help page).

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