blob: 5d55d7158ea0d51a280dce2ebe3a24771040f4fa [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.representatives.html">representatives</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070078 <code><a href="#close">close()</a></code></p>
79<p class="firstline">Close httplib2 connections.</p>
80<p class="toc_element">
81 <code><a href="#representativeInfoByAddress">representativeInfoByAddress(roles=None, includeOffices=None, address=None, levels=None, x__xgafv=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070082<p class="firstline">Looks up political geography and representative information for a single address.</p>
83<p class="toc_element">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070084 <code><a href="#representativeInfoByDivision">representativeInfoByDivision(ocdId, roles=None, levels=None, recursive=None, x__xgafv=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070085<p class="firstline">Looks up representative information for a single geographic division.</p>
86<h3>Method Details</h3>
87<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070088 <code class="details" id="close">close()</code>
89 <pre>Close httplib2 connections.</pre>
90</div>
91
92<div class="method">
93 <code class="details" id="representativeInfoByAddress">representativeInfoByAddress(roles=None, includeOffices=None, address=None, levels=None, x__xgafv=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070094 <pre>Looks up political geography and representative information for a single address.
95
96Args:
Dmitry Frenkel3e17f892020-10-06 16:46:05 -070097 roles: string, A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don&#x27;t contain a matching office will not be returned. (repeated)
98 Allowed values
99 headOfState -
100 headOfGovernment -
101 deputyHeadOfGovernment -
102 governmentOfficer -
103 executiveCouncil -
104 legislatorUpperBody -
105 legislatorLowerBody -
106 highestCourtJudge -
107 judge -
108 schoolBoard -
109 specialPurposeOfficer -
110 includeOffices: boolean, Whether to return information about offices and officials. If false, only the top-level district information will be returned.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700111 address: string, The address to look up. May only be specified if the field ocdId is not given in the URL
Bu Sun Kim65020912020-05-20 12:08:20 -0700112 levels: string, A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don&#x27;t contain a matching office will not be returned. (repeated)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700113 Allowed values
114 international -
115 country -
116 administrativeArea1 -
117 regional -
118 administrativeArea2 -
119 locality -
120 subLocality1 -
121 subLocality2 -
122 special -
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700123 x__xgafv: string, V1 error format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700124 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700125 1 - v1 error format
126 2 - v2 error format
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700127
128Returns:
129 An object of the form:
130
131 { # The result of a representative info lookup query.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700132 &quot;normalizedInput&quot;: { # A simple representation of an address. # The normalized version of the requested address
133 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
134 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
135 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
136 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
137 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
138 &quot;line1&quot;: &quot;A String&quot;, # The street name and number of this address.
139 &quot;line2&quot;: &quot;A String&quot;, # The second line the address, if needed.
140 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700141 &quot;kind&quot;: &quot;civicinfo#representativeInfoResponse&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;civicinfo#representativeInfoResponse&quot;.
142 &quot;offices&quot;: [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
143 { # Information about an Office held by one or more Officials.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700144 &quot;sources&quot;: [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
145 { # Contains information about the data source for the element containing it.
146 &quot;official&quot;: True or False, # Whether this data comes from an official government source.
147 &quot;name&quot;: &quot;A String&quot;, # The name of the data source.
148 },
149 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700150 &quot;levels&quot;: [ # The levels of government of which this office is part. 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 &quot;locality&quot; level, but also effectively at both &quot;administrative-area-2&quot; and &quot;administrative-area-1&quot;.
151 &quot;A String&quot;,
152 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700153 &quot;officialIndices&quot;: [ # List of indices in the officials array of people who presently hold this office.
154 42,
155 ],
156 &quot;divisionId&quot;: &quot;A String&quot;, # The OCD ID of the division with which this office is associated.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700157 &quot;roles&quot;: [ # The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, but are meant to be rough categories that are useful for general selection from or sorting of a list of offices.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700158 &quot;A String&quot;,
159 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700160 &quot;name&quot;: &quot;A String&quot;, # The human-readable name of the office.
Bu Sun Kim65020912020-05-20 12:08:20 -0700161 },
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700162 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700163 &quot;officials&quot;: [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
164 { # Information about a person holding an elected office.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700165 &quot;party&quot;: &quot;A String&quot;, # The full name of the party the official belongs to.
166 &quot;channels&quot;: [ # A list of known (social) media channels for this official.
167 { # A social media or web channel for a candidate.
168 &quot;type&quot;: &quot;A String&quot;, # 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
169 &quot;id&quot;: &quot;A String&quot;, # The unique public identifier for the candidate&#x27;s channel.
170 },
171 ],
172 &quot;photoUrl&quot;: &quot;A String&quot;, # A URL for a photo of the official.
173 &quot;name&quot;: &quot;A String&quot;, # The official&#x27;s name.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700174 &quot;emails&quot;: [ # The direct email addresses for the official.
175 &quot;A String&quot;,
Bu Sun Kim65020912020-05-20 12:08:20 -0700176 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700177 &quot;address&quot;: [ # Addresses at which to contact the official.
178 { # A simple representation of an address.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700179 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700180 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700181 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
182 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
183 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
184 &quot;line1&quot;: &quot;A String&quot;, # The street name and number of this address.
185 &quot;line2&quot;: &quot;A String&quot;, # The second line the address, if needed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700186 },
187 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700188 &quot;phones&quot;: [ # The official&#x27;s public contact phone numbers.
189 &quot;A String&quot;,
190 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700191 &quot;urls&quot;: [ # The official&#x27;s public website URLs.
192 &quot;A String&quot;,
193 ],
194 },
195 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700196 &quot;divisions&quot;: { # A map of political geographic divisions that contain the requested address, keyed by the unique Open Civic Data identifier for this division.
197 &quot;a_key&quot;: { # Describes a political geography.
198 &quot;officeIndices&quot;: [ # List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request.
199 42,
200 ],
201 &quot;name&quot;: &quot;A String&quot;, # The name of the division.
202 &quot;alsoKnownAs&quot;: [ # Any other valid OCD IDs that refer to the same division.\n\nBecause OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list.\n\nFor example, if this division&#x27;s OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.
203 &quot;A String&quot;,
204 ],
205 },
206 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700207 }</pre>
208</div>
209
210<div class="method">
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700211 <code class="details" id="representativeInfoByDivision">representativeInfoByDivision(ocdId, roles=None, levels=None, recursive=None, x__xgafv=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700212 <pre>Looks up representative information for a single geographic division.
213
214Args:
215 ocdId: string, The Open Civic Data division identifier of the division to look up. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700216 roles: string, A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don&#x27;t contain a matching office will not be returned. (repeated)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700217 Allowed values
218 headOfState -
219 headOfGovernment -
220 deputyHeadOfGovernment -
221 governmentOfficer -
222 executiveCouncil -
223 legislatorUpperBody -
224 legislatorLowerBody -
225 highestCourtJudge -
226 judge -
227 schoolBoard -
228 specialPurposeOfficer -
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700229 levels: string, A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don&#x27;t contain a matching office will not be returned. (repeated)
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700230 Allowed values
231 international -
232 country -
233 administrativeArea1 -
234 regional -
235 administrativeArea2 -
236 locality -
237 subLocality1 -
238 subLocality2 -
239 special -
240 recursive: boolean, If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC&#x27;s wards and ANCs.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700241 x__xgafv: string, V1 error format.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700242 Allowed values
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700243 1 - v1 error format
244 2 - v2 error format
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700245
246Returns:
247 An object of the form:
248
249 {
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700250 &quot;divisions&quot;: { # A map of political geographic divisions that contain the requested address, keyed by the unique Open Civic Data identifier for this division.
251 &quot;a_key&quot;: { # Describes a political geography.
252 &quot;officeIndices&quot;: [ # List of indices in the offices array, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request.
253 42,
254 ],
255 &quot;name&quot;: &quot;A String&quot;, # The name of the division.
256 &quot;alsoKnownAs&quot;: [ # Any other valid OCD IDs that refer to the same division.\n\nBecause OCD IDs are meant to be human-readable and at least somewhat predictable, there are occasionally several identifiers for a single division. These identifiers are defined to be equivalent to one another, and one is always indicated as the primary identifier. The primary identifier will be returned in ocd_id above, and any other equivalent valid identifiers will be returned in this list.\n\nFor example, if this division&#x27;s OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.
257 &quot;A String&quot;,
258 ],
259 },
260 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700261 &quot;offices&quot;: [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
262 { # Information about an Office held by one or more Officials.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;sources&quot;: [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
264 { # Contains information about the data source for the element containing it.
Bu Sun Kim65020912020-05-20 12:08:20 -0700265 &quot;official&quot;: True or False, # Whether this data comes from an official government source.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700266 &quot;name&quot;: &quot;A String&quot;, # The name of the data source.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700267 },
268 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700269 &quot;levels&quot;: [ # The levels of government of which this office is part. 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 &quot;locality&quot; level, but also effectively at both &quot;administrative-area-2&quot; and &quot;administrative-area-1&quot;.
270 &quot;A String&quot;,
271 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700272 &quot;officialIndices&quot;: [ # List of indices in the officials array of people who presently hold this office.
273 42,
274 ],
275 &quot;divisionId&quot;: &quot;A String&quot;, # The OCD ID of the division with which this office is associated.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700276 &quot;roles&quot;: [ # The roles which this office fulfills. Roles are not meant to be exhaustive, or to exactly specify the entire set of responsibilities of a given office, but are meant to be rough categories that are useful for general selection from or sorting of a list of offices.
277 &quot;A String&quot;,
278 ],
279 &quot;name&quot;: &quot;A String&quot;, # The human-readable name of the office.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700280 },
281 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700282 &quot;officials&quot;: [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
283 { # Information about a person holding an elected office.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700284 &quot;party&quot;: &quot;A String&quot;, # The full name of the party the official belongs to.
285 &quot;channels&quot;: [ # A list of known (social) media channels for this official.
286 { # A social media or web channel for a candidate.
287 &quot;type&quot;: &quot;A String&quot;, # 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
288 &quot;id&quot;: &quot;A String&quot;, # The unique public identifier for the candidate&#x27;s channel.
289 },
290 ],
291 &quot;photoUrl&quot;: &quot;A String&quot;, # A URL for a photo of the official.
292 &quot;name&quot;: &quot;A String&quot;, # The official&#x27;s name.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700293 &quot;emails&quot;: [ # The direct email addresses for the official.
294 &quot;A String&quot;,
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700295 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700296 &quot;address&quot;: [ # Addresses at which to contact the official.
297 { # A simple representation of an address.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700298 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700299 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700300 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
301 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
302 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
303 &quot;line1&quot;: &quot;A String&quot;, # The street name and number of this address.
304 &quot;line2&quot;: &quot;A String&quot;, # The second line the address, if needed.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700305 },
306 ],
Dmitry Frenkel3e17f892020-10-06 16:46:05 -0700307 &quot;phones&quot;: [ # The official&#x27;s public contact phone numbers.
308 &quot;A String&quot;,
309 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700310 &quot;urls&quot;: [ # The official&#x27;s public website URLs.
311 &quot;A String&quot;,
312 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700313 },
314 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700315 }</pre>
316</div>
317
318</body></html>