参数作用参考表格
参数名 | 说明 | 支持的输出方式 |
---|---|---|
code | 返回代码 200为成功 |
json,txt |
data | 返回的数据 | json |
ip | 被查询的ip | json,txt |
country | IP所在的国家 | json,txt |
region | IP所在的省份 | json,txt |
city | IP所在的市 | json,txt |
isp | 机房 | json,txt |
country_id | 国家id | json,txt |
region_id | 省份id | json,txt |
city_id | 市id | json,txt |
isp_id | 机房id | json,txt |
查询一下自己IP信息,就可以看到省份id,市区id是干嘛的(身份证)
使用
Json
查看当前(自己)IP信息:http://Api.sirblog.cn/small/chaip.php?format=json
查看指定IP信息:http://Api.sirblog.cn/small/chaip.php?format=json&ip=ip地址
返回值说明看上面表格
txt
例如查看自己ip所在的国家: http://Api.sirblog.cn/small/chaip.php?format=txt&i=data_country
例如查看指定ip所在的国家: http://Api.sirblog.cn/small/chaip.php?format=txt&ip=IP地址
&i=data_country
调用方式即为:链接地址&i=data_参数名
示例:http://Api.sirblog.cn/small/chaip.php?format=txt&i=data_参数名
说明
参数名区分大小写