News.Headlines.Definition object
This object creates the definition of information about particular news headlines that we want to get.
Syntax
News.Headlines.Definition(params: News.Headlines.Params)
Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
params | An object literal of type News.Headlines.Params | object | No | - |
News.Headlines.Params properties :
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
query | The user search query | string | No | - |
count | The number of headlines | number | Yes | 10 |
dateFrom | Beginning of the date range | string | Yes | - |
dateTo | End of the date range | string | Yes | - |
sort | The sorting order (see News.Headlines.SortDirection below) | SortDirection | Yes | - |
relevance | The relevance of headlines (see News.Headlines.Relevancy below) | Relevancy | Yes | - |
extendedParams | Additional parameters to apply to the request | object | Yes | - |
News.Headlines.SortDirection defines the possible values for sorting order
Name | Value |
---|---|
SortDirection.NewToOld | 'NewToOld' |
SortDirection.OldToNew | 'OldToNew' |
News.Headlines.Relevancy defines the possible values for the relevance of the news headlines
Name | Value |
---|---|
SortDirection.High | 'High' |
SortDirection.Medium | 'Medium' |
SortDirection.All | 'All' |
Returned value
ContentDefinition
object.
Usage
The following example demonstrates how to create the news headlines definition object to get last 20 news headlines about Google.
import { News } from '@refinitiv-data/data';
const definition = News.Headlines.Definition({
query: 'Google',
count: 20,
});
`
Related Links
None.