Skip to contents

List elections by cycle, office, state, and district.

Usage

fec_get_elections_search(
  office,
  cycle,
  district,
  zip,
  state,
  sort_hide_null,
  sort_nulls_last,
  page,
  sort_null_only,
  per_page,
  sort,
  api_key = Sys.getenv("FEC_API_KEY", unset = "DEMO_KEY")
)

Arguments

office

BKTODO: No description provided.

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.

zip

Zip code

state

US state or territory where a candidate runs for office

sort_hide_null

Hide null values on sorted column(s).

sort_nulls_last

Toggle that sorts null values last

page

For paginating through results, starting at page 1

sort_null_only

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

per_page

The number of results returned per page. Defaults to 20.

sort

Provide a field to sort by. Use - for descending order. ex: -case_no

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