newsapiArticles: newsapiArticles

Description Usage Arguments

View source: R/newsapiArticles.R

Description

A function to retrieve articles from newsapi.org

Usage

1
newsapiArticles(key = Sys.getenv("NEWSAPI_KEY"), source, sortBy = "top")

Arguments

key

(required) - Your API key. Alternatively you can provide this via the X-Api-Key HTTP header.

source

(required) - The identifer for the news source or blog you want headlines from. Use newsapiSources endpoint to locate this or use the sources index.

sortBy

(optional) - Specify which type of list you want. The possible options are "top", "latest" and "popular". Note: not all options are available for all sources. Default: top.

"top" - Requests a list of the source's headlines sorted in the order they appear on its homepage.

"latest" - Requests a list of the source's headlines sorted in chronological order, newest first.

"popular" - Requests a list of the source's current most popular or currently trending headlines.


rmnppt/newsR documentation built on May 19, 2019, 8:24 a.m.