1. Home
  2. Article Catalog
  3. Getting Start with Refinitiv Data Platform

Article

Getting Started with Refinitiv Data Platform

Veerapath Rungruengrayubkul
Developer Advocate Developer Advocate
Wasin Waeosri
Developer Advocate Developer Advocate

Introduction

Update: February 2021

This guide will provide you step by step on how to start using the Refinitiv Data Platform (RDP) with the Refinitiv Data Platform Library. You also get links to useful documentation and support. If you complete these steps, you should be ready to make your first request for content from the Refinitiv Data Platform.

Although almost instructions on this guide is on the Refinitiv Data Platform Library, non Refinitiv Data Platform Library user (i.e. Refinitiv Real-Time API, Websocket or REST API client) can gain benefit by following the Setup Credential and User Account section to setup your credential.

Identify your Refiniv Data Platform user in the Welcome email

First, we need you to identify the credential types in the Welcome email before continuing next step. Refinitv Data Platform provides two type of credential for access. Each credential has different steps for access setup.

  • Machine ID: Identifier for machine allowing access to contracted content and APIs on production. The Machine ID generally is used for Refinitiv Real-time Optimized product. For example: GE-A-01234560-1-1234.             
  • User ID: Identifier for user allowing access to contracted content and APIs on production. It normally is email address of user. The user ID generally is used for Refinitiv Data Platform non real-time product. For example: sample@refinitiv.com 

 

Next, please continue of the steps to setup credential and run basic functions. Below the the name  of section for each user type. 

  • Getting Started for Machine ID
  • Getting Started for User ID

Finally, please see the "Support Material & Resource" section for useful meterial and support channel.

 

Getting Started for Machine ID

Below is the step by step to create an Python application to access Refeinitiv Data Platform API from the very begining.

Step1: Setup Credential and User account

The welcome email for Machine ID is as follows. It contains

  • Machine ID information, 
  • Instruction to create/verify account on MyRefinitv website. 
  • Link to Password Management to setup password
  • Register MyRefinitv

You need to ensure that you have a user in MyRefinitv [Step 1] - Click the provided link to verify and register a new user (if required) using the Requestor Email shown in the email.

  • Activate RDP MachineID

Next, the start of the Welcome email contains instructions and link [Step2] of the Welcome email to activate your Machine ID.
Please click the link to activate machine ID and set your password used to access RDP API.

  • Register your application

RDP Credential consists of 3 parts;

  1. UserID/MachineID,
  2. Password and
  3. AppKey (Client ID).

The APP Key is a unique ID defined for an application accessing to RDP Data and API. The first and second part is completed in the previous steps. For the AppKey, you need to register your application to generate it manually using the AppKey Generator tool. The AppKey is the data encryption key used to "encode" the messages between the end nodes and the RDP API. The AppKey is typically a random generated number. 

Below are the steps

  1. Open AppKey Generator and login with MyRefinitiv credential created on the Step#1.
  2. Input a unique meaningful name which help you identify your application.
  3. Tick the EDP API checkbox.
  4. Click “Register New App”, accept Terms & Conditions.
  5. The generated App Key will be in the App Key column.
  • Access Developer Community Portal

The Developer Community portal provides information on all Refinitiv APIs, documentation, sample code, and tutorials. In the RDP section of the portal, you will find everything you need to learn the RDP APIs. You are encouraged to review the available documentation in the Developer Community in addition to the information contained in this guide. The portal also introduces a Q&A forum that is dedicated to and can be most helpful with general questions and discussions centered around Refiniv API usage

You can do self-registration on the portal. The email can be any which can keep you anonymous which freely posts your question on the forum.

Step2: Setup Python environment and Refinitiv Data Platform library

Refinitiv Data Platform (RDP) provides streaming and non-streaming data through Websocket API/ Refinitiv Real-Time APIs interface and REST API respectively. User can create application using Websocket and HTTP library provided in any programming language to access RDP interface including user authentication.

Alternatively, user can use the Refinitiv Data Platform (RDP) Library which are ease-of-use APIs defining a set of uniform interfaces providing the developer access to the Refinitiv Data Platform. The libraries are available in Python, TypeScript/JavaScript and .NET.

In this guide, we will create Python application in Jupyter Notebook to access streaming real-time data from Refinitiv Data Platform - Refinitiv Real-time Optimized. For non-real time data, you can find more samples on the RDP library on Discover our Refinitiv Data Platform Library (part 1) and Discover our Refinitiv Data Platform Library (part 2).

  • Install Jupyter Notebook/Anaconda

Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. You can follow the instructions on this page to install Jupyter Notebook in your machine.

  • Install RDP Library

From the start menu open up the Anaconda Prompt (Anaconda3) and enter the following command.

pip install refinitiv-dataplatform


Step3: Create Refinitiv Real-Time Optimized Python application in Jupyter Notebook

1.    Open Jupyter Lab, then select “New” -> “Python 3” Notebook to create a new notebook.

2.    Define variables to store RDP credentials. Please change the values to your RDP User ID, password and App key, and then save the file to ‘credentials.ipynb’

    	
            

RDP_LOGIN = '<RDP Machine ID>'

RDP_PASSWORD = '<RDP Password>'

APP_KEY = '<APP Key>'

3.    Save the file, and then create a new notebook file

4.    Import Refinitiv Data Platform API library and Credential file.

    	
            

import refinitiv.dataplatform as rdp

import pandas

%run ./credentials.ipynb

5.    Create RDP OpenPlatform Session to connect to RDP.

    	
            session = rdp.open_platform_session(
    APP_KEY,
    rdp.GrantPassword(
        username = RDP_LOGIN,
        password = RDP_PASSWORD
    )
)

6.    Create Streaming request including RIC, field name and how event callback functions are handled.  

    	
            

import json

pricing = rdp.StreamingPrices(session = session, 

    universe = ['CHF=','GBP=', 'EUR='],

    fields = ['BID', 'ASK','DSPLY_NAME','OPEN_PRC','HST_CLOSE'],

    on_refresh = lambda streaming_price, name, fields : print("Refresh for {} :\n{}".format(name,json.dumps(fields, indent=2))),

    on_update = lambda streaming_price, name, fields : print("Update for {} :\n{}".format(name,json.dumps(fields, indent=2))),

    on_status = lambda streaming_price, name, status : print("Status for {} : {}".format( name, status))    

)

7.    Open the request.

    	
            pricing.open()
        
        
    

8.    The application should receive streaming data as follows.         

Getting Started for User ID

Below are the steps by steps to create a Python application to access Refeinitiv Data Platform API from the very beginning.

Step1: Setup Credential and User account

The welcome email for User ID is as follows.

  • Access Developer Community Portal

The Developer Community portal provides information on all Refinitiv APIs, documentation, sample code, and tutorials. In the RDP section of the portal, you will find everything you need to learn the RDP APIs. You are encouraged to review the available documentation in the Developer Community in addition to the information contained in this guide. The portal also introduces a Q&A forum which is dedicated to and can be most helpful with general questions and discussions centered around Refiniv API usage

You can do self-registration on the portal [Step1]. The registered email can be any which can keep you anonymous which freely posts your question on the forum.

  • Activate RDP User ID

The Welcome email you received contains instructions to access API Playground [Step2]

You will see the following Login page, and then click "Forgotten your password?". 

Input your User ID (email) and click "OK". You will receive a reset password email to set your password.

  • Access API Playground

The API Playground is a front end to the APIs via a Graphical User Interface (GUI). It acts as an interactive reference guide and tool. It allows to experiment with the APIs, send requests, view responses, and review Swagger documentation. The API Playground URL is: https://apidocs.refinitiv.com/Apps/ApiDocs

You can use your RDP credential to access the API Playground.

         The API Playground provides various of useful materials such as:

  • References to RDP APIs
  • API Playground which allows you to try the API endpoints with your RDP credentials
  • Swagger document

Below is the sample API Playground for the Environmental Social Governance - Basic View which will be used for the demonstration in this guide.

In the Playground, you can select sample of request [1] and click Send [2]. The result will display in Response tab with HTTP Status and data [3].

For more details and sample usages about the API Playground, please see the API Playground section in the RDP API General Guidelines document.

Please note that the permission to access the API Playground depends on your license.

  • Register your application

RDP Credential consists of 3 parts;

  1. UserID/MachineID,
  2. Password and
  3. AppKey (Client ID).

The APP Key is a unique ID defined for an application accessing to RDP Data and API. The first and second part is completed in the previous steps. For the AppKey, you need to register your application to generate it manually using the AppKey Generator tool. The AppKey is the data encryption key used to "encode" the messages between the end nodes and the RDP API. The AppKey is typically a randomly generated number. 

Below are the steps

1.    On API DOCs page, open AppKey Generator on the top left.

2.    Input a unique meaningful name which helps you identify your application.

3.    Tick the EDP API checkbox.

4.    Click “Register New App”, accept Terms & Conditions.

5.    The generated App Key will be in the App Key column.

Step2: Setup Python environment and Refinitiv Data Platform library

Refinitiv Data Platform (RDP) provides streaming and non-streaming data through Websocket API/Refintiv Real-Time APIs interface and REST API respectively. User can create an application using Websocket and HTTP library provided in any programming language to access RDP interface including user authentication. Alternatively, user can use the Refinitiv Data Platform (RDP) Library which are ease-of-use APIs defining a set of uniform interfaces providing the developer access to the Refinitiv Data Platform. The libraries are available in Python, TypeScript/JavaScript and .NET.

In this guide, we will create a Python application in Jupyter Notebook to access the Environmental Social Governance (ESG) data from Refinitiv Data Platform. You can find more samples/usages on the RDP library on Discover our Refinitiv Data Platform Library (part 1) and Discover our Refinitiv Data Platform Library (part 2).

  • Install Jupyter Notebook/Anaconda

Jupyter Notebook is a web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. You can follow the instructions on this page to install Jupyter Notebook in your machine.

  • Install RDP Library

From the start menu, open the Anaconda Prompt (Anaconda3) and enter the following command.

pip install refinitiv-dataplatform
 

Step3: Create Ekektron Real-time in Cloud Python application in Jupyter Notebook

1.    Open Jupyter Lab, then select “New” -> “Python 3” Notebook to create a new notebook.

2.    Define variables to store RDP credentials. Please change the values to your RDP User ID, password and App key, and then save the file to ‘credentials.ipynb’

    	
            

RDP_LOGIN = '<RDP User ID>'

RDP_PASSWORD = '<RDP Password>'

APP_KEY = '<APP Key>'

3.    Save the file, and then create a new notebook file

4.    Import Refinitiv Data Platform API library and Credential file.

    	
            

import refinitiv.dataplatform as rdp

import pandas

%run ./credentials.ipynb

5.    Create RDP OpenPlatform Session to connect to RDP.

    	
            session = rdp.open_platform_session(
    APP_KEY,
    rdp.GrantPassword(
        username = RDP_LOGIN,
        password = RDP_PASSWORD
    )
)

6.    Define endpoint to the Refinitiv Data Platform – Environmental Social Governance/View/Basic

    	
            endpoint = rdp.Endpoint( session = session, # Optionnal url = "https://api.refinitiv.com/data/environmental-social-governance/v1/views/basic", )
        
        
    

7.    Open the request which specifies an input identifier and HTTP Request Method.

    	
            response = endpoint.send_request( method = rdp.Endpoint.RequestMethod.GET, query_parameters = {'universe':'IBM.N'} )
        
        
    

8.    Display result

    	
            if response.is_success: headers = [h['name'] for h in response.data.raw['headers']] df = pandas.DataFrame(data=response.data.raw['data'], columns=headers) display(df)
        
        
    

Finally, you will get the result as follows.

Support Material & Resource

 

Developer Community Portal

The Developer Community portal provides information on all Refinitiv APIs, documentation, sample code, and tutorials. In the RDP section of the portal, you will find everything you need to learn the RDP APIs. You are encouraged to review the available documentation in the Developer Community in addition to the information contained in this guide.

You can do self-registration on the portal. The email can be any which can keep you anonymous which freely posts your question on the forum.

The API page provides various types of useful resources such as Quick Start guide, tutorials, and API documentation.

This forum is dedicated to and can be most helpful with general questions and discussions centered around Refiniv API usage, most of the members of the forum are developers, moderators are API experts.

MyRefinitiv Support

For incident support (i.e. connectivity issue ) and content related query, you can open a case directly to API product support via MyRefinitiv Get Support.

You can submit a query with the following steps.

1.    Select query topic

2.    Select Product which have prefix: "Refinitiv Data Platform".

3.    Provide more details about issue.

Github

You can also find more sample Python codes for Refinitiv Data Platform Library on the Github.