Google Civic Information API . divisions

Instance Methods

search(query=None)

Searches for political divisions by their natural name or OCD ID.

Method Details

search(query=None)
Searches for political divisions by their natural name or OCD ID.

Args:
  query: string, The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html

Returns:
  An object of the form:

    { # The result of a division search query.
    "kind": "civicinfo#divisionSearchResponse", # Identifies what kind of resource this is. Value: the fixed string "civicinfo#divisionSearchResponse".
    "results": [
      { # Represents a political geographic division that matches the requested query.
        "ocdId": "A String", # The unique Open Civic Data identifier for this division.
        "name": "A String", # The name of the division.
        "aliases": [ # Other Open Civic Data identifiers that refer to the same division -- for example, those that refer to other political divisions whose boundaries are defined to be coterminous with this one. For example, ocd-division/country:us/state:wy will include an alias of ocd-division/country:us/state:wy/cd:1, since Wyoming has only one Congressional district.
          "A String",
        ],
      },
    ],
  }