pp_query: Execute a query against the ProPublica API

View source: R/pp_query.R

pp_queryR Documentation

Execute a query against the ProPublica API

Description

This function is primarily meant to be used by other functions in the package, but is made available in case a "raw query" is required.

Usage

pp_query(
  query,
  API = c("campaign-finance", "congress"),
  version = "v1",
  page = 1,
  myAPI_Key
)

Arguments

query

The query to be executed

API

Which API are you accessing

version

API version. Currently v1.

page

Results come in batches of 20. The page parameter specifies which one to retrieve.

myAPI_Key

API key from Propublica To use the congress API, you must sign up for an API key.

Value

a list object with the return values.

Examples

## Not run: 
pp_query('115/bills/hr21.json', API = 'congress', version='v1')
pp_query('2018/races/MI/house/11.json', API='campaign-finance',version='v1')

## End(Not run)

ProPublicaR documentation built on Sept. 8, 2023, 5:53 p.m.