blob: 0d9a3f3702fe57ece7e5abad7c052015a68e365a [file] [log] [blame]
Craig Citro0e5b9bf2014-10-15 10:26:14 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="civicinfo_v2.html">Google Civic Information API</a> . <a href="civicinfo_v2.elections.html">elections</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#electionQuery">electionQuery()</a></code></p>
79<p class="firstline">List of available elections to query.</p>
80<p class="toc_element">
81 <code><a href="#voterInfoQuery">voterInfoQuery(address, electionId=None, officialOnly=None)</a></code></p>
82<p class="firstline">Looks up information relevant to a voter based on the voter's registered address.</p>
83<h3>Method Details</h3>
84<div class="method">
85 <code class="details" id="electionQuery">electionQuery()</code>
86 <pre>List of available elections to query.
87
88Args:
89
90Returns:
91 An object of the form:
92
93 { # The list of elections available for this version of the API.
94 "kind": "civicinfo#electionsQueryResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#electionsQueryResponse".
95 "elections": [ # A list of available elections
96 { # Information about the election that was queried.
97 "electionDay": "A String", # Day of the election in YYYY-MM-DD format.
98 "id": "A String", # The unique ID of this election.
99 "name": "A String", # A displayable name for the election.
100 },
101 ],
102 }</pre>
103</div>
104
105<div class="method">
106 <code class="details" id="voterInfoQuery">voterInfoQuery(address, electionId=None, officialOnly=None)</code>
107 <pre>Looks up information relevant to a voter based on the voter's registered address.
108
109Args:
110 address: string, The registered address of the voter to look up. (required)
111 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
112 officialOnly: boolean, If set to true, only data from official state sources will be returned.
113
114Returns:
115 An object of the form:
116
117 { # The result of a voter info lookup query.
Craig Citroe633be12015-03-02 13:40:36 -0800118 "earlyVoteSites": [ # Locations where the voter is eligible to vote early, prior to election day.
119 { # A location where a voter can vote. This may be an early vote site, an election day voting location, or a drop off location for a completed ballot.
120 "startDate": "A String", # The first date that this early vote site or drop off location may be used. This field is not populated for polling locations.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700121 "pollingHours": "A String", # A description of when this location is open.
Craig Citroe633be12015-03-02 13:40:36 -0800122 "endDate": "A String", # The last date that this early vote site or drop off location may be used. This field is not populated for polling locations.
123 "name": "A String", # The name of the early vote site or drop off location. This field is not populated for polling locations.
124 "notes": "A String", # Notes about this location (e.g. accessibility ramp or entrance to use).
125 "voterServices": "A String", # The services provided by this early vote site or drop off location. This field is not populated for polling locations.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700126 "sources": [ # A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
127 { # Contains information about the data source for the element containing it.
128 "official": True or False, # Whether this data comes from an official government source.
129 "name": "A String", # The name of the data source.
130 },
131 ],
Craig Citroe633be12015-03-02 13:40:36 -0800132 "address": { # A simple representation of an address. # The address of the location.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700133 "city": "A String", # The city or town for the address.
134 "zip": "A String", # The US Postal Zip Code of the address.
135 "line3": "A String", # The third line of the address, if needed.
136 "line2": "A String", # The second line the address, if needed.
137 "line1": "A String", # The street name and number of this address.
138 "locationName": "A String", # The name of the location.
139 "state": "A String", # The US two letter state abbreviation of the address.
140 },
141 "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.
142 },
143 ],
Craig Citroe633be12015-03-02 13:40:36 -0800144 "dropOffLocations": [ # Locations where a voter is eligible to drop off a completed ballot. The voter must have received and completed a ballot prior to arriving at the location. The location may not have ballots available on the premises. These locations could be open on or before election day as indicated in the pollingHours field.
145 { # A location where a voter can vote. This may be an early vote site, an election day voting location, or a drop off location for a completed ballot.
146 "startDate": "A String", # The first date that this early vote site or drop off location may be used. This field is not populated for polling locations.
147 "pollingHours": "A String", # A description of when this location is open.
148 "endDate": "A String", # The last date that this early vote site or drop off location may be used. This field is not populated for polling locations.
149 "name": "A String", # The name of the early vote site or drop off location. This field is not populated for polling locations.
150 "notes": "A String", # Notes about this location (e.g. accessibility ramp or entrance to use).
151 "voterServices": "A String", # The services provided by this early vote site or drop off location. This field is not populated for polling locations.
152 "sources": [ # A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
153 { # Contains information about the data source for the element containing it.
154 "official": True or False, # Whether this data comes from an official government source.
155 "name": "A String", # The name of the data source.
156 },
157 ],
158 "address": { # A simple representation of an address. # The address of the location.
159 "city": "A String", # The city or town for the address.
160 "zip": "A String", # The US Postal Zip Code of the address.
161 "line3": "A String", # The third line of the address, if needed.
162 "line2": "A String", # The second line the address, if needed.
163 "line1": "A String", # The street name and number of this address.
164 "locationName": "A String", # The name of the location.
165 "state": "A String", # The US two letter state abbreviation of the address.
166 },
167 "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.
168 },
169 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700170 "otherElections": [ # If no election ID was specified in the query, and there was more than one election with data for the given voter, this will contain information about the other elections that could apply.
171 { # Information about the election that was queried.
172 "electionDay": "A String", # Day of the election in YYYY-MM-DD format.
173 "id": "A String", # The unique ID of this election.
174 "name": "A String", # A displayable name for the election.
175 },
176 ],
Craig Citroe633be12015-03-02 13:40:36 -0800177 "kind": "civicinfo#voterInfoResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#voterInfoResponse".
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700178 "normalizedInput": { # A simple representation of an address. # The normalized version of the requested address
179 "city": "A String", # The city or town for the address.
180 "zip": "A String", # The US Postal Zip Code of the address.
181 "line3": "A String", # The third line of the address, if needed.
182 "line2": "A String", # The second line the address, if needed.
183 "line1": "A String", # The street name and number of this address.
184 "locationName": "A String", # The name of the location.
185 "state": "A String", # The US two letter state abbreviation of the address.
186 },
187 "state": [ # Local Election Information for the state that the voter votes in. For the US, there will only be one element in this array.
188 { # Describes information about a regional election administrative area.
189 "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.
190 "sources": [ # A list of sources for this area. If multiple sources are listed the data has been aggregated from those sources.
191 { # Contains information about the data source for the element containing it.
192 "official": True or False, # Whether this data comes from an official government source.
193 "name": "A String", # The name of the data source.
194 },
195 ],
196 "electionAdministrationBody": { # Information about an election administrative body (e.g. County Board of Elections). # The election administration body for this area.
197 "absenteeVotingInfoUrl": "A String", # A URL provided by this administrative body for information on absentee voting.
198 "votingLocationFinderUrl": "A String", # A URL provided by this administrative body for looking up where to vote.
199 "name": "A String", # The name of this election administrative body.
200 "electionRegistrationConfirmationUrl": "A String", # A URL provided by this administrative body for confirming that the voter is registered to vote.
201 "correspondenceAddress": { # A simple representation of an address. # The mailing address of this administrative body.
202 "city": "A String", # The city or town for the address.
203 "zip": "A String", # The US Postal Zip Code of the address.
204 "line3": "A String", # The third line of the address, if needed.
205 "line2": "A String", # The second line the address, if needed.
206 "line1": "A String", # The street name and number of this address.
207 "locationName": "A String", # The name of the location.
208 "state": "A String", # The US two letter state abbreviation of the address.
209 },
210 "electionRegistrationUrl": "A String", # A URL provided by this administrative body for looking up how to register to vote.
211 "electionOfficials": [ # The election officials for this election administrative body.
212 { # Information about individual election officials.
213 "title": "A String", # The title of the election official.
214 "emailAddress": "A String", # The email address of the election official.
215 "name": "A String", # The full name of the election official.
216 "officePhoneNumber": "A String", # The office phone number of the election official.
217 "faxNumber": "A String", # The fax number of the election official.
218 },
219 ],
220 "electionInfoUrl": "A String", # A URL provided by this administrative body for looking up general election information.
221 "electionRulesUrl": "A String", # A URL provided by this administrative body describing election rules to the voter.
222 "voter_services": [ # A description of the services this administrative body may provide.
223 "A String",
224 ],
225 "ballotInfoUrl": "A String", # A URL provided by this administrative body to give contest information to the voter.
226 "hoursOfOperation": "A String", # A description of the hours of operation for this administrative body.
227 "physicalAddress": { # A simple representation of an address. # The physical address of this administrative body.
228 "city": "A String", # The city or town for the address.
229 "zip": "A String", # The US Postal Zip Code of the address.
230 "line3": "A String", # The third line of the address, if needed.
231 "line2": "A String", # The second line the address, if needed.
232 "line1": "A String", # The street name and number of this address.
233 "locationName": "A String", # The name of the location.
234 "state": "A String", # The US two letter state abbreviation of the address.
235 },
236 },
237 "name": "A String", # The name of the jurisdiction.
238 "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.
239 },
240 ],
241 "precinctId": "A String",
242 "election": { # Information about the election that was queried. # The election that was queried.
243 "electionDay": "A String", # Day of the election in YYYY-MM-DD format.
244 "id": "A String", # The unique ID of this election.
245 "name": "A String", # A displayable name for the election.
246 },
Craig Citroe633be12015-03-02 13:40:36 -0800247 "pollingLocations": [ # Locations where the voter is eligible to vote on election day.
248 { # A location where a voter can vote. This may be an early vote site, an election day voting location, or a drop off location for a completed ballot.
249 "startDate": "A String", # The first date that this early vote site or drop off location may be used. This field is not populated for polling locations.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700250 "pollingHours": "A String", # A description of when this location is open.
Craig Citroe633be12015-03-02 13:40:36 -0800251 "endDate": "A String", # The last date that this early vote site or drop off location may be used. This field is not populated for polling locations.
252 "name": "A String", # The name of the early vote site or drop off location. This field is not populated for polling locations.
253 "notes": "A String", # Notes about this location (e.g. accessibility ramp or entrance to use).
254 "voterServices": "A String", # The services provided by this early vote site or drop off location. This field is not populated for polling locations.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700255 "sources": [ # A list of sources for this location. If multiple sources are listed the data has been aggregated from those sources.
256 { # Contains information about the data source for the element containing it.
257 "official": True or False, # Whether this data comes from an official government source.
258 "name": "A String", # The name of the data source.
259 },
260 ],
Craig Citroe633be12015-03-02 13:40:36 -0800261 "address": { # A simple representation of an address. # The address of the location.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700262 "city": "A String", # The city or town for the address.
263 "zip": "A String", # The US Postal Zip Code of the address.
264 "line3": "A String", # The third line of the address, if needed.
265 "line2": "A String", # The second line the address, if needed.
266 "line1": "A String", # The street name and number of this address.
267 "locationName": "A String", # The name of the location.
268 "state": "A String", # The US two letter state abbreviation of the address.
269 },
270 "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.
271 },
272 ],
Craig Citroe633be12015-03-02 13:40:36 -0800273 "contests": [ # Contests that will appear on the voter's ballot.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700274 { # Information about a contest that appears on a voter's ballot.
275 "numberVotingFor": "A String", # The number of candidates that a voter may vote for in this contest.
276 "office": "A String", # The name of the office for this contest.
277 "district": { # Describes the geographic scope of a contest. # Information about the electoral district that this contest is in.
278 "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
279 "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.
280 "name": "A String", # The name of the district.
281 },
282 "level": [ # The levels of government of the office for this contest. There may be more than one in cases where a jurisdiction effectively acts at two different levels of government; for example, the mayor of the District of Columbia acts at "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1".
283 "A String",
284 ],
285 "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'.
286 "ballotPlacement": "A String", # A number specifying the position of this contest on the voter's ballot.
287 "sources": [ # A list of sources for this contest. If multiple sources are listed, the data has been aggregated from those sources.
288 { # Contains information about the data source for the element containing it.
289 "official": True or False, # Whether this data comes from an official government source.
290 "name": "A String", # The name of the data source.
291 },
292 ],
293 "referendumSubtitle": "A String", # A brief description of the referendum. This field is only populated for contests of type 'Referendum'.
294 "primaryParty": "A String", # If this is a partisan election, the name of the party it is for.
295 "candidates": [ # The candidate choices for this contest.
296 { # Information about a candidate running for elected office.
297 "name": "A String", # The candidate's name.
298 "photoUrl": "A String", # A URL for a photo of the candidate.
299 "candidateUrl": "A String", # The URL for the candidate's campaign web site.
300 "channels": [ # A list of known (social) media channels for this candidate.
301 { # A social media or web channel for a candidate.
302 "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
303 "id": "A String", # The unique public identifier for the candidate's channel.
304 },
305 ],
306 "phone": "A String", # The voice phone number for the candidate's campaign office.
307 "orderOnBallot": "A String", # The order the candidate appears on the ballot for this contest.
308 "party": "A String", # The full name of the party the candidate is a member of.
309 "email": "A String", # The email address for the candidate's campaign.
310 },
311 ],
312 "roles": [ # The roles which this office fulfills.
313 "A String",
314 ],
315 "numberElected": "A String", # The number of candidates that will be elected to office in this contest.
316 "referendumUrl": "A String", # A link to the referendum. This field is only populated for contests of type 'Referendum'.
317 "electorateSpecifications": "A String", # A description of any additional eligibility requirements for voting in this contest.
318 "referendumTitle": "A String", # The title of the referendum (e.g. 'Proposition 42'). This field is only populated for contests of type 'Referendum'.
319 "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.
320 "special": "A String", # "Yes" or "No" depending on whether this a contest being held outside the normal election cycle.
321 },
322 ],
323 }</pre>
324</div>
325
326</body></html>