Package 'RPublica'

Title: ProPublica API Client
Description: Client for accessing data journalism APIs from ProPublica <https://www.propublica.org/>.
Authors: Thomas J. Leeper [aut, cre] , Jeroen Ooms [ctb], Diego Hernangómez [ctb]
Maintainer: Thomas J. Leeper <[email protected]>
License: GPL-2
Version: 0.1.3.9000
Built: 2024-12-03 06:28:27 UTC
Source: https://github.com/rOpenGov/RPublica

Help Index


Retrieve committees or committee

Description

Retrieve available committees, or a specific committee

Usage

committee(slug = NULL, ...)

Arguments

slug

An optional character string containing a "slug" referring to a political committee.

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

See Also

Other freethefiles: filing(), market(), station()

Examples

## Not run: 

committee("warren-for-senate-2012")

## End(Not run)

Retrieve filing

Description

Retrieve a specific filing, by ID

Usage

filing(id, ...)

Arguments

id

A character string containing a filing identification number.

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

See Also

Other freethefiles: committee(), market(), station()

Examples

## Not run: 

filing(51212)

## End(Not run)

Forensics API

Description

Retrieve details about a given state or system

Usage

geos(state = NULL, ...)

systems(id, ...)

Arguments

state

An optional character string containing a two-letter state postal code. If NULL, results for all available states are returned.

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

id

The identification number for a particular medical examiner or coroner system.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

References

API Documentation

Examples

## Not run: 

geos("48029")

systems(39)

## End(Not run)

Retrieve market or markets

Description

Retrieve available markets, or a specific market

Usage

market(slug = NULL, ...)

Arguments

slug

An optional character string containing a "slug" referring to a media market.

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

See Also

Other freethefiles: committee(), filing(), station()

Examples

## Not run: 

market("new-york")

## End(Not run)

Nonprofit Explorer

Description

Search for and retrieve nonprofit data

Usage

np_search(
  q = NULL,
  order = NULL,
  sort = NULL,
  state = NULL,
  ntee = NULL,
  subsection = NULL,
  ...
)

np_org(ein, ...)

Arguments

q

A character string containing a search query.

order

A character string containing a field by which to order the results. One of "name", "city", "state", "c_code", "fiscalyr", "revenue", "expenses", "assets", "liabilities", "pct_officer_compt". The ascending or descending sort by this parameter is controlled by sort.

sort

One of "asc" or "desc", controlling the order of the results (according the the ordering given in order).

state

A two-letter state postal abbreviation code for a U.S. state or territory. Use "ZZ" for foreign organizations.

ntee

A numeric value (between 1 and 10) containing a National Taxonomy of Exempt Entities (NTEE) Major Group code.

subsection

A numeric value (between 2 and 92) referring to a subsection of tax code section 501(c).

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

ein

An employer identification number (EIN).

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

Examples

## Not run: 
np_search("propublica")
np_org(142007220)

## End(Not run)

API Query

Description

Execute an API query

Usage

ppQuery(op, baseurl, args = NULL, verbose = FALSE, ...)

Arguments

op

A character string containing an API operation, and associated arguments.

baseurl

The base URL for conducting the API query.

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

...

Arguments passed on to httr::GET

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

Examples

## Not run: 
geos <- ppQuery("geos",
  baseurl = "http://projects.propublica.org/forensics/"
)

## End(Not run)

Retrieve station

Description

Retrieve station

Usage

station(callsign, ...)

Arguments

callsign

A character string containing a station callsign.

...

Arguments passed on to ppQuery, httr::GET

args

A character string containing additional URL-encoded parameters.

verbose

Whether to display informative messages on the query.

config

Additional configuration settings such as http authentication (authenticate()), additional headers (add_headers()), cookies (set_cookies()) etc. See config() for full details and list of helpers.

handle

The handle to use with this request. If not supplied, will be retrieved and reused from the handle_pool() based on the scheme, hostname and port of the url. By default httr requests to the same scheme/host/port combo. This substantially reduces connection time, and ensures that cookies are maintained over multiple requests to the same host. See handle_pool() for more details.

Value

The result of the query, typically a list object.

Author(s)

Thomas J. Leeper

See Also

Other freethefiles: committee(), filing(), market()

Examples

## Not run: 
station("WEWS-TV")

## End(Not run)