-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
54 lines (39 loc) · 1.21 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
output:
github_document:
html_preview: false
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
<!-- badges: start -->
[![Travis build status](https://travis-ci.org/news-r/newsapi.svg?branch=master)](https://travis-ci.org/news-r/newsapi)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/news-r/newsapi?branch=master&svg=true)](https://ci.appveyor.com/project/news-r/newsapi)
<!-- badges: end -->
# newsapi
> Get breaking news headlines, and search for articles from over 30,000 news sources and blogs with our news API.
[News API](https://newsapi.org) integration with R.
## Installation
``` r
# install.packages("remotes")
remotes::install_github("news-r/newsapi")
```
## Setup
Create a free account at [newsapi.org](https://newsapi.org/) to create an API key.
```r
newsapi_key("xxXXxxXx")
```
Note that you can specify the key as environment variable (`NEWSAPI_API_KEY`), likely in your `.Renviron` for convenience.
## Example
```{r}
library(newsapi)
news_sources()
top_headlines("China")
every_news("Trump")
```