Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/news-r/stocknews

📈 Access Stock News API from R
https://github.com/news-r/stocknews

api media news r rstats

Last synced: about 1 month ago
JSON representation

📈 Access Stock News API from R

Awesome Lists containing this project

README

        

---
output: github_document
---

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

[![Travis build status](https://travis-ci.org/news-r/stocknews.svg?branch=master)](https://travis-ci.org/news-r/stocknews)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/news-r/stocknews?branch=master&svg=true)](https://ci.appveyor.com/project/news-r/stocknews)

# stocknews

Access [Stock News API](https://stocknewsapi.com) from R.

## Installation

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

## Setup

Create a free account at [stocknewsapi.com](https://stocknewsapi.com) to create an API key.

```r
stocknews_key("xxXXxxXx")
```

Note that you can specify the `STOCKNEWS_API_KEY` key as an environment variable in your `.Renviron` for convenience.

## Example

```{r}
library(stocknews)

tickers <- sn_tickers(c("AMZN", "GOOG"))
(sections <- sn_category("general"))
```