View source: R/newsapiArticles.R
A function to retrieve articles from newsapi.org
1 | newsapiArticles(key = Sys.getenv("NEWSAPI_KEY"), source, sortBy = "top")
|
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 |
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. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.