Representatives: representativeInfoByAddress

查詢單一地址的政治地理位置和代表資訊。立即試用

要求

HTTP 要求

GET https://www.googleapis.com/civicinfo/v2/representatives

參數

參數名稱 說明
選用查詢參數
address string 要查詢的地址。只有在網址中未指定 ocdId 欄位時,才能指定該欄位。
includeOffices boolean 是否要傳回辦公室和官員的相關資訊。如果設為 False,系統只會傳回頂層行政區資訊。 (預設值:true)
levels string 要做為篩選依據的辦公室層級清單。系統只會傳回至少提供其中一級的辦公室。系統不會傳回沒有相符的辦公室的部門。

可接受的值如下:
  • administrativeArea1
  • administrativeArea2
  • country
  • international
  • locality
  • regional
  • special
  • subLocality1
  • subLocality2
roles string 做為篩選依據的辦公室角色清單。系統只會傳回具備這類角色的辦公室。系統不會傳回不包含相符的辦公室的部門。

可接受的值如下:
  • deputyHeadOfGovernment
  • executiveCouncil
  • governmentOfficer
  • headOfGovernment
  • headOfState
  • highestCourtJudge
  • judge
  • legislatorLowerBody
  • legislatorUpperBody
  • schoolBoard
  • specialPurposeOfficer

要求主體

請勿使用這個方法提供要求主體。

回應

如果成功的話,這個方法會傳回回應內文,其結構如下:

{
  "kind": "civicinfo#representativeInfoResponse",
  "normalizedInput": {
    "locationName": string,
    "line1": string,
    "line2": string,
    "line3": string,
    "city": string,
    "state": string,
    "zip": string
  },
  "divisions": {
    (key): {
      "name": string,
      "alsoKnownAs": [
        string
      ],
      "officeIndices": [
        unsigned integer
      ]
    }
  },
  "offices": [
    {
      "name": string,
      "divisionId": string,
      "levels": [
        string
      ],
      "roles": [
        string
      ],
      "sources": [
        {
          "name": string,
          "official": boolean
        }
      ],
      "officialIndices": [
        unsigned integer
      ]
    }
  ],
  "officials": [
    {
      "name": string,
      "address": [
        {
          "locationName": string,
          "line1": string,
          "line2": string,
          "line3": string,
          "city": string,
          "state": string,
          "zip": string
        }
      ],
      "party": string,
      "phones": [
        string
      ],
      "urls": [
        string
      ],
      "photoUrl": string,
      "emails": [
        string
      ],
      "channels": [
        {
          "type": string,
          "id": string
        }
      ]
    }
  ]
}
屬性名稱 說明 附註
kind string 識別資源的種類。值:固定字串 "civicinfo#representativeInfoResponse"
normalizedInput nested object 要求位址的正規化版本
normalizedInput.locationName string 地點的名稱。
normalizedInput.line1 string 這個地址的街道名稱和門牌號碼。
normalizedInput.line2 string 地址的第二行 (如有需要)。
normalizedInput.line3 string 地址的第三行 (如有需要)。
normalizedInput.city string 地址所在的城市或鄉鎮。
normalizedInput.state string 美國兩個字母的州名縮寫。
normalizedInput.zip string 地址的美國郵遞區號。
divisions object 包含要求地址的政治地理區域劃分。詳情請參閱代表資源說明文件。
offices[] list 上述部門所指的選民辦公室。只有在要求中 includeOffices 為 true 時,才會出現。詳情請參閱代表資源說明文件。
officials[] list 擁有上述辦公室的官員。只有在要求中 includeOffices 為 true 時,才會出現。詳情請參閱代表資源說明文件。

試試看!