question

Upvotes
Accepted
1 0 0 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 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
38.1k 69 35 53

@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 5.0 MiB each and 10.0 MiB total.

Upvotes
38.1k 69 35 53

@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 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 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 5.0 MiB each and 10.0 MiB total.

Upvotes
1 0 0 2

really helpful! thanks

icon clock
10 |1500

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

Click below to post an Idea Post Idea