# Generated by ShowAPI OpenAPI generator
# source: market/1149
# generated-at: 2026-06-25T20:17:59.984Z
openapi: 3.0.3
info:
  title: 行政区划查询
  description: 根据输入关键词查询行政区划的相关信息，帮助用户快速查找特定的行政区域，包括行政区划的全称、经纬度、城市编码、区域编码等信息。支持全国省、市、区县、乡镇的分级查询，同时支持县级以上的邮政编码、区号、经纬度的查询
  termsOfService: https://www.showapi.com/helpcenter/view#/4019/2
  version: 1.0.0
servers:
  - url: https://route.showapi.com
paths:
  /1149-2:
    x-pointCode: 2
    x-mode: mapping
    x-read-timeout: 15
    x-connect-timeout: 15
    post:
      summary: 子区域查询
      description: 可查询子区域的网站名称、区域级别、区县编码、经纬度、简拼、邮编、区号、市政编码等数据。
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          ret_code:
                            type: string
                            description: 接口调用是否成功
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                provinceId:
                                  type: string
                                  description: 省级编码
                                simpleName:
                                  type: string
                                  description: 区域名简称
                                areaCode:
                                  type: string
                                  description: 区号
                                cityId:
                                  type: string
                                  description: 市级编码
                                remark:
                                  type: string
                                  description: 备注
                                pinYin:
                                  type: string
                                  description: 区域名称的全拼
                                prePinYin:
                                  type: string
                                  description: 拼音首字母
                                parentId:
                                  type: string
                                  description: 上级编码
                                level:
                                  type: string
                                  description: 区域级别 1 省级 2市级 3区县
                                areaName:
                                  type: string
                                  description: 区域名称
                                lat:
                                  type: string
                                  description: 纬度（废弃）
                                lon:
                                  type: string
                                  description: 经度（废弃）
                                simplePy:
                                  type: string
                                  description: 简拼
                                zipCode:
                                  type: string
                                  description: 邮编
                                countyId:
                                  type: string
                                  description: 区县编码
                                wholeName:
                                  type: string
                                  description: 全称
                                villageId:
                                  type: string
                                  description: 乡镇编码
                                location:
                                  type: string
                                  description: 坐标
                            description: 子区域列表
                          upgrade_info:
                            type: string
                            description: 使用及其更新要点
                          page:
                            type: string
                            description: 当前页
                          allNum:
                            type: string
                            description: 总条数
                          maxSize:
                            type: string
                            description: 每页数据
                          allPage:
                            type: string
                            description: 总页数
                        description: 业务返回体
      operationId: 1149_2_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                parentId:
                  type: string
                  description: 上级的ID,该ID可以在"区域查询"接入点中查找
                page:
                  type: string
                  description: 当前页数,分页时用 最大50页,每页最大20条
              required:
                - parentId
  /1149-1:
    x-pointCode: 1
    x-mode: mapping
    x-read-timeout: 15
    x-connect-timeout: 15
    post:
      summary: 区域查询
      description: 区域查询功能允许用户通过指定行政区划的级别，如省级、市级、县级、乡镇或村委会，来检索相应的区划信息。
      responses:
        "200":
          description: 成功响应
          content:
            application/json:
              schema:
                allOf:
                  - $ref: "#/components/schemas/ShowapiResEnvelope"
                  - type: object
                    properties:
                      showapi_res_body:
                        type: object
                        properties:
                          ret_code:
                            type: number
                            description: 接口调用是否成功
                          page:
                            type: number
                            description: 当前页
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                provinceId:
                                  type: string
                                  description: 省级编码
                                simpleName:
                                  type: string
                                  description: 区域名简称
                                lon:
                                  type: string
                                  description: 经度（废弃）
                                cityId:
                                  type: string
                                  description: 市级编码
                                areaCode:
                                  type: string
                                  description: 区号
                                prePinYin:
                                  type: string
                                  description: 拼音首字母
                                townId:
                                  type: string
                                  description: 乡镇id
                                id:
                                  type: string
                                  description: 区域id
                                pinYin:
                                  type: string
                                  description: 区域名称的全拼
                                parentId:
                                  type: string
                                  description: 上级编码
                                villageId:
                                  type: string
                                  description: 乡镇id
                                level:
                                  type: number
                                  description: 区域级别 1 省级 2市级 3区县 4乡镇 5村委
                                areaName:
                                  type: string
                                  description: 区域名称
                                simplePy:
                                  type: string
                                  description: 简拼
                                zipCode:
                                  type: string
                                  description: 邮编
                                lat:
                                  type: string
                                  description: 纬度（废弃）
                                countyId:
                                  type: string
                                  description: 区县编码
                                wholeName:
                                  type: string
                                  description: 全称
                                location:
                                  type: string
                                  description: 坐标
                          allNum:
                            type: number
                            description: 总数据条数
                          msg:
                            type: string
                            description: 提示信息
                          maxSize:
                            type: number
                            description: 每页返回最大的数据条数
                          allPage:
                            type: number
                            description: 最大分页值
                          upgrade_info:
                            type: string
                            description: 使用及其更新要点
                        description: 业务返回体
      operationId: 1149_1_POST
      parameters: []
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                level:
                  type: string
                  description: |
                    区域级别
                    1 省
                    2 市
                    3 区县
                    4 乡镇
                    5 村委会
                areaName:
                  type: string
                  description: |
                    区域名称，越完整，越准确
                page:
                  type: string
                  description: 当前页数,分页时用 最大50页,每页最大20条
              required:
                - areaName
components:
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: appKey
      description: 从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp
  schemas:
    ShowapiResEnvelope:
      type: object
      description: ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）
      properties:
        showapi_res_code:
          type: integer
          description: API 返回的状态码
        showapi_res_error:
          type: string
          description: API 返回的错误信息
        showapi_res_id:
          type: string
          description: API 请求的唯一标识
        showapi_fee_num:
          type: integer
          description: API 调用计费次数
security:
  - AppKeyAuth: []
externalDocs:
  url: https://www.showapi.com/apiGateway/view/1149?tab=book
x-apiCode: "1149"
x-is-own: false
x-is-op: true
