blob: b721ab99606143e8f4ef1222ac32a22864afdf60 [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">
Bu Sun Kim65020912020-05-20 12:08:20 -070078 <code><a href="#representativeInfoByAddress">representativeInfoByAddress(address=None, includeOffices=None, levels=None, roles=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070079<p class="firstline">Looks up political geography and representative information for a single address.</p>
80<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#representativeInfoByDivision">representativeInfoByDivision(ocdId, levels=None, recursive=None, roles=None)</a></code></p>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070082<p class="firstline">Looks up representative information for a single geographic division.</p>
83<h3>Method Details</h3>
84<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -070085 <code class="details" id="representativeInfoByAddress">representativeInfoByAddress(address=None, includeOffices=None, levels=None, roles=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -070086 <pre>Looks up political geography and representative information for a single address.
87
88Args:
Bu Sun Kim65020912020-05-20 12:08:20 -070089 address: string, The address to look up. May only be specified if the field ocdId is not given in the URL.
90 includeOffices: boolean, Whether to return information about offices and officials. If false, only the top-level district information will be returned.
91 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)
Craig Citro0e5b9bf2014-10-15 10:26:14 -070092 Allowed values
93 administrativeArea1 -
94 administrativeArea2 -
95 country -
96 international -
97 locality -
98 regional -
99 special -
100 subLocality1 -
101 subLocality2 -
Bu Sun Kim65020912020-05-20 12:08:20 -0700102 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)
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700103 Allowed values
104 deputyHeadOfGovernment -
105 executiveCouncil -
106 governmentOfficer -
107 headOfGovernment -
108 headOfState -
109 highestCourtJudge -
110 judge -
111 legislatorLowerBody -
112 legislatorUpperBody -
113 schoolBoard -
114 specialPurposeOfficer -
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700115
116Returns:
117 An object of the form:
118
119 { # The result of a representative info lookup query.
Bu Sun Kim65020912020-05-20 12:08:20 -0700120 &quot;divisions&quot;: { # Political geographic divisions that contain the requested address.
121 &quot;a_key&quot;: { # Describes a political geography. # The unique Open Civic Data identifier for this division.
122 &quot;alsoKnownAs&quot;: [ # Any other valid OCD IDs that refer to the same division.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700123 #
124 # Because 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.
125 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700126 # For example, if this division&#x27;s OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.
127 &quot;A String&quot;,
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700128 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700129 &quot;name&quot;: &quot;A String&quot;, # The name of the division.
130 &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.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700131 42,
132 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700133 },
134 },
135 &quot;kind&quot;: &quot;civicinfo#representativeInfoResponse&quot;, # Identifies what kind of resource this is. Value: the fixed string &quot;civicinfo#representativeInfoResponse&quot;.
136 &quot;normalizedInput&quot;: { # A simple representation of an address. # The normalized version of the requested address
137 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
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 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
141 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
142 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
143 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
144 },
145 &quot;offices&quot;: [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
146 { # Information about an Office held by one or more Officials.
147 &quot;divisionId&quot;: &quot;A String&quot;, # The OCD ID of the division with which this office is associated.
148 &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;.
149 &quot;A String&quot;,
150 ],
151 &quot;name&quot;: &quot;A String&quot;, # The human-readable name of the office.
152 &quot;officialIndices&quot;: [ # List of indices in the officials array of people who presently hold this office.
153 42,
154 ],
155 &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.
156 &quot;A String&quot;,
157 ],
158 &quot;sources&quot;: [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700159 { # Contains information about the data source for the element containing it.
Bu Sun Kim65020912020-05-20 12:08:20 -0700160 &quot;name&quot;: &quot;A String&quot;, # The name of the data source.
161 &quot;official&quot;: True or False, # Whether this data comes from an official government source.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700162 },
163 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700164 },
165 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700166 &quot;officials&quot;: [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
167 { # Information about a person holding an elected office.
168 &quot;address&quot;: [ # Addresses at which to contact the official.
169 { # A simple representation of an address.
170 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
171 &quot;line1&quot;: &quot;A String&quot;, # The street name and number of this address.
172 &quot;line2&quot;: &quot;A String&quot;, # The second line the address, if needed.
173 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
174 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
175 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
176 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
177 },
178 ],
179 &quot;channels&quot;: [ # A list of known (social) media channels for this official.
180 { # A social media or web channel for a candidate.
181 &quot;id&quot;: &quot;A String&quot;, # The unique public identifier for the candidate&#x27;s channel.
182 &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
183 },
184 ],
185 &quot;emails&quot;: [ # The direct email addresses for the official.
186 &quot;A String&quot;,
187 ],
188 &quot;name&quot;: &quot;A String&quot;, # The official&#x27;s name.
189 &quot;party&quot;: &quot;A String&quot;, # The full name of the party the official belongs to.
190 &quot;phones&quot;: [ # The official&#x27;s public contact phone numbers.
191 &quot;A String&quot;,
192 ],
193 &quot;photoUrl&quot;: &quot;A String&quot;, # A URL for a photo of the official.
194 &quot;urls&quot;: [ # The official&#x27;s public website URLs.
195 &quot;A String&quot;,
196 ],
197 },
198 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700199 }</pre>
200</div>
201
202<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700203 <code class="details" id="representativeInfoByDivision">representativeInfoByDivision(ocdId, levels=None, recursive=None, roles=None)</code>
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700204 <pre>Looks up representative information for a single geographic division.
205
206Args:
207 ocdId: string, The Open Civic Data division identifier of the division to look up. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700208 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)
209 Allowed values
210 administrativeArea1 -
211 administrativeArea2 -
212 country -
213 international -
214 locality -
215 regional -
216 special -
217 subLocality1 -
218 subLocality2 -
219 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.
220 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)
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700221 Allowed values
222 deputyHeadOfGovernment -
223 executiveCouncil -
224 governmentOfficer -
225 headOfGovernment -
226 headOfState -
227 highestCourtJudge -
228 judge -
229 legislatorLowerBody -
230 legislatorUpperBody -
231 schoolBoard -
232 specialPurposeOfficer -
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700233
234Returns:
235 An object of the form:
236
237 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700238 &quot;divisions&quot;: { # Political geographic divisions that contain the requested address.
239 &quot;a_key&quot;: { # Describes a political geography. # The unique Open Civic Data identifier for this division.
240 &quot;alsoKnownAs&quot;: [ # Any other valid OCD IDs that refer to the same division.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700241 #
242 # Because 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.
243 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700244 # For example, if this division&#x27;s OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc.
245 &quot;A String&quot;,
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700246 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700247 &quot;name&quot;: &quot;A String&quot;, # The name of the division.
248 &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.
249 42,
250 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700251 },
252 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700253 &quot;offices&quot;: [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request.
254 { # Information about an Office held by one or more Officials.
255 &quot;divisionId&quot;: &quot;A String&quot;, # The OCD ID of the division with which this office is associated.
256 &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;.
257 &quot;A String&quot;,
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700258 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700259 &quot;name&quot;: &quot;A String&quot;, # The human-readable name of the office.
260 &quot;officialIndices&quot;: [ # List of indices in the officials array of people who presently hold this office.
261 42,
262 ],
263 &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.
264 &quot;A String&quot;,
265 ],
266 &quot;sources&quot;: [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources.
267 { # Contains information about the data source for the element containing it.
268 &quot;name&quot;: &quot;A String&quot;, # The name of the data source.
269 &quot;official&quot;: True or False, # Whether this data comes from an official government source.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700270 },
271 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700272 },
273 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700274 &quot;officials&quot;: [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request.
275 { # Information about a person holding an elected office.
276 &quot;address&quot;: [ # Addresses at which to contact the official.
277 { # A simple representation of an address.
278 &quot;city&quot;: &quot;A String&quot;, # The city or town for the address.
279 &quot;line1&quot;: &quot;A String&quot;, # The street name and number of this address.
280 &quot;line2&quot;: &quot;A String&quot;, # The second line the address, if needed.
281 &quot;line3&quot;: &quot;A String&quot;, # The third line of the address, if needed.
282 &quot;locationName&quot;: &quot;A String&quot;, # The name of the location.
283 &quot;state&quot;: &quot;A String&quot;, # The US two letter state abbreviation of the address.
284 &quot;zip&quot;: &quot;A String&quot;, # The US Postal Zip Code of the address.
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700285 },
286 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700287 &quot;channels&quot;: [ # A list of known (social) media channels for this official.
288 { # A social media or web channel for a candidate.
289 &quot;id&quot;: &quot;A String&quot;, # The unique public identifier for the candidate&#x27;s channel.
290 &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
291 },
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700292 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700293 &quot;emails&quot;: [ # The direct email addresses for the official.
294 &quot;A String&quot;,
295 ],
296 &quot;name&quot;: &quot;A String&quot;, # The official&#x27;s name.
297 &quot;party&quot;: &quot;A String&quot;, # The full name of the party the official belongs to.
298 &quot;phones&quot;: [ # The official&#x27;s public contact phone numbers.
299 &quot;A String&quot;,
300 ],
301 &quot;photoUrl&quot;: &quot;A String&quot;, # A URL for a photo of the official.
302 &quot;urls&quot;: [ # The official&#x27;s public website URLs.
303 &quot;A String&quot;,
304 ],
Craig Citro0e5b9bf2014-10-15 10:26:14 -0700305 },
306 ],
307 }</pre>
308</div>
309
310</body></html>