blob: c24d6efc58588a3521d2037386c7b0336e27fdc9 [file] [log] [blame]
<html><body>
<style>
body, h1, h2, h3, div, span, p, pre, a {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
body {
font-size: 13px;
padding: 1em;
}
h1 {
font-size: 26px;
margin-bottom: 1em;
}
h2 {
font-size: 24px;
margin-bottom: 1em;
}
h3 {
font-size: 20px;
margin-bottom: 1em;
margin-top: 1em;
}
pre, code {
line-height: 1.5;
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}
pre {
margin-top: 0.5em;
}
h1, h2, h3, p {
font-family: Arial, sans serif;
}
h1, h2, h3 {
border-bottom: solid #CCC 1px;
}
.toc_element {
margin-top: 0.5em;
}
.firstline {
margin-left: 2 em;
}
.method {
margin-top: 1em;
border: solid 1px #CCC;
padding: 1em;
background: #EEE;
}
.details {
font-weight: bold;
font-size: 14px;
}
</style>
<h1><a href="civicinfo_v1.html">Google Civic Information API</a> . <a href="civicinfo_v1.elections.html">elections</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
<code><a href="#electionQuery">electionQuery()</a></code></p>
<p class="firstline">List of available elections to query.</p>
<p class="toc_element">
<code><a href="#voterInfoQuery">voterInfoQuery(electionId, body, officialOnly=None)</a></code></p>
<p class="firstline">Looks up information relevant to a voter based on the voter's registered address.</p>
<h3>Method Details</h3>
<div class="method">
<code class="details" id="electionQuery">electionQuery()</code>
<pre>List of available elections to query.
Args:
Returns:
An object of the form:
{ # The list of elections available for this version of the API.
"kind": "civicinfo#electionsQueryResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#electionsQueryResponse".
"elections": [ # A list of available elections
{ # Information about the election that was queried.
"electionDay": "A String", # Day of the election in YYYY-MM-DD format.
"id": "A String", # The unique ID of this election.
"name": "A String", # A displayable name for the election.
},
],
}</pre>
</div>
<div class="method">
<code class="details" id="voterInfoQuery">voterInfoQuery(electionId, body, officialOnly=None)</code>
<pre>Looks up information relevant to a voter based on the voter's registered address.
Args:
electionId: string, The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections (required)
body: object, The request body. (required)
The object takes the form of:
{ # A request for information about a voter.
"address": "A String", # The registered address of the voter to look up.
}
officialOnly: boolean, If set to true, only data from official state sources will be returned.
Returns:
An object of the form:
{ # The result of a voter info lookup query.
"status": "A String", # The result of the request. One of: success, noStreetSegmentFound, addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, electionOver, electionUnknown, internalLookupFailure
"earlyVoteSites": [ # Locations where the voter is eligible to vote early, prior to election day
{ # A location where a voter can vote. This may be an early vote site or an election day voting location.
"startDate": "A String", # The first date that this early vote site may be used. This field is not populated for polling locations.
"pollingHours": "A String", # A description of when this location is open.
"endDate": "A String", # The last date that this early vote site may be used. This field is not populated for polling locations.
"name": "A String", # The name of the early vote site. This field is not populated for polling locations.
"notes": "A String", # Notes about this location (e.g. accessibility ramp or entrance to use)
"voterServices": "A String", # The services provided by this early vote site. This field is not populated for polling locations.
"sources": [ # A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
{ # Contains information about the data source for the element containing it.
"official": True or False, # Whether this data comes from an official government source.
"name": "A String", # The name of the data source.
},
],
"address": { # A simple representation of an address. # The address of the location
"city": "A String", # The city or town for the address.
"zip": "A String", # The US Postal Zip Code of the address.
"line3": "A String", # The third line of the address, if needed.
"line2": "A String", # The second line the address, if needed.
"line1": "A String", # The street name and number of this address.
"locationName": "A String", # The name of the location.
"state": "A String", # The US two letter state abbreviation of the address.
},
"id": "A String", # An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
},
],
"kind": "civicinfo#voterInfoResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse".
"normalizedInput": { # A simple representation of an address. # The normalized version of the requested address
"city": "A String", # The city or town for the address.
"zip": "A String", # The US Postal Zip Code of the address.
"line3": "A String", # The third line of the address, if needed.
"line2": "A String", # The second line the address, if needed.
"line1": "A String", # The street name and number of this address.
"locationName": "A String", # The name of the location.
"state": "A String", # The US two letter state abbreviation of the address.
},
"state": [ # Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array.
{ # Describes information about a regional election administrative area.
"local_jurisdiction": # Object with schema name: AdministrationRegion # The city or county that provides election information for this voter. This object can have the same elements as state.
"sources": [ # A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources.
{ # Contains information about the data source for the element containing it.
"official": True or False, # Whether this data comes from an official government source.
"name": "A String", # The name of the data source.
},
],
"electionAdministrationBody": { # Information about an election administrative body (e.g. County Board of Elections). # The election administration body for this area.
"absenteeVotingInfoUrl": "A String", # A URL provided by this administrative body for information on absentee voting.
"votingLocationFinderUrl": "A String", # A URL provided by this administrative body for looking up where to vote.
"name": "A String", # The name of this election administrative body.
"electionRegistrationConfirmationUrl": "A String", # A URL provided by this administrative body for confirming that the voter is registered to vote.
"correspondenceAddress": { # A simple representation of an address. # The mailing address of this administrative body.
"city": "A String", # The city or town for the address.
"zip": "A String", # The US Postal Zip Code of the address.
"line3": "A String", # The third line of the address, if needed.
"line2": "A String", # The second line the address, if needed.
"line1": "A String", # The street name and number of this address.
"locationName": "A String", # The name of the location.
"state": "A String", # The US two letter state abbreviation of the address.
},
"electionRegistrationUrl": "A String", # A URL provided by this administrative body for looking up how to register to vote.
"electionOfficials": [ # The election officials for this election administrative body.
{ # Information about individual election officials.
"title": "A String", # The title of the election official.
"emailAddress": "A String", # The email address of the election official.
"name": "A String", # The full name of the election official.
"officePhoneNumber": "A String", # The office phone number of the election official.
"faxNumber": "A String", # The fax number of the election official.
},
],
"electionInfoUrl": "A String", # A URL provided by this administrative body for looking up general election information.
"electionRulesUrl": "A String", # A URL provided by this administrative body describing election rules to the voter.
"voter_services": [ # A description of the services this administrative body may provide.
"A String",
],
"ballotInfoUrl": "A String", # A URL provided by this administrative body to give contest information to the voter.
"hoursOfOperation": "A String", # A description of the hours of operation for this administrative body.
"physicalAddress": { # A simple representation of an address. # The physical address of this administrative body.
"city": "A String", # The city or town for the address.
"zip": "A String", # The US Postal Zip Code of the address.
"line3": "A String", # The third line of the address, if needed.
"line2": "A String", # The second line the address, if needed.
"line1": "A String", # The street name and number of this address.
"locationName": "A String", # The name of the location.
"state": "A String", # The US two letter state abbreviation of the address.
},
},
"name": "A String", # The name of the jurisdiction.
"id": "A String", # An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
},
],
"election": { # Information about the election that was queried. # The election that was queried.
"electionDay": "A String", # Day of the election in YYYY-MM-DD format.
"id": "A String", # The unique ID of this election.
"name": "A String", # A displayable name for the election.
},
"pollingLocations": [ # Locations where the voter is eligible to vote on election day. For states with mail-in voting only, these locations will be nearby drop box locations. Drop box locations are free to the voter and may be used instead of placing the ballot in the mail.
{ # A location where a voter can vote. This may be an early vote site or an election day voting location.
"startDate": "A String", # The first date that this early vote site may be used. This field is not populated for polling locations.
"pollingHours": "A String", # A description of when this location is open.
"endDate": "A String", # The last date that this early vote site may be used. This field is not populated for polling locations.
"name": "A String", # The name of the early vote site. This field is not populated for polling locations.
"notes": "A String", # Notes about this location (e.g. accessibility ramp or entrance to use)
"voterServices": "A String", # The services provided by this early vote site. This field is not populated for polling locations.
"sources": [ # A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
{ # Contains information about the data source for the element containing it.
"official": True or False, # Whether this data comes from an official government source.
"name": "A String", # The name of the data source.
},
],
"address": { # A simple representation of an address. # The address of the location
"city": "A String", # The city or town for the address.
"zip": "A String", # The US Postal Zip Code of the address.
"line3": "A String", # The third line of the address, if needed.
"line2": "A String", # The second line the address, if needed.
"line1": "A String", # The street name and number of this address.
"locationName": "A String", # The name of the location.
"state": "A String", # The US two letter state abbreviation of the address.
},
"id": "A String", # An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
},
],
"contests": [ # Contests that will appear on the voter's ballot
{ # Information about a contest that appears on a voter's ballot.
"numberVotingFor": "A String", # The number of candidates that a voter may vote for in this contest.
"office": "A String", # The name of the office for this contest.
"district": { # Describes the geographic scope of a contest. # Information about the electoral district that this contest is in.
"scope": "A String", # The geographic scope of this district. If unspecified the district's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special
"id": "A String", # An identifier for this district, relative to its scope. For example, the 34th State Senate district would have id "34" and a scope of stateUpper.
"name": "A String", # The name of the district.
},
"level": "A String", # The level of office for this contest. One of: federal, state, county, city, other
"type": "A String", # The type of contest. Usually this will be 'General', 'Primary', or 'Run-off' for contests with candidates. For referenda this will be 'Referendum'.
"ballotPlacement": "A String", # A number specifying the position of this contest on the voter's ballot.
"sources": [ # A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources.
{ # Contains information about the data source for the element containing it.
"official": True or False, # Whether this data comes from an official government source.
"name": "A String", # The name of the data source.
},
],
"referendumSubtitle": "A String", # A brief description of the referendum. This field is only populated for contests of type 'Referendum'.
"primaryParty": "A String", # If this is a partisan election, the name of the party it is for.
"candidates": [ # The candidate choices for this contest.
{ # Information about a candidate running for elected office.
"name": "A String", # The candidate's name.
"photoUrl": "A String", # A URL for a photo of the candidate.
"candidateUrl": "A String", # The URL for the candidate's campaign web site.
"channels": [ # A list of known (social) media channels for this candidate.
{ # A social media or web channel for a candidate.
"type": "A String", # The type of channel. The following is a list of types of channels, but is not exhaustive. More channel types may be added at a later time. One of: GooglePlus, YouTube, Facebook, Twitter
"id": "A String", # The unique public identifier for the candidate's channel.
},
],
"phone": "A String", # The voice phone number for the candidate's campaign office.
"orderOnBallot": "A String", # The order the candidate appears on the ballot for this contest.
"party": "A String", # The full name of the party the candidate is a member of.
"email": "A String", # The email address for the candidate's campaign.
},
],
"numberElected": "A String", # The number of candidates that will be elected to office in this contest.
"referendumUrl": "A String", # A link to the referendum. This field is only populated for contests of type 'Referendum'.
"electorateSpecifications": "A String", # A description of any additional eligibility requirements for voting in this contest.
"referendumTitle": "A String", # The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'.
"id": "A String", # An ID for this object. IDs may change in future requests and should not be cached. Access to this field requires special access that can be requested from the Request more link on the Quotas page.
"special": "A String", # "Yes" or "No" depending on whether this a contest being held outside the normal election cycle.
},
],
}</pre>
</div>
</body></html>