Craig Citro | 065b530 | 2014-08-14 00:47:23 -0700 | [diff] [blame] | 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_v1.html">Google Civic Information API</a> . <a href="civicinfo_v1.representatives.html">representatives</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#representativeInfoQuery">representativeInfoQuery(body, recursive=None, ocdId=None, includeOffices=None)</a></code></p> |
| 79 | <p class="firstline">Looks up political geography and representative information based on an address or Open Civic Data division identifier.</p> |
| 80 | <h3>Method Details</h3> |
| 81 | <div class="method"> |
| 82 | <code class="details" id="representativeInfoQuery">representativeInfoQuery(body, recursive=None, ocdId=None, includeOffices=None)</code> |
| 83 | <pre>Looks up political geography and representative information based on an address or Open Civic Data division identifier. |
| 84 | |
| 85 | Args: |
| 86 | body: object, The request body. (required) |
| 87 | The object takes the form of: |
| 88 | |
| 89 | { # A request for political geography and representative information for an address. |
| 90 | "address": "A String", # The address to look up. May only be specified if the field ocdId is not given in the URL. |
| 91 | } |
| 92 | |
| 93 | recursive: boolean, When ocd_id is supplied, return all divisions which are hierarchically nested within the queried division. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. |
| 94 | ocdId: string, The division to look up. May only be specified if the address field is not given in the request body. |
| 95 | includeOffices: boolean, Whether to return information about offices and officials. If false, only the top-level district information will be returned. |
| 96 | |
| 97 | Returns: |
| 98 | An object of the form: |
| 99 | |
| 100 | { # The result of a representative info lookup query. |
| 101 | "status": "A String", # The result of the request. One of: success, noStreetSegmentFound, addressUnparseable, noAddressParameter, multipleStreetSegmentsFound, electionOver, electionUnknown, internalLookupFailure, RequestedBothAddressAndOcdId |
| 102 | "divisions": { # Political geographic divisions that contain the requested address. |
| 103 | "a_key": { # Describes a political geography. # The unique Open Civic Data identifier for this division. |
| 104 | "scope": "A String", # The geographic scope of the division. If unspecified, the division's geography is not known. One of: national, statewide, congressional, stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, township, countyCouncil, cityCouncil, ward, special |
| 105 | "officeIds": [ # List of keys in the offices object, one for each office elected from this division. Will only be present if includeOffices was true (or absent) in the request. |
| 106 | "A String", |
| 107 | ], |
| 108 | "alsoKnownAs": [ # Any other valid OCD IDs that refer to the same division. For example, if this division's OCD ID is ocd-division/country:us/district:dc, this will contain ocd-division/country:us/state:dc. |
| 109 | "A String", |
| 110 | ], |
| 111 | "name": "A String", # The name of the division. |
| 112 | }, |
| 113 | }, |
| 114 | "kind": "civicinfo#representativeInfoResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#representativeInfoResponse". |
| 115 | "normalizedInput": { # A simple representation of an address. # The normalized version of the requested address |
| 116 | "city": "A String", # The city or town for the address. |
| 117 | "zip": "A String", # The US Postal Zip Code of the address. |
| 118 | "line3": "A String", # The third line of the address, if needed. |
| 119 | "line2": "A String", # The second line the address, if needed. |
| 120 | "line1": "A String", # The street name and number of this address. |
| 121 | "locationName": "A String", # The name of the location. |
| 122 | "state": "A String", # The US two letter state abbreviation of the address. |
| 123 | }, |
| 124 | "officials": { # Officials holding the offices listed above. Will only be present if includeOffices was true in the request. |
| 125 | "a_key": { # Information about a official holding an elected office. # A unique identifier for this official, within the context of this request. Identifiers are *not* long-lived: the same official may get different IDs on different requests. |
| 126 | "name": "A String", # The official's name. |
| 127 | "photoUrl": "A String", # A URL for a photo of the official. |
| 128 | "phones": [ # The official's public contact phone numbers. |
| 129 | "A String", |
| 130 | ], |
| 131 | "channels": [ # A list of known (social) media channels for this official. |
| 132 | { # A social media or web channel for a candidate. |
| 133 | "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 |
| 134 | "id": "A String", # The unique public identifier for the candidate's channel. |
| 135 | }, |
| 136 | ], |
| 137 | "urls": [ # The official's public website URLs. |
| 138 | "A String", |
| 139 | ], |
| 140 | "address": [ # Addresses at which to contact the official. |
| 141 | { # A simple representation of an address. |
| 142 | "city": "A String", # The city or town for the address. |
| 143 | "zip": "A String", # The US Postal Zip Code of the address. |
| 144 | "line3": "A String", # The third line of the address, if needed. |
| 145 | "line2": "A String", # The second line the address, if needed. |
| 146 | "line1": "A String", # The street name and number of this address. |
| 147 | "locationName": "A String", # The name of the location. |
| 148 | "state": "A String", # The US two letter state abbreviation of the address. |
| 149 | }, |
| 150 | ], |
| 151 | "party": "A String", # The full name of the party the official belongs to. |
| 152 | "emails": [ # The direct email addresses for the official. |
| 153 | "A String", |
| 154 | ], |
| 155 | }, |
| 156 | }, |
| 157 | "offices": { # Elected offices referenced by the divisions listed above. Will only be present if includeOffices was true in the request. |
| 158 | "a_key": { # Information about an Office held by one or more Officials. # A unique identifier for this office, within the context of this request. Identifiers are *not* long-lived: the same office may get different IDs on different requests. |
| 159 | "divisionId": "A String", # The OCD ID of the division with which this office is associated. |
| 160 | "sources": [ # A list of sources for this office. If multiple sources are listed, the data has been aggregated from those sources. |
| 161 | { # Contains information about the data source for the element containing it. |
| 162 | "official": True or False, # Whether this data comes from an official government source. |
| 163 | "name": "A String", # The name of the data source. |
| 164 | }, |
| 165 | ], |
| 166 | "officialIds": [ # List of keys in the officials object of people who presently hold this office. |
| 167 | "A String", |
| 168 | ], |
| 169 | "name": "A String", # The human-readable name of the office. |
| 170 | "level": "A String", # The level of this elected office. One of: federal, state, county, city, other |
| 171 | }, |
| 172 | }, |
| 173 | }</pre> |
| 174 | </div> |
| 175 | |
| 176 | </body></html> |