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 要作为过滤依据的 Office 角色列表。系统将仅返回担任这些角色之一的办事处。系统不会返回不包含匹配办公室的部门。

可接受的值:
  • 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 时,才会显示。如需了解详情,请参阅代表资源文档。

试试看!