Refinitiv Data Platform Library for TypeScript

getData

This method sends a request to the Refinitiv Data Platform to retrieve the data described in the FundamentalAndReference.Definition object.

Syntax

definition.getData(session?: Session)

Parameters

Value Description Data type Optional Default value
session Session object. If it's not passed the default session will be used. Session Yes -

Returned value

ContentResponse object.

Usage

The following example demonstrates how to get revenue and gross profit for IBM.N and TRI.N:

const definition = FundamentalAndReference.Definition({
    universe: ["TRI.N", "IBM.N"],
    fields: ["TR.Revenue", "TR.GrossProfit"],
});

const response = await definition.getData();

console.log(response.data.table);
Response
Instrument Revenue Gross Profit
0 TRI.N 6348000000 6022000000
1 IBM.N 57350000000 31485000000

The following example demonstrates how to get revenue and gross profit for all constituents of the chain:

const definition = FundamentalAndReference.Definition({
    universe: '0#.DJI',
    fields: ["TR.Revenue", "TR.GrossProfit"],
});

const response = await definition.getData();

console.log(response.data.table);
Response
Instrument Revenue Gross Profit
0 GS.N 64989000000.0 54629000000.0
1 NKE.N 44538000000.0 19997000000.0
2 CSCO.OQ 49818000000.0 31894000000.0
3 JPM.N N/A N/A
4 DIS.N 67418000000.0 22287000000.0
5 INTC.OQ 79024000000.0 43815000000.0
6 DOW.N 54968000000.0 10777000000.0
7 MRK.N 48704000000.0 35463000000.0
8 CVX.N 155606000000.0 66234000000.0
9 AXP.N 42838000000.0 29380000000.0
10 VZ.N 133613000000.0 77312000000.0
11 HD.N 151157000000.0 50832000000.0
12 WBA.OQ 132509000000.0 28067000000.0
13 MCD.N 23222900000.0 12580200000.0
14 UNH.N N/A N/A
15 KO.N 38655000000.0 23298000000.0
16 JNJ.N 93775000000.0 63920000000.0
17 MSFT.OQ 168088000000.0 115856000000.0
18 HON.OQ 34392000000.0 10998000000.0
19 CRM.N 26492000000.0 19466000000.0
20 PG.N 76118000000.0 39144000000.0
21 IBM.N 57350000000.0 31485000000.0
22 MMM.N 35355000000.0 16579000000.0
23 AAPL.OQ 365817000000.0 152836000000.0
24 WMT.N 572754000000.0 143754000000.0
25 CAT.N 50971000000.0 15517000000.0
26 AMGN.OQ 25979000000.0 19525000000.0
27 V.N 24105000000.0 19135000000.0
28 TRV.N N/A N/A
29 BA.N 62286000000.0 3017000000.0

The data is retrieved by default from the UDF platform. To get data from the RDP platform instead, it is necessary
to set the underlying platform to 'rdp' before calling the getData function (note that the underlying platform
can be either 'udf' or 'rdp').

The following example demonstrates how to get revenue and gross profit for TRI.N and IBM.N using date as a row header from the RDP platform:

const definition = FundamentalAndReference.Definition({
    universe: ["TRI.N", "IBM.N"],
    fields: ["TR.Revenue", "TR.GrossProfit"],
    rowHeaders: FundamentalAndReference.RowHeaders.Date
});

config.set('apis.data.datagrid.underlying-platform', 'rdp');

const response = await definition.getData();

console.log(response.data.table);
Response
TRI.N IBM.N
Revenue Gross Profit Revenue Gross Profit
Date
2021-12-31
6348000000 6022000000 57350000000 31485000000

None.