static void Main(string[] args) { try { // Create the platform session. using (ISession session = Configuration.Sessions.GetSession()) { // Open the session session.Open(); // ******************************************************************************************** // Basic Endpoint retrieval. // The specific endpoint URL below contains all required parameters. // ******************************************************************************************** var endpointUrl = "https://api.refinitiv.com/data/historical-pricing/v1/views/events/VOD.L"; // Request and display the timeseries data using the endpoint default parameters. DisplayResult(EndpointRequest.Definition(endpointUrl).GetData()); // Apply the same request but override the default 'count' which returns the number of hits. DisplayResult(EndpointRequest.Definition(endpointUrl).QueryParameter("count", "5").GetData()); } } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************"); } }
static void Main(string[] _) { const string dataGridEndpoint = "https://api.refinitiv.com/data/datagrid/beta1/"; try { // Create the platform session. using (ISession session = Configuration.Sessions.GetSession()) { // Open the session session.Open(); // Create the DataGrid endpoint definition var endpoint = EndpointRequest.Definition(dataGridEndpoint).Method(EndpointRequest.Method.POST); // Simple request var response = endpoint.BodyParameters(new JObject() { { "universe", new JArray("TRI.N", "IBM.N") }, { "fields", new JArray("TR.Revenue", "TR.GrossProfit") } }) .GetData(); DisplayResponse(response); // Global parameters response = endpoint.BodyParameters(new JObject() { { "universe", new JArray("GOOG.O", "AAPL.O") }, { "fields", new JArray("TR.RevenueMean", "TR.NetProfitMean") }, { "parameters", new JObject() { { "SDate", "0M" }, { "Curn", "EUR" } } } }).GetData(); DisplayResponse(response); // Historical data with specific date range response = endpoint.BodyParameters(new JObject() { { "universe", new JArray("BHP.AX") }, { "fields", new JArray("TR.AdjmtFactorAdjustmentDate", "TR.AdjmtFactorAdjustmentFactor") }, { "parameters", new JObject() { { "SDate", "1980-01-01" }, { "EDate", "2018-09-29" } } } }).GetData(); DisplayResponse(response); } } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************"); } }
static void Main(string[] _) { const string intradayEndpoint = "https://api.refinitiv.com/data/quantitative-analytics/v1/financial-contracts"; try { // Create the platform session. using (ISession session = Configuration.Sessions.GetSession()) { // Open the session session.Open(); // IPA - Financial Contracts (Option) var response = EndpointRequest.Definition(intradayEndpoint).Method(EndpointRequest.Method.POST) .BodyParameters(new JObject() { ["fields"] = new JArray("ErrorMessage", "UnderlyingRIC", "UnderlyingPrice", "DeltaPercent", "GammaPercent", "RhoPercent", "ThetaPercent", "VegaPercent"), ["universe"] = new JArray(new JObject() { ["instrumentType"] = "Option", ["instrumentDefinition"] = new JObject() { ["instrumentCode"] = "AAPLA192422500.U", ["underlyingType"] = "Eti" }, ["pricingParameters"] = new JObject() { ["underlyingTimeStamp"] = "Close" } }) }).GetData(); if (response.IsSuccess) { Console.WriteLine(response.Data.Raw["data"]); } else { Console.WriteLine($"Request failed: {response.HttpStatus}"); } } } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************"); } }
static void Main(string[] args) { try { // Create the platform session. using (ISession session = Configuration.Sessions.GetSession()) { // Open the session session.Open(); // ******************************************************************************************** // Define the news headline URL - we need this to retrieve the story ID. // ******************************************************************************************** var headlineUrl = "https://api.refinitiv.com/data/news/v1/headlines"; // Request for the headline based on the following query var query = "Adidas searchIn:HeadlineOnly"; var response = EndpointRequest.Definition(headlineUrl).QueryParameter("query", query).GetData(); // The headline response will carry the story ID. var storyId = GetStoryId(response); if (storyId != null) { Console.WriteLine($"\nFirst headline returned: {response.Data?.Raw["data"]?[0]["newsItem"]?["itemMeta"]?["title"]?[0]?["$"]}"); Console.Write($"Hit <Enter> to retrieve story [{storyId}]: "); Console.ReadLine(); // Display the headline and story. First, define the story endpoint Url. // The URL contains a path token {storyId} which will be replaced by the story ID extracted. var storyUrl = "https://api.refinitiv.com/data/news/v1/stories/{storyId}"; // Retrieve and display the story based on the ID we retrieved from the headline DisplayStory(EndpointRequest.Definition(storyUrl).PathParameter("storyId", storyId).GetData()); } else { Console.WriteLine($"Problems retrieving the story ID:{Environment.NewLine}{response.HttpStatus}"); } } } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************"); } }
static void Main(string[] args) { try { // Create the platform session. using (ISession session = Configuration.Sessions.GetSession()) { // Open the session session.Open(); // Create the symbology lookup endpoint definition var endpoint = EndpointRequest.Definition(symbolLookupEndpoint).Method(EndpointRequest.Method.POST); // RIC to multiple identifiers Console.WriteLine("\nRIC to multiple identifiers..."); Display(endpoint.BodyParameters(new JObject() { ["from"] = new JArray(new JObject() { ["identifierTypes"] = new JArray("RIC"), ["values"] = new JArray("MSFT.O") }), ["to"] = new JArray(new JObject() { ["identifierTypes"] = new JArray("ISIN", "LEI", "ExchangeTicker") }), ["type"] = "auto" }).GetData()); // Legal Entity Identifier (LEI) to multiple RICs Console.WriteLine("LEI to multiple RICs..."); Display(endpoint.BodyParameters(new JObject() { ["from"] = new JArray( new JObject() { ["identifierTypes"] = new JArray("LEI"), ["values"] = new JArray("INR2EJN1ERAN0W5ZP974") }), ["to"] = new JArray( new JObject() { ["identifierTypes"] = new JArray("RIC") }), ["type"] = "auto" }).GetData()); // CUSIP Internation Numbering System (CINS) to multiple RICs Console.WriteLine("CINS to RIC..."); Display(endpoint.BodyParameters(new JObject() { ["from"] = new JArray( new JObject() { ["identifierTypes"] = new JArray("CinsNumber"), ["values"] = new JArray("N7280EAK6") }), ["to"] = new JArray( new JObject() { ["identifierTypes"] = new JArray("RIC") }), ["type"] = "auto" }).GetData()); } } catch (Exception e) { Console.WriteLine($"\n**************\nFailed to execute: {e.Message}\n{e.InnerException}\n***************"); } }