DEV Community

GuGuData
GuGuData

Posted on

全国省市区街道区域信息 API 接口

全国省市区街道区域信息 API 接口

提供全国省市区街道区域信息。

gugudata_api_cover

1. 产品功能

  • 更新了最新的 12 位编码的行政区划编码格式;
  • 三种行政区划编码格式,与国家规范一致,最新建议调用 v3 版本;
  • 提供全国最新、最全的省市区镇街道区域信息;
  • 每周校对、清洗、更新数据,第一时间同步更新区域信息变动;
  • 可返回行政区划中心点地理坐标;
  • 最小级别可以详细到镇、街道以及居委会/村级别,为国内区域单元最小级别;
  • 全接口支持 HTTPS(TLS v1.0 / v1.1 / v1.2 / v1.3);
  • 全面兼容 Apple ATS;
  • 全国多节点 CDN 部署;
  • 接口极速响应,多台服务器构建 API 接口负载均衡。

2. API 文档

API 详情地址: https://www.gugudata.com/api/details/chinaregions

接口请求地址: https://api.gugudata.com/location/chinaregions

返回格式: application/json; charset=utf-8

请求方式: GET

请求协议: HTTPS

请求示例: https://api.gugudata.com/location/chinaregions?appkey=YOUR_APPKEY&regioncode=YOUR_VALUE&version=3

接口测试: https://api.gugudata.com/location/chinaregions/demo

3. 请求参数

参数名 参数类型 是否必须 默认值 备注
appkey string YOUR_APPKEY 付费后获取的 APPKEY
regioncode string YOUR_VALUE 需要查询的父级区域编码,传递 0 获取全国所有省级别数据;编码格式为 00000000,每两位分别对应省、市、区、镇/街道编码(注意:v2 版本会在国家 6 位行政区划标准代码后添加 00 两位编码以保持接口兼容,v3 版本为 12 位编码格式)
version int 3 当传递参数值为 2 时,调用 v2 版本的接口,regioncode 遵循国家行政区划代码标准,同时可返回新增区划中心点坐标。当传递参数值为 3 时,调用 v3 版本的接口(v1 版本主要为了兼容历史用户调用逻辑,新用户强烈建议调用 v3 接口)

4. 返回参数

参数名 参数类型 备注
DataStatus.StatusCode int 接口返回状态码
DataStatus.StatusDescription string 接口返回状态说明
DataStatus.ResponseDateTime string 接口数据返回时间
DataStatus.DataTotalCount int 此条件下的总数据量,一般用于分页计算
Data.RegionCode string 区域编码(在 v2 版本中,前六位为国家行政区划标准编码,镇/街道是没有国家标准编码的,对应的编码只是对应的序号。v3 版本中,为最新的 12 位国家行政区划标准编码。)
Data.RegionName string 区域名称(部分城市在“市”级别后没有“区”级别,会直接返回“镇/街道”信息,注意根据「区域级别」字段进行处理)
Data.RegionType string 区域级别,枚举值为:省/自治区/直辖市/特别行政区 \
Data.CenterLonLat string 新增区划中心点坐标,格式为 [经度,纬度],地理坐标系为 GCJ-02。需要转换坐标系请调用地理坐标系转换接口

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay