Skip to content

Latest commit

 

History

History
392 lines (348 loc) · 27.4 KB

README.md

File metadata and controls

392 lines (348 loc) · 27.4 KB

R API client for openapi

This application programming interface (API) allows you to explore the way candidates and committees fund their campaigns.

The Federal Election Commission (FEC) API is a RESTful web service supporting full-text and field-specific searches on FEC data. Bulk downloads are available on the current site. Information is tied to the underlying forms by file ID and image ID. Data is updated nightly.

There are a lot of data, and a good place to start is to use search to find interesting candidates and committees. Then, you can use their IDs to find report or line item details with the other endpoints. If you are interested in individual donors, check out contributor information in the /schedule_a/ endpoints.

<b class="body" id="getting_started_head">Getting started with the openFEC API

If you would like to use the FEC's API programmatically, you can sign up for your own API key using our form. Alternatively, you can still try out our API without an API key by using the web interface and using DEMO_KEY. Note that when you use the openFEC API you are subject to the Terms of Service and Acceptable Use policy.

Signing up for an API key will enable you to place up to 1,000 calls an hour. Each call is limited to 100 results per page. You can email questions, comments or a request to get a key for 7,200 calls an hour (120 calls per minute) to <a href="mailto:[email protected]">[email protected]. You can also ask questions and discuss the data in a community led group.

The model definitions and schema are available at /swagger. This is useful for making wrappers and exploring the data.

A few restrictions limit the way you can use FEC data. For example, you can’t use contributor lists for commercial purposes or to solicit donations. Learn more here.

Inspect our source code. We welcome issues and pull requests!


Sign up for an API key

Loading signup form...

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI spec from a remote server, you can easily generate an API client.

  • API version: 1.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.RClientCodegen

Installation

Prerequisites

Install the dependencies

install.packages("jsonlite")
install.packages("httr")
install.packages("base64enc")

Build the package

git clone https://github.com/GIT_USER_ID/GIT_REPO_ID
cd GIT_REPO_ID
R CMD build .
R CMD check openapi_1.0.0.tar.gz --no-manual
R CMD INSTALL openapi_1.0.0.tar.gz

Install the package

install.packages("openapi")

To install directly from Github, use devtools:

install.packages("devtools")
library(devtools)
install_github("GIT_USER_ID/GIT_REPO_ID")

Usage

library(openapi)

Documentation for API Endpoints

All URIs are relative to http://localhost/v1

Class Method HTTP request Description
AuditApi AuditCaseGet GET /audit-case/
AuditApi AuditCategoryGet GET /audit-category/
AuditApi AuditPrimaryCategoryGet GET /audit-primary-category/
AuditApi NamesAuditCandidatesGet GET /names/audit_candidates/
AuditApi NamesAuditCommitteesGet GET /names/audit_committees/
CandidateApi CandidateCandidateIdGet GET /candidate/{candidate_id}/
CandidateApi CandidateCandidateIdHistoryCycleGet GET /candidate/{candidate_id}/history/{cycle}/
CandidateApi CandidateCandidateIdHistoryGet GET /candidate/{candidate_id}/history/
CandidateApi CandidateCandidateIdTotalsGet GET /candidate/{candidate_id}/totals/
CandidateApi CandidatesGet GET /candidates/
CandidateApi CandidatesSearchGet GET /candidates/search/
CandidateApi CandidatesTotalsByOfficeByPartyGet GET /candidates/totals/by_office/by_party/
CandidateApi CandidatesTotalsByOfficeGet GET /candidates/totals/by_office/
CandidateApi CandidatesTotalsGet GET /candidates/totals/
CandidateApi CommitteeCommitteeIdCandidatesGet GET /committee/{committee_id}/candidates/
CandidateApi CommitteeCommitteeIdCandidatesHistoryCycleGet GET /committee/{committee_id}/candidates/history/{cycle}/
CandidateApi CommitteeCommitteeIdCandidatesHistoryGet GET /committee/{committee_id}/candidates/history/
CommitteeApi CandidateCandidateIdCommitteesGet GET /candidate/{candidate_id}/committees/
CommitteeApi CandidateCandidateIdCommitteesHistoryCycleGet GET /candidate/{candidate_id}/committees/history/{cycle}/
CommitteeApi CandidateCandidateIdCommitteesHistoryGet GET /candidate/{candidate_id}/committees/history/
CommitteeApi CommitteeCommitteeIdGet GET /committee/{committee_id}/
CommitteeApi CommitteeCommitteeIdHistoryCycleGet GET /committee/{committee_id}/history/{cycle}/
CommitteeApi CommitteeCommitteeIdHistoryGet GET /committee/{committee_id}/history/
CommitteeApi CommitteesGet GET /committees/
CommunicationCostApi CommunicationCostsAggregatesGet GET /communication_costs/aggregates/
CommunicationCostApi CommunicationCostsByCandidateGet GET /communication_costs/by_candidate/
CommunicationCostApi CommunicationCostsGet GET /communication_costs/
CommunicationCostApi CommunicationCostsTotalsByCandidateGet GET /communication_costs/totals/by_candidate/
DatesApi CalendarDatesExportGet GET /calendar-dates/export/
DatesApi CalendarDatesGet GET /calendar-dates/
DatesApi ElectionDatesGet GET /election-dates/
DatesApi ReportingDatesGet GET /reporting-dates/
DebtsApi SchedulesScheduleDGet GET /schedules/schedule_d/
DebtsApi SchedulesScheduleDSubIdGet GET /schedules/schedule_d/{sub_id}/
DisbursementsApi SchedulesScheduleBByPurposeGet GET /schedules/schedule_b/by_purpose/
DisbursementsApi SchedulesScheduleBByRecipientGet GET /schedules/schedule_b/by_recipient/
DisbursementsApi SchedulesScheduleBByRecipientIdGet GET /schedules/schedule_b/by_recipient_id/
DisbursementsApi SchedulesScheduleBEfileGet GET /schedules/schedule_b/efile/
DisbursementsApi SchedulesScheduleBGet GET /schedules/schedule_b/
DisbursementsApi SchedulesScheduleBSubIdGet GET /schedules/schedule_b/{sub_id}/
EfilingApi EfileFilingsGet GET /efile/filings/
EfilingApi EfileReportsHouseSenateGet GET /efile/reports/house-senate/
EfilingApi EfileReportsPacPartyGet GET /efile/reports/pac-party/
EfilingApi EfileReportsPresidentialGet GET /efile/reports/presidential/
ElectioneeringApi ElectioneeringAggregatesGet GET /electioneering/aggregates/
ElectioneeringApi ElectioneeringByCandidateGet GET /electioneering/by_candidate/
ElectioneeringApi ElectioneeringGet GET /electioneering/
ElectioneeringApi ElectioneeringTotalsByCandidateGet GET /electioneering/totals/by_candidate/
FilerResourcesApi RadAnalystGet GET /rad-analyst/
FilerResourcesApi StateElectionOfficeGet GET /state-election-office/
FilingsApi CandidateCandidateIdFilingsGet GET /candidate/{candidate_id}/filings/
FilingsApi CommitteeCommitteeIdFilingsGet GET /committee/{committee_id}/filings/
FilingsApi FilingsGet GET /filings/
FilingsApi OperationsLogGet GET /operations-log/
FinancialApi CommitteeCommitteeIdReportsGet GET /committee/{committee_id}/reports/
FinancialApi CommitteeCommitteeIdTotalsGet GET /committee/{committee_id}/totals/
FinancialApi ElectionsGet GET /elections/
FinancialApi ElectionsSearchGet GET /elections/search/
FinancialApi ElectionsSummaryGet GET /elections/summary/
FinancialApi ReportsEntityTypeGet GET /reports/{entity_type}/
FinancialApi TotalsByEntityGet GET /totals/by_entity/
FinancialApi TotalsEntityTypeGet GET /totals/{entity_type}/
IndependentExpendituresApi SchedulesScheduleEByCandidateGet GET /schedules/schedule_e/by_candidate/
IndependentExpendituresApi SchedulesScheduleEEfileGet GET /schedules/schedule_e/efile/
IndependentExpendituresApi SchedulesScheduleEGet GET /schedules/schedule_e/
IndependentExpendituresApi SchedulesScheduleETotalsByCandidateGet GET /schedules/schedule_e/totals/by_candidate/
LegalApi LegalSearchGet GET /legal/search/
LoansApi SchedulesScheduleCGet GET /schedules/schedule_c/
LoansApi SchedulesScheduleCSubIdGet GET /schedules/schedule_c/{sub_id}/
PartyCoordinatedExpendituresApi SchedulesScheduleFGet GET /schedules/schedule_f/
PartyCoordinatedExpendituresApi SchedulesScheduleFSubIdGet GET /schedules/schedule_f/{sub_id}/
PresidentialApi PresidentialContributionsByCandidateGet GET /presidential/contributions/by_candidate/
PresidentialApi PresidentialContributionsBySizeGet GET /presidential/contributions/by_size/
PresidentialApi PresidentialContributionsByStateGet GET /presidential/contributions/by_state/
PresidentialApi PresidentialCoverageEndDateGet GET /presidential/coverage_end_date/
PresidentialApi PresidentialFinancialSummaryGet GET /presidential/financial_summary/
ReceiptsApi SchedulesScheduleAByEmployerGet GET /schedules/schedule_a/by_employer/
ReceiptsApi SchedulesScheduleAByOccupationGet GET /schedules/schedule_a/by_occupation/
ReceiptsApi SchedulesScheduleABySizeByCandidateGet GET /schedules/schedule_a/by_size/by_candidate/
ReceiptsApi SchedulesScheduleABySizeGet GET /schedules/schedule_a/by_size/
ReceiptsApi SchedulesScheduleAByStateByCandidateGet GET /schedules/schedule_a/by_state/by_candidate/
ReceiptsApi SchedulesScheduleAByStateByCandidateTotalsGet GET /schedules/schedule_a/by_state/by_candidate/totals/
ReceiptsApi SchedulesScheduleAByStateGet GET /schedules/schedule_a/by_state/
ReceiptsApi SchedulesScheduleAByStateTotalsGet GET /schedules/schedule_a/by_state/totals/
ReceiptsApi SchedulesScheduleAByZipGet GET /schedules/schedule_a/by_zip/
ReceiptsApi SchedulesScheduleAEfileGet GET /schedules/schedule_a/efile/
ReceiptsApi SchedulesScheduleAGet GET /schedules/schedule_a/
ReceiptsApi SchedulesScheduleASubIdGet GET /schedules/schedule_a/{sub_id}/
SearchApi NamesCandidatesGet GET /names/candidates/
SearchApi NamesCommitteesGet GET /names/committees/

Documentation for Models

Documentation for Authorization

ApiKeyHeaderAuth

  • Type: API key
  • API key parameter name: X-Api-Key
  • Location: HTTP header

ApiKeyQueryAuth

  • Type: API key
  • API key parameter name: api_key
  • Location: URL query string

apiKey

  • Type: API key
  • API key parameter name: api_key
  • Location: URL query string

Author