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
Question by rw74 · May 24 at 02:31 PM · rdp-apirefinitiv-data-platform-librariessessionendpoint

Retrieving Foreign Exchange Data (FX) using RDP library

Hi - Thanks in advance for any help with this.

I would like to download a subset of historical intraday Foreign Exchange (FXD5) data for all exchanges in this date range: (Aprils of 2010, '13, '16', '19).

Upon purchase, I was given this documentation,
Getting Started with Refinitiv Data Platform

This is the type of data I want to download,
PRICING AND MARKET DATA, Foreign Exchange


Data Dictionary:

Data Guide_Tick_Hist_Matching.pdf specifically the "Matching Prices with Volumes Daily (D5)" data.



I can successfully download this data, file by file, using the Refinitiv API PLAYGROUND but I cannot figure out how to download all files using the RDP Library.

Here's what I've tried,

  • Generated AppKey (API: EDP API)

  • Installed refinitiv-dataplatform package in my python3 distribution

  • Created Jupyter workbook, credentials.ipynb, that defines RDP credentials, i.e.,

RDP_LOGIN = 'myusername@xyz.edu'
RDP_PASSWORD = 'myPass'
APP_KEY = 'ad890…


  • Created another workbook to import RDP API Library Credential file
RDP_LOGIN = 'myusername@xyz.edu'
RDP_PASSWORD = 'myPass'
APP_KEY = 'ad890……'


  • Created RDP OpenPlatform Session to connect to RDP
session = rdp.open_platform_session(
    APP_KEY,
    rdp.GrantPassword(
        username = RDP_LOGIN,
        password = RDP_PASSWORD
    )
)

# check if session successfully opened
session.get_open_state()

—--return value shows successful creation of session —------
<State.Open: 3>


  • Define endpoint
#endpoint = rdp.Endpoint( session,
# "https://api.refinitiv.com/file-store/v1/file-sets
# ?bucket=TICKHISTORY_VBD_UNLIMITED&attributes=venue:FXD5,view:normalised
#     &start=2010-03-31T00:00:00Z&end=2010-05-01T00:00:00Z")

base_URL = 'https://api.refinitiv.com'
category_URL = '/file-store'
RDP_version = '/v1'
service_endpoint_URL = '/file-sets'

query_parms = {
    'bucket': 'TICKHISTORY_VBD_UNLIMITED',
    'attributes': {'venue': 'FXD5', 'view': 'normalised'},
    'contentFrom': '2010-04-01T00:00:00Z',
    'contentTo':'2010-04-30T00:00:00Z'
}

endpoint_url = base_URL + category_URL + RDP_version + service_endpoint_URL

print("endpoint_URL", endpoint_url)

endpoint = rdp.Endpoint(session, endpoint_url)

print("endpoint", endpoint)

response = endpoint.send_request(method = rdp.Endpoint.RequestMethod.GET, query_parameters = query_parms)

print("Response Status", response.status)
print("data:", response.data.raw)

—-------- Output —-------------
endpoint_URL https://api.refinitiv.com/file-store/v1/file-sets
endpoint <refinitiv.dataplatform.delivery.data.endpoint.Endpoint object at 0x7ff38f090c70>
Response Status {'http_status_code': 200, 'http_reason': 'OK'}
data {'value': []}


Results show successful session established and successful endpoint send_request but GET method returns no data.

Thanks again for any help with this!

data-guide-tick-hist-matching.pdf (316.1 KiB)

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.

7 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by nick.zincone · May 27 at 02:46 PM

Hi @rw74

@zoya faberov and myself have been investigating the file_sets interface and believe it may be what you are after. For example:

response = cfs.file_sets.Definition(
    bucket = 'TICKHISTORY_VBD_UNLIMITED',
    attributes = {
        'venue': 'FXD5',
        'view': 'normalised'
    },
    content_from = "2010-04-01T00:00:00Z",
    content_to = "2010-04-30T00:00:00Z",    
    page_size=100
).get_data()

response.data.df

Give that a try and let us know if that is what you are looking for

Comment

People who like this

0 Show 0 · 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
Answer by nick.zincone · May 24 at 08:17 PM

Hi @rw74

The Refinitiv Data Library for Python provides an example to retrieve bulk Tick History data. I would suggest you explore that example to see it is works with your workflow.

Comment

People who like this

0 Show 0 · 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
Answer by rw74 · May 25 at 05:10 PM

Thanks @nick.zincone

I was able to make some progress with the example you provided, bulk Tick History, however, this example does not provide enough information for my specific request. I've looked at

help(cfs.buckets.Definition)

for argument definitions but either I am looking in the wrong place or the documentation is incomplete.


In the example you referred me to, the get_data() call is:

response = cfs.buckets.Definition('history').get_data()


How would I incorporate these parameters into this call?

name = "TICKHISTORY_VBD_UNLIMITED"

attributes = [{venue:FXD5, view:normalised}]

contentFrom = "2010-04-01T00:00:00Z"

contentTo = "2010-04-30T00:00:00Z"
Comment

People who like this

0 Show 0 · 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
Answer by nick.zincone · May 25 at 07:15 PM

Hi @rw74

Can you confirm the help you received from the following command you specified above?

help(cfs.buckets.Definition)

When I performed that command, I did receive some relevant output that would provide the necessary properties to set the values you are interested. That is:

ahs.png

The above output is from version:

1.0.0b10

I've followed up with the development group to provide an example Definition syntax to support your requirements. I will post the details here once I get word.

thanks.


ahs.png (60.1 KiB)
Comment

People who like this

0 Show 0 · 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
Answer by rw74 · May 25 at 08:19 PM

Hi @nick.zincone - Thanks for following up with the syntax on this. I spent quite a lot of time with help(cfs.buckets.Definition) trying many permutations of the parameter values and syntax. E.g. for attributes it says:

 attributes : list of str, optional
 |          List of publisher-defined bucket attributes.

What exactly are the publisher-defined bucket attribute strings?

thanks!

Comment

People who like this

0 Show 0 · 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
Answer by zoya faberov · May 25 at 08:46 PM

Hello @rw74 ,

I fully agree with @nick.zincone that RD library makes CFS -TickHistory retrieval much easier and less effort.

I have run a quick sanity check with RDP Postman starter example

Authentication-> Get Authentication Token

CFS -> CFS Tick History->Get TH File Sets for <VENUE> normalised+by Dates,

entering FXD5 for Venue and with your dates:

https://{
                {RDP_HOST}}/file-store/{
                {RDP_VERSION}}/file-sets?bucket={
                {RDP_TH_Bucket}}&attributes=venue:{
                {CFS_VBD_VENUE}},view:normalised&contentFrom=2010-04-01T00:00:00Z&contentTo=2010-04-30T00:00:00Z

I see the results for these dates- FileSets are returned.

If you are able to request with your creds with Postman, another way to check quickly, you could try with Python code included with the article Introduction to Client File Store (CFS) - Python , see Example - Retrieve Tick History File Sets for a Given Venue Limit By Dates

This could help understand where the issue is on your side, having something working and then moving to RD Library integration could also be considered.

Comment

People who like this

0 Show 0 · 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
Answer by rw74 · May 31 at 11:41 PM

@nick.zincone @zoya faberov

This worked for me!

@nick.zincone - The link you posted in your first reply, i.e., bulk Tick History, just needed the above tweak to get the file_sets I needed. The code to download the files was exactly as given in the bulk Tick History example.

Thank you both!


Comment

People who like this

0 Show 0 · 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.

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 IPA FX Volatility

How do I adjust Values of yAxis displayed on Matrix of FX Volatility Surface IPA?

Summaries.Definition("MyRIC").GetData() not working when invoking from WindowsFrom Application

Encountering multiple issues...

Refinitiv.dataplatform "search" get's stuck when called inside a function

  • 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
  • FX Venues
    • FX Trading – RFQ Maker
  • 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
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges