https://github.com/brachunok/RPublica
ProPublica API Client
https://github.com/brachunok/RPublica
Last synced: 4 months ago
JSON representation
ProPublica API Client
- Host: GitHub
- URL: https://github.com/brachunok/RPublica
- Owner: brachunok
- Fork: true (rOpenGov/RPublica)
- Created: 2018-12-12T23:59:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-13T00:35:32.000Z (over 6 years ago)
- Last Synced: 2024-08-13T07:11:27.011Z (8 months ago)
- Language: R
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
- jimsghstars - brachunok/RPublica - ProPublica API Client (R)
README
# ProPublica API Client #
[](http://cran.r-project.org/package=RPublica)

[](https://travis-ci.org/rOpenGov/RPublica)The package is released under GPL-2 as part of the [rOpenGov](http://ropengov.github.io/) project. Licenses for the data depend on the particular API, but access to that data (regardless of license) through the APIs is allowed under [ProPublica's Data Terms of Use](http://www.propublica.org/about/propublica-data-terms-of-use).
The package serves as a client library for the (currently) three [ProPublica](http://www.propublica.org/) data journalism APIs:
- [Nonprofit Explorer](http://projects.propublica.org/nonprofits/api), which provides access to IRS Form 990 data on for every organization required to file a Form 990 (i.e., those claiming tax exempt status). These data are in the public domain.
- [Forensics](http://projects.propublica.org/forensics/api), which provides state- and county-level data about coroner and medical examiner systems. These data are released under a modified Creative Commons license.
- [Free the Files](https://projects.propublica.org/free-the-files/api), which provides access to political television spending data based on FCC filings in 33 swing markets. These data are released under a modified Creative Commons license.
## Installation ##
**RPublica** is [available on GitHub](http://github.com/rOpenGov/RPublica) and can (soon) be installed from within R from your favorite CRAN mirror:
```
install.packages("RPublica")
```And the latest development version, available here, can be installed directly using [devtools](http://cran.r-project.org/web/packages/devtools/index.html):
```
# install.packages("devtools")
library("devtools")
install_github("rOpenGov/RPublica")
```## Using the package ##
### Nonprofit Explorer ###
The [Nonprofit Explorer API](http://projects.propublica.org/nonprofits/api) functionality includes two functions: `npsearch`, to retrieve subsets of available organizations, and `np_org` to retrieve detailed information about a given organization including a direct link to the complete Form 990 for that organization (as a PDF).
```{r eval=TRUE, echo=TRUE}
library('RPublica')
str(np_search('propublica'), max=1)
str(np_org(142007220), max=1)
```### Forensics API ###
The [Forensics API](http://projects.propublica.org/forensics/api) functionality includes two functions: `geos`, to return data for a specific state, and `systems`, to return detailed data and statistics about specified medical examiner (or coroner) system.
```{r eval=TRUE, echo=TRUE}
library('RPublica')
g <- geos()
str(g[1:5])
str(geos('ny'))
str(systems(36), max=1)
```### Free the Files ###
The [Free the Files API](https://projects.propublica.org/free-the-files/api) functionality includes four functions: `market` (for retrieving available markets, or a specific market), `station` (for retrieving station-specific data`, `committee` (for retrieving sponsoring committees, or a specific such committee), and `filing` (for retrieving details of a specific filing). A codebook describing the values returned by each function is available at: https://projects.propublica.org/free-the-files/api.
```{r eval=TRUE, echo=TRUE}
library('RPublica')
str(market()[1:5])
m <- market('new-york')
s <- station('WEWS-TV')
str(committee())
ofa <- committee('obama-for-america')
str(filing(51212))
```