Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
avatar image
REFINITIV
Question by katarzyna.olenycz · May 13, 2021 at 09:13 AM · pythonrdp-apirefinitiv-data-platformcodebookprice-history

Not able to retrieve correct dates from historical-pricing API via rdp.Endpoint

Hi

I am trying to pull historical prices directly from API in codebook, but instead of given dates I am only receiving last 20 prices. I am aware of existence of rdp.get_historical_price_summaries('') but this way I am not able to retrieve defaultPricingField which is available in API response and which I need too for further data processing. Could you help with setting interval and start/end parameters correctly so that it returns correct data?


import refinitiv.dataplatform as rdp
session = rdp.open_desktop_session('DEFAULT_CODE_BOOK_APP_KEY')

endpoint = rdp.Endpoint(session, 'https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/VOD.L?interval=P1W&start=2020-05-13&end=2021-05-13')
response = endpoint.send_request('GET)
response.data.raw[0]['data']



@marcin.bunkowski

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jonathan.legrand · May 13, 2021 at 02:39 PM

Hi @katarzyna.olenycz,


Looking through the Refinitiv Developer's Q&A site, I found this answer which helped me in writing the bellow code. Please do let me know if it outputs satisfactory results answering your question - it returns data in the date range you requested:


import pandas as pd
import refinitiv.dataplatform as rdp
rdpsession = rdp.open_desktop_session('DEFAULT_CODE_BOOK_APP_KEY')
endpoint = rdp.Endpoint(session = rdpsession,
                        url = 'https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/VOD.L?interval=P1W&start=2020-05-13&end=2021-05-13')
response2 = endpoint.send_request(
    method = rdp.Endpoint.RequestMethod.GET,
    query_parameters = {
        'start': '2020-05-13T00:00:00.000000000Z',
        'end': '2021-05-13T00:00:00.000000000Z'})
if response2.is_success:
    headers = [h['name'] for h in response.data.raw[0]['headers']]
    df2 = pd.DataFrame(data = response2.data.raw[0]['data'], columns = headers)
display(df2)

Comment
katarzyna.olenycz

People who like this

1 Show 2 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
jonathan.legrand ♦♦ · May 13, 2021 at 02:43 PM 0
Share

N.B.: I was able to reproduce the issue brought forward with the following code:


import pandas as pd
import refinitiv.dataplatform as rdp
rdpsession = rdp.open_desktop_session('DEFAULT_CODE_BOOK_APP_KEY')
endpoint = rdp.Endpoint(session = rdpsession,
                        url = 'https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/VOD.L?interval=P1W&start=2020-05-13&end=2021-05-13')
response1 = endpoint.send_request('GET')
if response1.is_success:
    headers = [h['name'] for h in response1.data.raw[0]['headers']]
    df1 = pd.DataFrame(data = response1.data.raw[0]['data'], columns = headers)
display(df1)
avatar image
REFINITIV
katarzyna.olenycz · May 14, 2021 at 05:59 AM 0
Share

Hi Jonathan

This works perfectly, thank you!

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
11 People are following this question.

Related Questions

RDP requests don't return anything

How to upload GitHub notebooks to codebook

discrepancy between RDP API vs Excel RSearch for corporate bonds

Download historical data from LoanConnector

What function is used to retrieve all ticks within a window with no lag?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges