question

Upvotes
Accepted
1 0 0 0

How can I download the index stock returns for S&P500, FTSE100 indicies for the last 10 years with daily data on last price, volume using R API. Many thanks!

Some further notes:

I am using Datastream via Eikon with ID being an email and a password. I do not have a separate ID and password for Datastream. Can you please help to give the answer to my personal email: XXXXXX Many thanks!



datastream-apiindices
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.

1 Answer

Upvotes
Accepted
47.2k 109 44 60

@dummystudent3

First, you need to check if your credential is allowed to access API. You can go to this Datastream TEST REST Service page to check your credential.

Next, you can refer to the Getting started with R document that provides information on how to access DSWS via R. You can also refer to the Setup Jupyter Notebook for R article which provides an R example running on Jupyter Notebook.

Then, you can go to Datastream Navigator website to search for instruments and data types that can be used to retrieve the required data.

1657167942051.png

For example, the code looks like this:

data <- mydsws$timeSeriesRequest(instrument = c("S&PCOMP", "FTSE100"),
                                            datatype = c("PI","VO"),
                                            startDate = "2012-01-01T00:00:00",
                                            endDate = "LATESTDATE",
                                            frequency = "D",
                                            )

data

The output is:

1657168008459.png

Otherwise, you can contact the Refinitiv Datastream Web Service support team directly via MyRefinitiv to verify your credential and find instruments and datatypes used to retrieve the required data.


1657167942051.png (154.8 KiB)
1657168008459.png (33.3 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.