文档

邮编查询

更新时间:

对输入地址,识别出其所对应的邮政编码,默认细化到区县级别。

测试

您可以在地址标准化产品控制台进行API测试

请求参数

名称

类型

是否必选

示例值

描述

Action

String

GetZipcode

系统规定参数。取值:GetZipcode。

AppKey

String

Axqwerasdf1a

项目AppKey

ServiceCode

String

addrp

固定值:addrp

Text

String

浙江省杭州市文一西路969号

文本内容

DefaultProvince

String

浙江省

默认省份

DefaultCity

String

杭州市

默认城市

DefaultDistrict

String

余杭区

默认行政区

返回数据

名称

类型

示例值

描述

Data

String

{"zipcode":"311100","time_used":{"rt":{"zipcode":"0.004756927490234375","complete":"0.020321130752563477","structure":"0.007731199264526367"},"start":"1589800854.316437"},"status":"OK"}

zipcode:邮政编码(当前仅支持返回中国内地邮政编码)

time_used:算法处理耗时

status:状态

RequestId

String

D0078DC6-8A1F-41A0-9A5F-A6B6443E9A65

RequestId

示例

请求示例

http(s)://[Endpoint]/?Action=GetZipcode
&AppKey=Axqwerasdf1a
&ServiceCode=addrp
&Text=浙江省杭州市文一西路969号
&<公共请求参数>

正常返回示例

XML格式

<RequestId>D0078DC6-8A1F-41A0-9A5F-A6B6443E9A65</RequestId>
<Data>
    <zipcode>311100</zipcode>
    <time_used>
        <rt>
            <zipcode>0.004756927490234375</zipcode>
            <complete>0.020321130752563477</complete>
            <structure>0.007731199264526367</structure>
        </rt>
        <start>1589800854.316437</start>
    </time_used>
    <status>OK</status>
</Data>

JSON格式

{
  "RequestId": "D0078DC6-8A1F-41A0-9A5F-A6B6443E9A65",
  "Data": {
    "zipcode": "311100",
    "time_used": {
      "rt": {
        "zipcode": "0.004756927490234375",
        "complete": "0.020321130752563477",
        "structure": "0.007731199264526367"
      },
      "start": "1589800854.316437"
    },
    "status": "OK"
  }
}

错误码

HttpCode

错误码

错误信息

描述

403

Forbidden.NoAuth

Failed to perform user authentication.

用户鉴权失败

500

InternalError

A service error occurred.

服务内部异常

400

InvalidParameter

The parameter is invalid.

参数无效

404

ResourceDoesNotExist

The resource does not exist.

资源不存在

429

Throttling.User

Flow control has been triggered.

触发流控

400

UserStatusInvalid

The user status is invalid.

用户状态无效

访问错误中心查看更多错误码。

  • 本页导读 (0)
文档反馈