Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

get_candidates_in_race

Get Candidates in Race


Description

Get Candidates in Race

Usage

get_candidates_in_race(
  state,
  chamber,
  district,
  cycle = 2018,
  return_value = c("results", "query"),
  page = 1,
  myAPI_Key
)

Arguments

state

State abbreviation

chamber

house or senate

district

house district

cycle

The election cycle in question, e.g. 2018

return_value

should results be retrieved, or query string returned.

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

The result of the API call (list), unless return_value=query (mostly for debugging), in which case the query string is returned.

Examples

get_candidates_in_race('MI', 'house', 11)

ProPublicaR

Access Functions for ProPublica's APIs

v1.1.1
GPL-3 | file LICENSE
Authors
Aleksander Dietrichson [aut, cre], Joselina Davit [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.