This endpoint is useful for finding detailed information about a particular
candidate. Use the candidate_id
to find the most recent information about
that candidate.
Usage
fec_get_candidate_candidate_id(
office,
candidate_status,
cycle,
sort_nulls_last,
state,
district,
year,
name,
sort_hide_null,
federal_funds_flag,
per_page,
page,
sort,
has_raised_funds,
election_year,
sort_null_only,
incumbent_challenge,
party,
candidate_id,
max_results = Inf,
max_reqs = Inf,
api_key = Sys.getenv("FEC_API_KEY", unset = "DEMO_KEY")
)
Arguments
- office
Federal office candidate runs for: H, S or P
- candidate_status
One-letter code explaining if the candidate is: - C present candidate - F future candidate - N not yet a candidate - P prior candidate
- cycle
Two-year election cycle in which a candidate runs for office. Calculated from Form 2. The cycle begins with an odd year and is named for its ending, even year. This cycle follows the traditional house election cycle and subdivides the presidential and Senate elections into comparable two-year blocks. To retrieve data for the entire four years of a presidential term or six years of a senatorial term, you will need the
election_full
flag.- sort_nulls_last
Toggle that sorts null values last
- state
US state or territory where a candidate runs for office
- district
Two-digit US House distirict of the office the candidate is running for. Presidential, Senate and House at-large candidates will have District 00.
- year
Retrieve records pertaining to a particular election year. The list of election years is based on a candidate filing a statement of candidacy (F2) for that year.
- name
Name (candidate or committee) to search for. Alias for 'q'.
- sort_hide_null
Hide null values on sorted column(s).
- federal_funds_flag
A boolean the describes if a presidential candidate has accepted federal funds. The flag will be false for House and Senate candidates.
- per_page
The number of results returned per page. Defaults to 20.
- page
For paginating through results, starting at page 1
- sort
Provide a field to sort by. Use
-
for descending order.- has_raised_funds
A boolean that describes if a candidate's committee has ever received any receipts for their campaign for this particular office. (Candidates have separate candidate IDs for each office.)
- election_year
Year of election
- sort_null_only
Toggle that filters out all rows having sort column that is non-null
- incumbent_challenge
One-letter code ('I', 'C', 'O') explaining if the candidate is an incumbent, a challenger, or if the seat is open.
- party
Three-letter code for the party affiliated with a candidate or committee. For example, DEM for Democratic Party and REP for Republican Party.
- candidate_id
A unique identifier assigned to each candidate registered with the FEC. If a person runs for several offices, that person will have separate candidate IDs for each office.
- max_results
The maximum number of results to return. Note that slightly more results may be returned if
max_results
is not evenly divisible by 100.- max_reqs
The maximum number of separate requests to perform. Passed to the max_reqs argument of
httr2::req_perform_iterative()
whennext_req
is supplied. The default2
should likely be changed toInf
after you validate the function.- api_key
An API key provided by the API provider. This key is not clearly documented in the API description. Check the API documentation for details.