稳定、快速、免费的 API 接口服务
返回对应IP的位置,精确到县。 #请求地址
接口地址: https://api.ahfi.cn/api/ip
返回格式: JSON
请求方式: GET
请求示例: https://api.ahfi.cn/api/ip?type=220.181.34.0
请求参数说明:
名称 | 必填 | 类型 | 说明 |
---|---|---|---|
type | 否 | String | 为空则返回本地IP |
返回参数说明:
名称 | 类型 | 说明 |
---|
返回示例:
{ "success": true, "ip": "220.181.34.0", "site": { "province": "北京", "city": "北京市", "adcode": "110000" }, "weather": { "weather": "多云", "temperature": "14" } }
错误码格式说明:
名称 | 类型 | 说明 |
---|
代码示例: