| 1 |
<html><body> |
| 2 |
<style> |
| 3 |
|
| 4 |
body, 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 |
|
| 15 |
body { |
| 16 |
font-size: 13px; |
| 17 |
padding: 1em; |
| 18 |
} |
| 19 |
|
| 20 |
h1 { |
| 21 |
font-size: 26px; |
| 22 |
margin-bottom: 1em; |
| 23 |
} |
| 24 |
|
| 25 |
h2 { |
| 26 |
font-size: 24px; |
| 27 |
margin-bottom: 1em; |
| 28 |
} |
| 29 |
|
| 30 |
h3 { |
| 31 |
font-size: 20px; |
| 32 |
margin-bottom: 1em; |
| 33 |
margin-top: 1em; |
| 34 |
} |
| 35 |
|
| 36 |
pre, code { |
| 37 |
line-height: 1.5; |
| 38 |
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 |
} |
| 40 |
|
| 41 |
pre { |
| 42 |
margin-top: 0.5em; |
| 43 |
} |
| 44 |
|
| 45 |
h1, h2, h3, p { |
| 46 |
font-family: Arial, sans serif; |
| 47 |
} |
| 48 |
|
| 49 |
h1, 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"> |
| 78 |
<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(address=None, includeOffices=None, levels=None, roles=None, x__xgafv=None)</a></code></p> |
| 82 |
<p class="firstline">Looks up political geography and representative information for a single address.</p> |
| 83 |
<p class="toc_element"> |
| 84 |
<code><a href="#representativeInfoByDivision">representativeInfoByDivision(ocdId, levels=None, recursive=None, roles=None, x__xgafv=None)</a></code></p> |
| 85 |
<p class="firstline">Looks up representative information for a single geographic division.</p> |
| 86 |
<h3>Method Details</h3> |
| 87 |
<div class="method"> |
| 88 |
<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(address=None, includeOffices=None, levels=None, roles=None, x__xgafv=None)</code> |
| 94 |
<pre>Looks up political geography and representative information for a single address. |
| 95 |
|
| 96 |
Args: |
| 97 |
address: string, The address to look up. May only be specified if the field ocdId is not given in the URL |
| 98 |
includeOffices: boolean, Whether to return information about offices and officials. If false, only the top-level district information will be returned. |
| 99 |
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't contain a matching office will not be returned. (repeated) |
| 100 |
Allowed values |
| 101 |
international - |
| 102 |
country - |
| 103 |
administrativeArea1 - |
| 104 |
regional - |
| 105 |
administrativeArea2 - |
| 106 |
locality - |
| 107 |
subLocality1 - |
| 108 |
subLocality2 - |
| 109 |
special - |
| 110 |
roles: string, A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. (repeated) |
| 111 |
Allowed values |
| 112 |
headOfState - |
| 113 |
headOfGovernment - |
| 114 |
deputyHeadOfGovernment - |
| 115 |
governmentOfficer - |
| 116 |
executiveCouncil - |
| 117 |
legislatorUpperBody - |
| 118 |
legislatorLowerBody - |
| 119 |
highestCourtJudge - |
| 120 |
judge - |
| 121 |
schoolBoard - |
| 122 |
specialPurposeOfficer - |
| 123 |
otherRole - |
| 124 |
x__xgafv: string, V1 error format. |
| 125 |
Allowed values |
| 126 |
1 - v1 error format |
| 127 |
2 - v2 error format |
| 128 |
|
| 129 |
Returns: |
| 130 |
An object of the form: |
| 131 |
|
| 132 |
{ # The result of a representative info lookup query. |
| 133 |
"divisions": { # A map of political geographic divisions that contain the requested address, keyed by the unique Open Civic Data identifier for this division. |
| 134 |
"a_key": { # Describes a political geography. |
| 135 |
"alsoKnownAs": [ # 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's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. |
| 136 |
"A String", |
| 137 |
], |
| 138 |
"name": "A String", # The name of the division. |
| 139 |
"officeIndices": [ # 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. |
| 140 |
42, |
| 141 |
], |
| 142 |
}, |
| 143 |
}, |
| 144 |
"kind": "civicinfo#representativeInfoResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#representativeInfoResponse". |
| 145 |
"normalizedInput": { # A simple representation of an address. # The normalized version of the requested address |
| 146 |
"city": "A String", # The city or town for the address. |
| 147 |
"line1": "A String", # The street name and number of this address. |
| 148 |
"line2": "A String", # The second line the address, if needed. |
| 149 |
"line3": "A String", # The third line of the address, if needed. |
| 150 |
"locationName": "A String", # The name of the location. |
| 151 |
"state": "A String", # The US two letter state abbreviation of the address. |
| 152 |
"zip": "A String", # The US Postal Zip Code of the address. |
| 153 |
}, |
| 154 |
"offices": [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. |
| 155 |
{ # Information about an Office held by one or more Officials. |
| 156 |
"divisionId": "A String", # The OCD ID of the division with which this office is associated. |
| 157 |
"levels": [ # 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 "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1". |
| 158 |
"A String", |
| 159 |
], |
| 160 |
"name": "A String", # The human-readable name of the office. |
| 161 |
"officialIndices": [ # List of indices in the officials array of people who presently hold this office. |
| 162 |
42, |
| 163 |
], |
| 164 |
"roles": [ # 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. |
| 165 |
"A String", |
| 166 |
], |
| 167 |
"sources": [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources. |
| 168 |
{ # Contains information about the data source for the element containing it. |
| 169 |
"name": "A String", # The name of the data source. |
| 170 |
"official": True or False, # Whether this data comes from an official government source. |
| 171 |
}, |
| 172 |
], |
| 173 |
}, |
| 174 |
], |
| 175 |
"officials": [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request. |
| 176 |
{ # Information about a person holding an elected office. |
| 177 |
"address": [ # Addresses at which to contact the official. |
| 178 |
{ # A simple representation of an address. |
| 179 |
"city": "A String", # The city or town for the address. |
| 180 |
"line1": "A String", # The street name and number of this address. |
| 181 |
"line2": "A String", # The second line the address, if needed. |
| 182 |
"line3": "A String", # The third line of the address, if needed. |
| 183 |
"locationName": "A String", # The name of the location. |
| 184 |
"state": "A String", # The US two letter state abbreviation of the address. |
| 185 |
"zip": "A String", # The US Postal Zip Code of the address. |
| 186 |
}, |
| 187 |
], |
| 188 |
"channels": [ # A list of known (social) media channels for this official. |
| 189 |
{ # A social media or web channel for a candidate. |
| 190 |
"id": "A String", # The unique public identifier for the candidate's channel. |
| 191 |
"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 |
| 192 |
}, |
| 193 |
], |
| 194 |
"emails": [ # The direct email addresses for the official. |
| 195 |
"A String", |
| 196 |
], |
| 197 |
"name": "A String", # The official's name. |
| 198 |
"party": "A String", # The full name of the party the official belongs to. |
| 199 |
"phones": [ # The official's public contact phone numbers. |
| 200 |
"A String", |
| 201 |
], |
| 202 |
"photoUrl": "A String", # A URL for a photo of the official. |
| 203 |
"urls": [ # The official's public website URLs. |
| 204 |
"A String", |
| 205 |
], |
| 206 |
}, |
| 207 |
], |
| 208 |
}</pre> |
| 209 |
</div> |
| 210 |
|
| 211 |
<div class="method"> |
| 212 |
<code class="details" id="representativeInfoByDivision">representativeInfoByDivision(ocdId, levels=None, recursive=None, roles=None, x__xgafv=None)</code> |
| 213 |
<pre>Looks up representative information for a single geographic division. |
| 214 |
|
| 215 |
Args: |
| 216 |
ocdId: string, The Open Civic Data division identifier of the division to look up. (required) |
| 217 |
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't contain a matching office will not be returned. (repeated) |
| 218 |
Allowed values |
| 219 |
international - |
| 220 |
country - |
| 221 |
administrativeArea1 - |
| 222 |
regional - |
| 223 |
administrativeArea2 - |
| 224 |
locality - |
| 225 |
subLocality1 - |
| 226 |
subLocality2 - |
| 227 |
special - |
| 228 |
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's wards and ANCs. |
| 229 |
roles: string, A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. (repeated) |
| 230 |
Allowed values |
| 231 |
headOfState - |
| 232 |
headOfGovernment - |
| 233 |
deputyHeadOfGovernment - |
| 234 |
governmentOfficer - |
| 235 |
executiveCouncil - |
| 236 |
legislatorUpperBody - |
| 237 |
legislatorLowerBody - |
| 238 |
highestCourtJudge - |
| 239 |
judge - |
| 240 |
schoolBoard - |
| 241 |
specialPurposeOfficer - |
| 242 |
otherRole - |
| 243 |
x__xgafv: string, V1 error format. |
| 244 |
Allowed values |
| 245 |
1 - v1 error format |
| 246 |
2 - v2 error format |
| 247 |
|
| 248 |
Returns: |
| 249 |
An object of the form: |
| 250 |
|
| 251 |
{ |
| 252 |
"divisions": { # A map of political geographic divisions that contain the requested address, keyed by the unique Open Civic Data identifier for this division. |
| 253 |
"a_key": { # Describes a political geography. |
| 254 |
"alsoKnownAs": [ # 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's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. |
| 255 |
"A String", |
| 256 |
], |
| 257 |
"name": "A String", # The name of the division. |
| 258 |
"officeIndices": [ # 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. |
| 259 |
42, |
| 260 |
], |
| 261 |
}, |
| 262 |
}, |
| 263 |
"offices": [ # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. |
| 264 |
{ # Information about an Office held by one or more Officials. |
| 265 |
"divisionId": "A String", # The OCD ID of the division with which this office is associated. |
| 266 |
"levels": [ # 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 "locality" level, but also effectively at both "administrative-area-2" and "administrative-area-1". |
| 267 |
"A String", |
| 268 |
], |
| 269 |
"name": "A String", # The human-readable name of the office. |
| 270 |
"officialIndices": [ # List of indices in the officials array of people who presently hold this office. |
| 271 |
42, |
| 272 |
], |
| 273 |
"roles": [ # 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. |
| 274 |
"A String", |
| 275 |
], |
| 276 |
"sources": [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources. |
| 277 |
{ # Contains information about the data source for the element containing it. |
| 278 |
"name": "A String", # The name of the data source. |
| 279 |
"official": True or False, # Whether this data comes from an official government source. |
| 280 |
}, |
| 281 |
], |
| 282 |
}, |
| 283 |
], |
| 284 |
"officials": [ # Officials holding the offices listed above. Will only be present if includeOffices was true in the request. |
| 285 |
{ # Information about a person holding an elected office. |
| 286 |
"address": [ # Addresses at which to contact the official. |
| 287 |
{ # A simple representation of an address. |
| 288 |
"city": "A String", # The city or town for the address. |
| 289 |
"line1": "A String", # The street name and number of this address. |
| 290 |
"line2": "A String", # The second line the address, if needed. |
| 291 |
"line3": "A String", # The third line of the address, if needed. |
| 292 |
"locationName": "A String", # The name of the location. |
| 293 |
"state": "A String", # The US two letter state abbreviation of the address. |
| 294 |
"zip": "A String", # The US Postal Zip Code of the address. |
| 295 |
}, |
| 296 |
], |
| 297 |
"channels": [ # A list of known (social) media channels for this official. |
| 298 |
{ # A social media or web channel for a candidate. |
| 299 |
"id": "A String", # The unique public identifier for the candidate's channel. |
| 300 |
"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 |
| 301 |
}, |
| 302 |
], |
| 303 |
"emails": [ # The direct email addresses for the official. |
| 304 |
"A String", |
| 305 |
], |
| 306 |
"name": "A String", # The official's name. |
| 307 |
"party": "A String", # The full name of the party the official belongs to. |
| 308 |
"phones": [ # The official's public contact phone numbers. |
| 309 |
"A String", |
| 310 |
], |
| 311 |
"photoUrl": "A String", # A URL for a photo of the official. |
| 312 |
"urls": [ # The official's public website URLs. |
| 313 |
"A String", |
| 314 |
], |
| 315 |
}, |
| 316 |
], |
| 317 |
}</pre> |
| 318 |
</div> |
| 319 |
|
| 320 |
</body></html> |