Skip to contents

Fetch basic information about candidates and their principal committees. Each result reflects a unique FEC candidate ID. That ID is assigned to the candidate for a particular office sought. If a candidate runs for the same office over time, that ID stays the same. If the same person runs for multiple offices — for example, a House candidate runs for a Senate office — that candidate will get a unique ID for each office. The candidate endpoints primarily use data from FEC registration Form 1 for committee information and Form 2 for candidate information.

Usage

fec_get_candidates_search(
  office,
  candidate_status,
  cycle,
  district,
  sort_nulls_last,
  sort_hide_null,
  year,
  state,
  name,
  is_active_candidate,
  q,
  federal_funds_flag,
  per_page,
  candidate_id,
  min_first_file_date,
  page,
  sort,
  has_raised_funds,
  election_year,
  incumbent_challenge,
  sort_null_only,
  max_first_file_date,
  party,
  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.

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.

sort_nulls_last

Toggle that sorts null values last

sort_hide_null

Hide null values on sorted column(s).

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.

state

US state or territory where a candidate runs for office

name

Name (candidate or committee) to search for. Alias for 'q'.

is_active_candidate

Candidates who are actively seeking office. If no value is specified, all candidates are returned. When True is specified, only active candidates are returned. When False is specified, only inactive candidates are returned.

q

Name of candidate running for office

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.

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.

min_first_file_date

Selects all candidates whose first filing was received by the FEC after this date.

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

incumbent_challenge

One-letter code ('I', 'C', 'O') explaining if the candidate is an incumbent, a challenger, or if the seat is open.

sort_null_only

Toggle that filters out all rows having sort column that is non-null

max_first_file_date

Selects all candidates whose first filing was received by the FEC before this date.

party

Three-letter code for the party affiliated with a candidate or committee. For example, DEM for Democratic Party and REP for Republican Party.

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.

Value

BKTODO: Return descriptions are not yet implemented in beekeeper