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

Best Answer

Answers

  • @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. image


    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.

  • 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?


  • 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

  • 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".

  • 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.


  • Thanks Umer

    I will get back with those answers from my business team

    Thanks very much for your help

  • Thanks Christiaan

    I got what you are saying.

  • 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

  • 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.


  • 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 ?

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

    PI is the closing price for the index

  • Thanks Gurpreet...

  • 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

  • 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