knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Travis build status AppVeyor build status

newsapi

Get breaking news headlines, and search for articles from over 30,000 news sources and blogs with our news API.

News API integration with R.

Installation

# install.packages("remotes")
remotes::install_github("news-r/newsapi")

Setup

Create a free account at newsapi.org to create an API key.

newsapi_key("xxXXxxXx")

Note that you can specify the key as environment variable (NEWSAPI_API_KEY), likely in your .Renviron for convenience.

Example

library(newsapi)

news_sources()
top_headlines("China")
every_news("Trump")


news-r/newsapi documentation built on Feb. 27, 2020, 2:38 p.m.