获取本机公网IP地址:
curl ip.rss.ink
返回结果为您的公网IP,如:
119.29.29.29
获取本机公网IP + 归属地:
curl ip.rss.ink/text
返回一段IP + 归属地的文本内容,如:
1.14.27.xx,中国四川成都市 腾讯云
如果您需要返回json内容,也可以:
curl ip.rss.ink/json
将返回一段json数据:
{
"code": 200,
"msg": "cache",
"data": {
"ip": "1.14.27.xx",
"country": "中国",
"province": "四川",
"city": "成都市",
"county": "",
"area": "中国四川成都市 腾讯云",
"isp": ""
}
}
您可以通过拼接一个URL来请求IPRSS,从而获得IP查询结果。
拼接格式为https://ip.rss.ink/result/
+ ip
+ .html
,比如,您要查询的IP地址为114.114.114.114
,那么您可以拼接为:https://ip.rss.ink/result/114.114.114.114.html
https://ip.rss.ink/v1/qqwry
GET
ip
,若不填写此参数,则获取当前客户端IPhttps://ip.rss.ink/v1/qqwry?ip=114.114.114.114
请求成功响应内容:
{
"code": 200,
"msg": "cache",
"data": {
"ip": "114.114.114.114",
"country": "中国",
"province": "江苏",
"city": "南京市",
"county": "",
"area": "中国江苏南京市 南京信风网络科技有限公司GreatbitDNS服务器",
"isp": ""
}
}
请求失败响应内容:
{
"code": -1000,
"msg": "Incorrect IP format!",
"data": ""
}
https://ip.rss.ink/v1/ip2location
GET
ip
,若不填写此参数,则获取当前客户端IPhttps://ip.rss.ink/v1/ip2location?ip=114.114.114.114
请求成功响应内容:
{
"code": 200,
"msg": "cache",
"data": {
"ipAddress": "114.114.114.114",
"latitude": 27.1089,
"longitude": 116.213158,
"countryName": "China",
"timeZone": "+08:00",
"zipCode": "344411",
"cityName": "Xinfeng",
"regionName": "Jiangxi"
}
}
请求失败响应内容:
{
"code": -1000,
"msg": "Incorrect IP format!",
"data": ""
}
https://ip.rss.ink/v1/geoip2
GET
ip
,若不填写此参数,则获取当前客户端IPhttps://ip.rss.ink/v1/geoip2?ip=111.8.36.181
请求成功响应内容:
{
"code": 200,
"msg": "cache",
"data": {
"city": {
"geoname_id": 1815577,
"names": {
"de": "Changsha",
"en": "Changsha",
"es": "Changsha",
"fr": "Changsha",
"ja": "長沙市",
"pt-BR": "Changsha",
"ru": "Чанша",
"zh-CN": "长沙"
}
},
"continent": {
"code": "AS",
"geoname_id": 6255147,
"names": {
"de": "Asien",
"en": "Asia",
"es": "Asia",
"fr": "Asie",
"ja": "アジア",
"pt-BR": "Ásia",
"ru": "Азия",
"zh-CN": "亚洲"
}
},
"country": {
"geoname_id": 1814991,
"iso_code": "CN",
"names": {
"de": "China",
"en": "China",
"es": "China",
"fr": "Chine",
"ja": "中国",
"pt-BR": "China",
"ru": "Китай",
"zh-CN": "中国"
}
},
"location": {
"accuracy_radius": 500,
"latitude": 28.2014,
"longitude": 112.9611,
"time_zone": "Asia\/Shanghai"
},
"registered_country": {
"geoname_id": 1814991,
"iso_code": "CN",
"names": {
"de": "China",
"en": "China",
"es": "China",
"fr": "Chine",
"ja": "中国",
"pt-BR": "China",
"ru": "Китай",
"zh-CN": "中国"
}
},
"subdivisions": [
{
"geoname_id": 1806691,
"iso_code": "HN",
"names": {
"en": "Hunan",
"fr": "Province de Hunan",
"zh-CN": "湖南"
}
}
],
"traits": {
"ip_address": "111.8.36.181",
"prefix_len": 17
}
}
}
请求失败响应内容:
{
"code": -1000,
"msg": "Incorrect IP format!",
"data": ""
}