question

Upvotes
Accepted
5 0 2 2

Programmatically request data for SPX Index and US Treasury Bill rate through C#.Net

Need guidance for following steps:

1. Programmatically login through a user name and password

2. Request SPX Index rate and US Treasury Bill rate


Do I need a different userid other than the one I am logged in with to programmatically login?

I do not need any continuous stream of data or historical data

I just need to fetch data for above two things


Please guide me through the same

datastream-apidsws-apiauthenticationlog-in
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
Accepted
25k 87 11 23

Hi @prashant.busa

The following page has some documentation on the DSDataTypes and DSDataTypeCodes:

http://product.datastream.com/dswsclient/Docs/netapihelp/html/N_ThomsonReuters_DswsApi.htm

I am not a Datastream expert so cannot answer your question.

Hopefully, a Datastream expert will answer your question. Alternatively, you can contact our helpdesk and raise a ticket with them.


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.

Thanks Umer


I learnt that in Datastream the mnemonic for S&P 500 index is S&PCOMP

And the mnemonic for US 10yr treasure bill is BMUS10Y

Upvotes
17.2k 47 13 19

@prashant.busa, Please download the .NET SDK and an Example application from https://hosted.datascopeapi.reuters.com/RestApi.Help/Home/Index. You can use the On Demand Extraction to get data for these RIC's.

The code snippets required to initiate this request can be seen in the C# window.


You can also follow along the .NET step by step tutorials with provided example code. The credentials you use with API are same as the one you use to login to DSS website.


ahs.png (68.2 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.

Thanks Gurpreet...

Upvotes
25k 87 11 23

Hi @prashant.busa

You have posted your question in the TRTH section which is for the Tick History data API.

Reading your question it sounds more like you want to make a snapshot request for the current values as and when required in realtime. If this is the case, I can move this post to the appropriate section.

Also, in terms of the actual data, do you want the single S&P 500 Index rate or do you want the individual prices for all the constituents of the index?

Can you also expand on what exactly you mean by US Treasury Bill rate - what period etc - please provide more detail?


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.

Thanks Umer for your replay

I wanted to know which is the correct section for my question

Yes I just want to make single requests for my data (something like Data License request in Bloomberg). Sorry, I am not familiar with Reuters terminology for these things.

Answering your 2 questions:

1. I just want single S&P 500 Index rate

2. I want US 10yr benchmark rate


Thanks,

Prashant Busa

Upvotes
13.7k 26 8 12

@prashant.busa,

1. Login programmatically using a user name and password

See the .Net C# tutorial 1.

Notes:

  • The login you use for the Developer Community portal will not work, it is not a product access login. The TRTH user id and password are product specific (i.e. you need to be a TRTH customer to receive these).
  • The user name and password are the same for use in the TRTH GUI and for programmatic access with the API.

2. Requesting rates

TRTH gives access to different types of historical data (historical ticks, market depth, bars, raw data, End of Day ...). How to request data therefore depends on what you want to retrieve.

I suggest you start by looking at the other .Net tutorials to see how to make requests.

I strongly recommend looking at the Quick Start as well, which introduces the C# example application; it is delivered with source code, and illustrates most of the API calls you can make.

To retrieve the SPX rate, the RIC is ".SPX". There are many RICs for US treasury bills rates. As an example, the RIC for the 1 month daily bill rate is "US1MFRB=RR".

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.

Thanks Christiaan

I got what you are saying.

Upvotes
25k 87 11 23

Hi @prashant.busa

Thanks for confirming that you want current prices for the single S&P 500 Index rate and the US 10yr benchmark rate.

Can you confirm what data source you will be connecting to? do you have a TREP server within your organisation? Or do you have an account for our Elektron Realtime in cloud service?

I ask because the API recommendation I make for .NET will differ based on your answer.

If you are not sure please ask your market data team or your Refinitiv Account manager.

If you have had a welcome email from Refinitiv which mentioned a MachineID then this would indicate a Cloud access point. If however, you were given a username by your internal market data team then this indicate a TREP Server.


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.

Thanks Umer

I will get back with those answers from my business team

Thanks very much for your help

Hi @Umer Nalla

We dont have TREP server or Elektron Realtime in cloud service

We have DFO (Datastream For Office) access

Is it possible to programmatically retrieve rates using this type of account/access?


Thanks in advance

Regards,

Prashant Busa

Upvotes
25k 87 11 23

Hi @prashant.busa

Thanks for confirming which product you have - I have moved the question to the correct forum.

You mentioned previously that you do not want historical data or streaming data - so that suggests you want realtime snapshots. If this is the case, then it would appear that Datastream is not the right product for your needs.

For realtime snapshots, you would need access to a Refinitiv Data platform account or an Eikon account or access to TREP server in your organisation. Please speak to your Refinitiv account manager / internal market data team to discuss these options further.


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
5 0 2 2

Thanks Umer

But most of the Eikon APIs requires that Thomson Reuters terminal should remain logged in on the same machine from where the programmatic request are done. This is difficult for us.

We have gained access for Datastream and are able to programmatically login and get token for our userid/password.

Now I am not able to find the correct "field" to get last EOD price of S&P 500 index

Sample datastream request is as under:

var request = new DSDataRequest()
{
Instrument = new DSInstrument(".SPX"),
DataTypes = new DSDataTypes(?),
Date = DSSnapshotDate(DSDateType.Absolute(DateTime.Now))
};

Can you help me with correct datatype that I can use ?

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
681 2 2 1

Hi, The client should use Navigator to lookup datatypes for series.

PI is the closing price for the index

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.

Thanks James

PI is giving me correct value

I learnt that in Datastream the mnemonic for S&P 500 index is S&PCOMP

And the mnemonic for US 10yr treasure bill is BMUS10Y

Upvotes
681 2 2 1
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.