getData
Sends a request to the Refinitiv Data Platform to retrieve the news headlines data described by the News.Headlines.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 retrieve the last five news headlines from Google:
const definition = News.Headlines.Definition({
query: 'Google',
count: 5,
});
const response = await definition.getData();
console.log(response.data.table);
>
Response
versionCreated | text | storyId | sourceCode | |
---|---|---|---|---|
2022-09-20 05:16:30.884000 | 2022-09-20T05:16:30.884Z | Appreciated chance to discuss Google's commitment to India: Sunder Pichai after visiting Indian Embassy | urn:newsml:reuters.com:20220920:nNRAlxkksa:1 | NS:MINTNE |
2022-09-19 19:30:45.686000 | 2022-09-20T00:20:46.296Z | Lincoln Aerospace Holdings, Inc. -- C | urn:newsml:reuters.com:20220919:nEOL900vjZ:2 | NS:EDG |
2022-09-19 21:10:46.613000 | 2022-09-20T00:20:46.251Z | Lincoln Aerospace Holdings, Inc. -- C/A | urn:newsml:reuters.com:20220919:nEOLL9LPX:2 | NS:EDG |
2022-09-19 22:56:07.030000 | 2022-09-19T22:56:07.030Z | Alphabet (GOOGL) Gains But Lags Market: What You Should Know | urn:newsml:reuters.com:20220919:nNRAlxhdvn:1 | NS:ZACKSC |
2022-09-19 22:27:50 | 2022-09-19T22:27:50.000Z | Google vai usar edifício de fundo do Pátria em SP | urn:newsml:reuters.com:20220919:nL1N30Q2YY:1 | NS:RTRS |
The following example demonstrates how to retrieve the news headlines about Refinitiv for the last four days from 20.09.2022:
const definition = News.Headlines.Definition({
query: 'Refinitiv',
count: 3,
dateFrom: '20.09.2022',
dateTo: '24.09.2022',
});
const response = await definition.getData();
console.log(response.data.table);
>
Response
versionCreated | text | storyId | sourceCode | |
---|---|---|---|---|
2022-09-14 02:34:50.827000 | 2022-09-19T23:57:03.763Z | SERVICE ALERT - New Zealand Stock Exchange - INFORMATION see page |
urn:newsml:reuters.com:20220914:nVEN269079:15 | NS:RFT |
2022-08-30 16:30:23.300000 | 2022-09-19T23:51:57.959Z | SERVICE ALERT - Hong Kong Futures Exchange - INFORMATION see page |
urn:newsml:reuters.com:20220830:nVEN256587:57 | NS:RFT |
2022-08-18 15:19:54.248000 | 2022-09-19T23:46:52.322Z | SERVICE ALERT - PFTS Stock Exchange - INFORMATION see page |
urn:newsml:reuters.com:20220818:nVEN267524:92 | NS:RFT |
Related links
None.