knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
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.
# install.packages("remotes") remotes::install_github("news-r/newsapi")
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.
library(newsapi) news_sources() top_headlines("China") every_news("Trump")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.