.NET Libraries for Eikon Data APIs Quick Start
The Eikon Data APIs provide simple access to users who require programmatic access to Refinitiv data on the desktop. These APIs are intended for Eikon users.
The APIs provide access to the following content sets:
- Fundamental and reference data
- Price time series
- News
- Symbology conversion
This document will explain how to install and use .NET libraries for Eikon Data APIs.
Note: This library is open-source, community-owned and not officially supported by Refinitiv.
Installation
The .NET Eikon Data APIs are 64-bit libraries that target the following .NET frameworks: .NET Framework 4.5, .NET Framework 4.5.1. .NET Framework 4.5.2, .NET Framework 4.6, .NET Framework 4.6.1, .NET Framework 4.6.2, .NET Framework 4.7, .NET Framework 4.7.1, .NET Framework 4.7.2, .NET Core 2.1, .NET Core 3.1, .NET 5.0, and .NET Standard 2.0. It is available in NuGet. It can be installed by using the following commands.
- Package Manager
- .Net CLI
- Paket CLI
Dependencies
The .NET Eikon Data APIs depends on the following libraries.
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6
- Newtonsoft.Json (>=13.0.1)
- Microsoft.Extensions.Logging (>=1.1.2)
- Deedle (>=2.3.0)
.NET Framework 4.6.1
- Newtonsoft.Json (>=130.1)
- Microsoft.Extensions.Logging (>=2.0.1)
- Deedle (>=2.3.0)
.NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2
- Newtonsoft.Json (>=130.1)
- Microsoft.Extensions.Logging (>=2.2.0)
- Deedle (>=2.3.0)
.NET Standard 2.0
- Newtonsoft.Json (>=12.0.3)
- Microsoft.Extensions.Logging (>=2.0.0)
- Microsoft.Data.Analysis (>=0.4.0)
.NET Core 2.1
- Newtonsoft.Json (>=12.0.3)
- Microsoft.Extensions.Logging (>=2.1.0)
- Microsoft.Data.Analysis (>=0.4.0)
.NET Core 3.1
- Newtonsoft.Json (>=12.0.3)
- Microsoft.Extensions.Logging (>=3.1.14)
- Microsoft.Data.Analysis (>=0.4.0)
net5.0
- Newtonsoft.Json (>=12.0.3)
- Microsoft.Extensions.Logging (>=5.0.0)
- Microsoft.Data.Analysis (>=0.4.0)
Note: Eikon Data APIs for .NET 5.0, .NET Core 2.1, 3.1, and .NET Standard 2.0 support DataFrame in Microsoft.Data.Analysis package.
Usage
After installing EikonDataAPI, the application can use the API by calling the Eikon.CreateDataAPI() static method to create an Eikon interface. This interface is an access point to all functionalities in Eikon Data APIs.
Then, the first method that must be called with the Eikon interface is Eikon.SetAppKey(). This method accepts one string argument that represents the application ID. The application ID identifies your application on Refinitiv Platform. You can get an application ID using the Application ID generator. For more information, please refer to the QuickStart guide.
After that, the application can call other retrieval methods prefixed with Get to retrieve the data. If there is an error when retrieving the data, these methods can throw EikonException. Therefore, the application needs to call retrieval methods inside try/catch block.
Data Frame vs Raw Interfaces
There are two types of retrieval methods in the libraries:
- The methods which return data in data frames, such as GetData, GetTimeSeries, and GetNewsHeadlines
- The methods which suffixed with Raw which return a data as a JSON string, such as GetDataRaw, GetTimeSeriesRaw, and GetNewsHeadlinesRaw
The libraries use Deedle to create a data frame from the retrieved raw data. A data frame is a structure containing multiple columns that share the same row key similar to a data table or a spreadsheet. Deedle provides many convenient methods to manipulate and analyze a data frame.
However, you can also use raw interfaces to retrieve a raw JSON String. Then it can be passed to other methods or libraries for logging, parsing, or analyzing.
Currently, Deedle doesn't support .NET Standard so Eikon Data APIs library for .NET Standard 2.0 only support raw interfaces which return the data as JSON strings.
Note: There is one exception for the GetNewsStory method which returns a string instead of a data frame.
Fundamental and reference data
You can use GetData() methods to retrieve fundamental and reference data. These methods accept three parameters.
| Name | Type | Description |
|---|---|---|
| instrument(s) | string, or list of string | Required: Single instrument or list of instruments to request. |
| fields | string, list of string, or list of TRField | Required: A single field as a string, such as 'TR.PriceClose' A list of fields, such as A list of TRFields, such as |
| parameters | dictionary | Optional: Dictionary of global parameters to request, such as new Dictionary { { "SDate", "2017-10-23"},{"EDate","2017-11-29" },{"Frq","D"},{"CH","Fd" },{"RH","IN" } } |
Examples
The following code retrieves fundamental data - Revenue and Gross Profit - for Google, Microsoft, and Facebook.
The output is:
You can specify additional parameters and request full year revenue and gross profit for the last 2 years scaled to millions and converted to Euros.
The output is:
Price time series
You can use GetTimeSeries() methods to retrieve historical data on one or several RICs. These methods accept eight parameters.
| Name | Type | Description |
|---|---|---|
| ric(s) | string or list of strings | Required: Single RIC or List of RICs to retrieve historical data for |
| startDate | string or DateTime | Required: Starting date and time of the historical range. String format is "yyyy-MM-dd", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", or "yyyy-MM-ddTHH:mm:ssZ" |
| endDate | string or DateTime | Required: End date and time of the historical range. String format is "yyyy-MM-dd", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", or "yyyy-MM-ddTHH:mm:ssZ" |
| interval | Interval enumeration | Optional: Data interval. Possible values: tick, minute, hour, daily, weekly, monthly, quarterly, yearly (Default: daily) |
| fields | List of TimeSeriesField enumerations | Optional: Use this parameter to filter the returned fields set. Available fields: TIMESTAMP, VALUE, VOLUME, HIGH, LOW, OPEN, CLOSE, COUNT. By default, all fields are returned |
| count | integer | Optional: Max number of data points retrieved |
| calendar | Calendar enumeration | Optional: Possible values: native, tradingdays, calendardays |
| Corax | Corax enumeration | Optional: Possible values: adjusted, unadjusted |
Example
The following code returns time series of daily price history for Microsoft Corp ordinary share between 1st of Jan and 10th of Jan 2018.
The output is:
News
You can use GetNewsHeadlines() methods to get a list of news headlines. These methods accept four parameters.
| Name | Type | Description |
|---|---|---|
| query | string | Optional: News headlines search criteria. The text can contain RIC codes, company names, country names and operators (AND, OR, NOT, IN, parentheses and quotes for explicit search…). (Default: Top News written in English) |
| count | integer | Optional: Max number of headlines retrieved. Value Range: [1-100]. (Default: 10) |
| dateFrom | string or DateTime | Optional: Beginning of date range. String format is "yyyy-MM-dd", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", or "yyyy-MM-ddTHH:mm:ssZ" |
| dateTo | string or DateTime | Optional: End of date range. String format is "yyyy-MM-dd", "yyyy-MM-ddTHH:mm:ss", "yyyy-MM-ddTHH:mm:sszzz", or "yyyy-MM-ddTHH:mm:ssZ" |
Examples
The following code retrieves news headlines on Deutsche Lufthansa AG (equity RIC: LHAG.DE), between 09:00 and 18:00 GMT on the 5th of Apr 2017.
The output is:
Then, you can use the GetNewsStory() method to retrieve a single news story corresponding to the identifier provided in StoryId. This method accepts one parameter.
| Name | Type | Description |
|---|---|---|
| storyId | string | Required: The story Id of the news story |
This method returns a string of story text.
Example
The following code retrieves the news story of the first retrieved news headline.
The output is the HTML of the news story.
Symbology conversion
You can call GetSymbology() methods to get a list of instrument names converted into another instrument code, such as converting SEDOL instrument names to RIC names. These methods accept four parameters.
| Name | Type | Description |
|---|---|---|
| symbol(s) | string or list of strings | Required:Single instrument or list of instruments to convert |
| fromSymbolType | SymbologyType enumeration | Optional: Instrument code to convert from. Possible values: RIC,ISIN,CUSIP,SEDOL,ticker,lipperID,OAPermID,or IMO (Default: RIC) |
| toSymbolType | List of SymbologyType enumeration | Optional: List of instrument code to convert to. Possible values: RIC,ISIN,CUSIP,SEDOL,ticker,lipperID,OAPermID,or IMO |
| bestMatch | boolean | Optional:Defines whether "bestMatch" section only is required. (Default: true) |
Example
The following code converts RICs to ISINs and tickers and returns only best match.
The output is:
Logging
The libraries use the Microsoft.Extensions.Logging package for logging. To support console log, it requires the Microsoft.Extensions.Logging.Console package. After adding this package, you can use the following code to enable console logging with debug level.
For Microsoft.Extensions.Logging and Microsoft.Extensions.Logging.Console 6.0.0, use the following code.
Summary
.NET 64 bit Eikon Data APIs are available in nuget which support .NET Framework 4.5, .NET Framework 4.5.1. .NET Framework 4.5.2, .NET Framework 4.6, .NET Framework 4.6.1, .NET Framework 4.6.2, .NET Framework 4.7, .NET Framework 4.7.1, .NET Framework 4.7.2, .NET Core 2.1, .NET Core 3.1, .NET 5.0, and .NET Standard 2.0.
It provides access to the following content sets:
- Fundamental and reference data
- Price time series
- News
- Symbology conversion
The retrieval methods format and return data as a Deedle or Microsoft.Data.Analysis data frame for ease of use. However, users can decide to retrieve data as a raw JSON string by using raw interfaces. However, for .NET Standard 2.0, it only supports raw interfaces.