Workspace Web Integration Capabilities

Fundamental & Reference example

Overview

Fundamental and Reference data is a wide array of reference data content including Fundamentals, Prices, Estimates, Indexes, Corporate Actions, Fixed Income, Lipper, Ownership, etc.

The example below contains three requested instruments - International Business Machines corp., Google, Microsoft corp. In the parameter Fields we can specify values that we want to retrieve data for. As a consequence, in our example, we will get the latest available closing price, volume for the latest trading day and low price for the latest trading day for the mentioned above instruments.

Example Code with async/await

    	
            

const { ContainerSession, FundamentalAndReference } = window['@refinitiv/dataplatform-containersession'];

const sxs = window.sxsWeb;

// For users, who use a private network

// sxs("config", "use-network", "private");

sxs.start(new Date());

sxs.onLoad(async () => {

  console.log('[DEMO] WebSDK Loaded at time: ' + new Date());

  const dataSession = ContainerSession.Definition({

    appKey: 'InputAppKeyHere',

    bus: sxs

  }).getSession();

     

  try {

      await dataSession.open();

      const fundAndRefDefinition = FundamentalAndReference.Definition({

        universe: ['IBM', 'GOOGL.O', 'MSFT.O'],

        fields: ['TR.PriceClose', 'TR.Volume', 'TR.PriceLow'],

        parameters: { SDate: '0CY', Scale: 6 }

      });

      const response = await fundAndRefDefinition.getData(dataSession);

      console.log('get Data result:', response.data.raw);

   

    } catch (e) {

        console.log(e);

    } finally {

      await dataSession.close(); 

    }

});

Example package

All our examples are available here for download