powered by
Get Candidates in Race
get_candidates_in_race( state, chamber, district, cycle = 2018, return_value = c("results", "query"), page = 1, myAPI_Key )
The result of the API call (list), unless return_value=query (mostly for debugging), in which case the query string is returned.
return_value=query
State abbreviation
house or senate
house district
The election cycle in question, e.g. 2018
should results be retrieved, or query string returned.
Results come in batches of 20. The page parameter specifies which one to retrieve.
API key from Propublica To use the congress API, you must sign up for an API key.
if (FALSE) { get_candidates_in_race('MI', 'house', 11) }
Run the code above in your browser using DataLab