跳到主要内容

地理位置

查询国家/城市字典,供库存、下单等接口使用 countryCodecityIdcityCode)。

鉴权: /open/staticip/** 须携带 UserIdToken(见 接口认证)。


1. 大洲列表

GET /open/staticip/location/continents

返回已启用的大洲,供国家列表筛选。

请求参数:

响应 data 数组元素:

字段类型说明
continentIdstring大洲 ID
nameZhstring中文名
nameEnstring英文名

2. 国家列表

POST /open/staticip/location/countries

Body(均可选):

字段类型说明
continentIdstring按大洲筛选
keywordstring匹配中/英文国名

响应 data 数组元素:

字段类型说明
countryIdstring国家 ID
continentIdstring大洲 ID
countryCodestringISO2 国家代码(下单/库存使用)
nameZh / nameEnstring中/英文名称
continentNamestring所属大洲名称

3. 州/省列表

POST /open/staticip/location/states

有州/省的国家(如 US)建议先选州省,再查城市。

Body(均可选):

字段类型说明
countryIdstring国家 ID,与 countryCode 二选一
countryCodestringISO2 国家代码
keywordstring匹配州省名称

响应 data 数组元素:

字段类型说明
stateIdstring州/省 ID
countryIdstring国家 ID
countryCodestring国家代码
nameZh / nameEnstring中/英文名称
countryNamestring所属国家名称

4. 城市列表

POST /open/staticip/location/cities

Body 均可选;Body 可省略或传 {} 表示查询全部已启用城市。

字段类型说明
stateIdstring州/省 ID
countryIdstring国家 ID,与 countryCode 二选一
countryCodestringISO2 国家代码
keywordstring单独使用时可全局模糊搜索

响应 data 数组元素:

字段类型说明
cityIdstring城市 ID;库存接口 cityCode 即此值的字符串
countryIdstring国家 ID
stateIdstring州/省 ID(无州省时为空)
countryCodestring国家代码
nameZh / nameEnstring中/英文名称
countryNamestring国家名称
stateName / stateNameEnstring州/省名称