Skip to content

Latest commit

 

History

History
110 lines (74 loc) · 3.82 KB

SearchApi.md

File metadata and controls

110 lines (74 loc) · 3.82 KB

SearchApi

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

Method HTTP request Description
NamesCandidatesGet GET /names/candidates/
NamesCommitteesGet GET /names/committees/

NamesCandidatesGet

CandidateSearchList NamesCandidatesGet(q, api.key)

Search for candidates or committees by name. If you're looking for information on a particular person or group, using a name to find the candidate_id or committee_id on this endpoint can be a helpful first step.

Example

library(openapi)

var.q <- list("inner_example") # array[character] | Name (candidate or committee) to search for
var.api.key <- 'DEMO_KEY' # character |  API key for https://api.data.gov. Get one at https://api.data.gov/signup. 

api.instance <- SearchApi$new()
# Configure API key authorization: ApiKeyHeaderAuth
api.instance$apiClient$apiKeys['X-Api-Key'] <- 'TODO_YOUR_API_KEY';
# Configure API key authorization: ApiKeyQueryAuth
api.instance$apiClient$apiKeys['api_key'] <- 'TODO_YOUR_API_KEY';
# Configure API key authorization: apiKey
api.instance$apiClient$apiKeys['api_key'] <- 'TODO_YOUR_API_KEY';
result <- api.instance$NamesCandidatesGet(var.q, var.api.key)
dput(result)

Parameters

Name Type Description Notes
q list( character ) Name (candidate or committee) to search for
api.key character API key for https://api.data.gov. Get one at https://api.data.gov/signup. [default to 'DEMO_KEY']

Return type

CandidateSearchList

Authorization

ApiKeyHeaderAuth, ApiKeyQueryAuth, apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
0 -

NamesCommitteesGet

CommitteeSearchList NamesCommitteesGet(q, api.key)

Search for candidates or committees by name. If you're looking for information on a particular person or group, using a name to find the candidate_id or committee_id on this endpoint can be a helpful first step.

Example

library(openapi)

var.q <- list("inner_example") # array[character] | Name (candidate or committee) to search for
var.api.key <- 'DEMO_KEY' # character |  API key for https://api.data.gov. Get one at https://api.data.gov/signup. 

api.instance <- SearchApi$new()
# Configure API key authorization: ApiKeyHeaderAuth
api.instance$apiClient$apiKeys['X-Api-Key'] <- 'TODO_YOUR_API_KEY';
# Configure API key authorization: ApiKeyQueryAuth
api.instance$apiClient$apiKeys['api_key'] <- 'TODO_YOUR_API_KEY';
# Configure API key authorization: apiKey
api.instance$apiClient$apiKeys['api_key'] <- 'TODO_YOUR_API_KEY';
result <- api.instance$NamesCommitteesGet(var.q, var.api.key)
dput(result)

Parameters

Name Type Description Notes
q list( character ) Name (candidate or committee) to search for
api.key character API key for https://api.data.gov. Get one at https://api.data.gov/signup. [default to 'DEMO_KEY']

Return type

CommitteeSearchList

Authorization

ApiKeyHeaderAuth, ApiKeyQueryAuth, apiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
0 -