question

Upvotes
Accepted
1 1 2 2

Can I one ownload historical stock price data using API for a list of ISINs contain in a CSV file?

rdp-apirefinitiv-data-platform
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.

Moved to Refinitiv Data Platform forum and add tag.

@barbara.petracci

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

@barbara.petracci

Hi,

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvotes
Accepted
78.9k 250 52 74

@barbara.petracci

I have a CSV file with the following data.

RIC
IBM.N
PTT.BK
BDMS.BK
GOOG.O
BAC.N
AAL.L
AV.L
JD.L
AVV.L
LSE.L
VOD.L

I have used the RDP library to retrieve the interday summary data.

First, I connect to the RDP by using the application key, user name, and password. Then I use the pd.read_csv function to read the CSV file. Next, I iterate to all items in the RIC column and call the rdp.HistoricalPricing.get_summaries function for each item.

import refinitiv.dataplatform as rdp
import pandas as pd
import time
rdp.open_platform_session(
    "APP_KEY", 
    rdp.GrantPassword(
        username = "username", 
        password = "password"
    )
)
rics = pd.read_csv("ricsdata.csv")
for item in rics["RIC"]:
    print(item)
    response = rdp.HistoricalPricing.get_summaries(item)
    print(response.data.df)
    time.sleep(1)

For more information, please refer to the following links:

1. Getting Started with Python

2. Python RDP Library examples

3. RDP API Docs Please search for historical-pricing.


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
78.9k 250 52 74

@barbara.petracci

I assume that you are using /data/historical-pricing/v1 on the Refinitiv Data Platform. If you are using different APIs, please let me know.

From my testing, the /data/historical-pricing/v1 endpoint returns "The universe is not found. " when using ISIN. Therefore, you may need to map ISIN to RIC before using /data/historical-pricing/v1. You can use other endpoints, such as /discovery/symbology/v1/lookup to map ISIN to RIC.




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

thank you. Anyway, can you post the python code with ten RICs in column 1 of "sheet1" in a file called ricdata.csv?

yes I use the refinitiv data platform. thanks

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

really helpful! thanks

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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.