查询地址区域

查询标准地址区域代码信息, 基于国家统计局的行政区域代码。

1.请求参数

请求URL:

POST https://kf.fw199.com/gateway/taobao/logistices/areas/get

参数名 类型 说明 示例
appid String 合作伙伴AppId uwkahf@jfs92
timestamp String 当前时间戳
tb_seller_nick String 淘宝卖家店铺登录账号,非店铺名称 kingdo
sign String true 999de41d862efaa6f1084ead3b3ba480

2. 请求示例代码(Java)

      @Test
    public void  TaoBaoGetAreas() throws Exception {

        String tb_seller_nick = Config.TBSellerNick ;
        Map<String, String> data = new HashMap<String, String>();
        data.put("appid",  Config.AppId);
        Long timestamp = System.currentTimeMillis() / 1000;
        data.put("timestamp", timestamp.toString());
        data.put("tb_seller_nick", tb_seller_nick);
        data.put("sign", Utils.Sign(data,Config.AppSecret));
        doHttpRequest(Config.TaoBaoGetAreasUrl ,data);

    }

3. 返回结果如下:

由于本接口返回全量数据,为方便篇幅,数据做了删减。以接口实际返回数据准。

{
  "code": 0,
  "message": "ok",
  "data": [
    {
      "id": 1,
      "type": 1,
      "name": "中国",
      "parent_id": 0,
      "zip": ""
    },

    {
      "id": 659002,
      "type": 4,
      "name": "阿拉尔市",
      "parent_id": 650000,
      "zip": "843300"
    },
    {
      "id": 659003,
      "type": 4,
      "name": "图木舒克市",
      "parent_id": 650000,
      "zip": "843806"
    },
    {
      "id": 659000,
      "type": 3,
      "name": "可克达拉市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659001,
      "type": 4,
      "name": "石河子市",
      "parent_id": 650000,
      "zip": "832000"
    },
    {
      "id": 659006,
      "type": 4,
      "name": "铁门关市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659007,
      "type": 4,
      "name": "双河市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659004,
      "type": 4,
      "name": "五家渠市",
      "parent_id": 650000,
      "zip": "831300"
    },
    {
      "id": 659005,
      "type": 4,
      "name": "北屯市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659010,
      "type": 4,
      "name": "胡杨河市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659011,
      "type": 4,
      "name": "新星市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659008,
      "type": 4,
      "name": "可克达拉市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 659009,
      "type": 4,
      "name": "昆玉市",
      "parent_id": 650000,
      "zip": ""
    },
    {
      "id": 530000,
      "type": 2,
      "name": "云南省",
      "parent_id": 1,
      "zip": ""
    },
    {
      "id": 530111,
      "type": 4,
      "name": "官渡区",
      "parent_id": 530100,
      "zip": "650220"
    },
    {
      "id": 530100,
      "type": 3,
      "name": "昆明市",
      "parent_id": 530000,
      "zip": "650000"
    },
    {
      "id": 530102,
      "type": 4,
      "name": "五华区",
      "parent_id": 530100,
      "zip": "650032"
    },
    {
      "id": 530103,
      "type": 4,
      "name": "盘龙区",
      "parent_id": 530100,
      "zip": "650051"
    },
    {
      "id": 530121,
      "type": 4,
      "name": "呈贡区",
      "parent_id": 530100,
      "zip": "650500"
    },
    {
      "id": 530122,
      "type": 4,
      "name": "晋宁区",
      "parent_id": 530100,
      "zip": "650600"
    },
    {
      "id": 530124,
      "type": 4,
      "name": "富民县",
      "parent_id": 530100,
      "zip": "650400"
    },
    {
      "id": 530125,
      "type": 4,
      "name": "宜良县",
      "parent_id": 530100,
      "zip": "652100"
    },
    {
      "id": 530126,
      "type": 4,
      "name": "石林彝族自治县",
      "parent_id": 530100,
      "zip": "652200"
    },
    {
      "id": 530127,
      "type": 4,
      "name": "嵩明县",
      "parent_id": 530100,
      "zip": "651700"
    },
    {
      "id": 530112,
      "type": 4,
      "name": "西山区",
      "parent_id": 530100,
      "zip": "650100"
    },
    {
      "id": 530113,
      "type": 4,
      "name": "东川区",
      "parent_id": 530100,
      "zip": "654100"
    },
    {
      "id": 530128,
      "type": 4,
      "name": "禄劝彝族苗族自治县",
      "parent_id": 530100,
      "zip": "651500"
    },
    {
      "id": 530129,
      "type": 4,
      "name": "寻甸回族彝族自治县",
      "parent_id": 530100,
      "zip": "655200"
    },
    {
      "id": 530181,
      "type": 4,
      "name": "安宁市",
      "parent_id": 530100,
      "zip": "650300"
    },
    {
      "id": 530182,
      "type": 4,
      "name": "其它区",
      "parent_id": 530100,
      "zip": ""
    },
    {
      "id": 530300,
      "type": 3,
      "name": "曲靖市",
      "parent_id": 530000,
      "zip": "655000"
    },
    {
      "id": 530302,
      "type": 4,
      "name": "麒麟区",
      "parent_id": 530300,
      "zip": "655000"
    }
  ]
}

说明: code为0表示成功,非0为失败,tid为本次发货的订单号, message会包含失败原因。

4. 返回参数说明

参数名称 类型 示例值 描述
data data[] 地址区域信息列表。
id Number 255 标准行政区域代码。
type Number 1 区域类型。
area: 区域
1: country/国家;
2: province/省/自治区/直辖市;
3: city/地区(省下面的地级市);
4: district/县/市(县级市)/区;
abroad: 海外。比如北京市的 area_type = 2, 朝阳区是北京市的一个区, 所以朝阳区的 area_type = 4。
name String 北京市 地域名称。如北京市、杭州市、西湖区,每一个 area_id 都代表了一个具体的地区。
parent_id Number 141141 父节点区域标识。如北京市的 area_id 是 110100,朝阳区是北京市的一个区,所以朝阳区的 parent_id 就是北京市的 area_id。
zip String 421403
文档更新时间: 2024-12-17 12:19   作者:admin