get_news_headlines: get_news_headlines

Description Usage Arguments Examples

Description

Returns a data frame contianing the news headlines

Usage

1
2
3
get_news_headlines(query = "Topic:TOPALL and Language:LEN",
  count = 10L, date_from = NULL, date_to = NULL,
  raw_output = FALSE, debug = FALSE)

Arguments

query:

string, optional. Search criteria for the news headlines The query can contain RIC codes, company names, country names and operators (AND, OR, NOT, IN, parentheses and quotes for explicit search…). Tip: Append 'R:' in front of RIC names to improve performance. Default: Top News written in English

count:

int, optional. The maximum number of headlines to retrieve. Value Range: [1-100]. Default: 10

date_from:

string. Beginning of date range. String format is:'%Y-%m-%dT%H:%M:%S'. e.g. 2016-01-20T15:04:05.

date_to:

string. End of date range. String format is: '%Y-%m-%dT%H:%M:%S'. e.g. "2016-01-20T15:04:05".

raw_output:

boolean. Set this parameter to True to get the data in json format if set to False, the function will return a data frame The default value is False

debug:

boolean. If this parameter is set to True, the json request and response are printed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
--------
> set_app_id('set your app id here')
> headlines = ek.get_news_headlines("R:MSFT.O", 2)
> print(headlines)
versionCreated                                              text \
2016-04-13 18:28:57.000 2016-04-13 18:28:59.001 RBC Applies Blockchain as a Loyalty Boost<MSFT...
2016-04-13 17:28:21.577 2016-04-13 17:28:21.671 UPDATE 2-Long-stalled email privacy bill advan...
storyId
2016-04-13 18:28:57.000    urn:newsml:reuters.com:20160413:nNRA1uxh03:1
2016-04-13 17:28:21.577    urn:newsml:reuters.com:20160413:nL2N17G16Q:2

> headlines = ek.get_news_headlines("R:MSFT.O IN FRANCE")
> headlines = ek.get_news_headlines("R:MSFT.O IN FRANCE IN ENGLISH", count=5)
> headlines = ek.get_news_headlines("OBA* OR CLINTON IN ENGLISH", count=5)

ahmedmohamedali/eikonapir documentation built on May 10, 2019, 7:35 a.m.