question

Upvotes
Accepted
7 2 2 7

REST API - Issue with intraday OnDemand request

I am trying to run the Python sample script "TRTH_OnDemand_IntradayBars.py" come under the REST API example. I am able to retrieve teh authentication token

(screenshot removed for confidentiality reasons)

But then I am getting the following error messages

Can you please help?

tick-history-rest-apirest-api
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.

@KAKIT.LAI,

A few queries to help us investigate:

  • Is this a once of, or does it happen every time you try to run this sample ?
  • Do you run into the same error with the other Python sample we provide, or when using our Postman collection ?
  • This error often occurs because of a proxy. Do you have a proxy, and if yes, did you modify the code to handle the proxy ?

Side note: please do not publish your credentials or token, someone else could access your data using them. I removed the first screenshot for that reason.

Upvotes
Accepted
13.7k 26 8 12

@KAKIT.LAI,

Glad to know my suggestion on the proxy was appropriate, and that the issue is solved :)

IdentifierList

This is the list of instruments for which you want to retrieve data, with the associated instrument type code. Several instrument type codes are supported, like RICs, ISINs, Sedols, Cusips, etc. I usually recommend to use RICs, if you have the choice. There are millions of them, and I don't believe a list is available.To discover what instrument code corresponds to a particular company, you can use our Eikon product, if you have it, it has great search tools. If you do not have Eikon, you can use the RIC Search tool available under the Elektron APIs (even though those APIs have nothing to do with TRTH, the tool is valid as RIC codes are used by many of our products). In the tool, type in a company name, for instance Allianz. Assuming you want an equity instrument for that company, drill down further by clicking on Equities. The first item in the list, ALVG.DE, is the main RIC, on the german Xetra exchange. That code could be used in a data request, inside the IdentifierList parameter.

ContentFieldNames

The list of available field names depends on the type of data you are requesting, it is not the same for Intraday summaries, end of day data, tick or market depth data, etc. There are several ways to find out what fields are available for a specific call:

  • Go to the GUI, and create a report template for the type of data you want. Then click on the "Fields" tab to see the list of available fields, with their description.
  • Use the Data Dictionary. In tab "Field Descriptions", filter column C to contain the type of request you are making. Column D contains all available fields, the following columns describe them.
  • Use an API call. See REST tutorial 6 for Intraday Summaries. The other tutorials illustrate that for other data requests.

Conditions

These also depend on the API call, i.e. the type of data you request. The API Reference Tree describes all API calls, as well as their conditions. See here for On Demand extractions, in the first parameter use the dropdown to select the call you are interested in (for instance TickHistoryIntradaySummaries), all the available conditions will be displayed, with short descriptions. The tutorials describe some of these as well.

For more info

I recommend you look at the Programming without SDK tutorial, in particular the best practices section which explains how to understand the API calls.

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.

Upvotes
7 2 2 7

Hi Christiaan. Thanks for getting back. Indeed it is the proxy issue. I managed to update the script and pass in the proxy info and able to download the file.

I am new to python so please bear with me on my ignorance here. Within the requestBody under the "TRTH_OnDemand_IntradayBars.py" there are the "ContentFieldNames", "IdentifierList" and "Condition" that needs to be passed in. Can you let me know where I can find the list of available "ContentFieldNames", "IdentifierList" and "Condition"?

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.