http://api.naiscat.cn/api/get.ipacquisition
http://api.naiscat.cn/api/get.ipacquisition?info=detailed
| 名称 | 必填 | 类型 | 说明 |
|---|---|---|---|
| token | 是 | string | 登录获取token |
| info | 否 | string | 等于detailed时展示详细ip内容 |
| geo | 否 | string | 等于1时展示地理位置 |
| threat | 否 | string | 等于1时展示威胁信息 |
| 名称 | 类型 | 说明 |
|---|---|---|
| code | integer | 返回的状态码 |
| data | object | 返回的数据/数据对象 |
| msg | string | 返回的消息 |
| time | string | 请求时间 |
| data.success | boolean | success |
| data.timestamp | string | timestamp |
| data.version | string | version |
| data.author | string | author |
| data.data.ip | string | ip |
| data.data.ip_version | string | ip_version |
| data.data.is_private | boolean | is_private |
| data.data.is_valid | boolean | is_valid |
| data.data.timestamp | string | timestamp |
| data.geo_info.country | string | country |
| data.geo_info.country_code | string | country_code |
| data.geo_info.region | string | region |
| data.geo_info.city | string | city |
| data.geo_info.isp | string | isp |
| data.geo_info.lat | number | lat |
| data.geo_info.lon | number | lon |
| data.geo_info.timezone | string | timezone |
| data.geo_info.data_source | string | data_source |
| data.threat_info.ip | string | ip |
| data.threat_info.is_malicious | boolean | is_malicious |
| data.threat_info.threat_level | string | threat_level |
| data.threat_info.abuse_score | number | abuse_score |
| data.threat_info.blacklists[] | array | 空数组 |
| data.server_info.remote_addr | string | remote_addr |
| data.server_info.http_headers.x_forwarded_for | string | x_forwarded_for |
| data.server_info.http_headers.x_real_ip | string | x_real_ip |
| data.server_info.http_headers.client_ip | string | client_ip |
| data.usage.Basic IP Query | string | Basic IP Query |
| data.usage.Detailed IP Info | string | Detailed IP Info |
| data.usage.Geolocation Info | string | Geolocation Info |
| data.usage.Threat Info | string | Threat Info |
{
"code": 200,
"msg": "操作成功!",
"time": "2025-12-03 16:46:45",
"api_source": "API官网:api.naiscat.cn",
"server_recommendation": "智乐云:www.vpszl.cn",
"data": {
"success": true,
"timestamp": "2025-12-03T16:46:45.509561",
"version": "2.0",
"author": "奈斯猫",
"data": {
"ip": "119.54.125.192",
"ip_version": "IPv4",
"is_private": false,
"is_valid": true,
"timestamp": "2025-12-03T16:46:45.509718"
},
"geo_info": {
"country": "China",
"country_code": "CN",
"region": "Jilin",
"city": "Jilin",
"isp": "CNC Group CHINA169 Jilin Province Network",
"lat": 43.8378,
"lon": 126.549,
"timezone": "Asia/Shanghai",
"data_source": "ipapi"
},
"threat_info": {
"ip": "119.54.125.192",
"is_malicious": false,
"threat_level": "medium",
"abuse_score": 30,
"blacklists": []
},
"server_info": {
"remote_addr": "198.44.179.17",
"http_headers": {
"x_forwarded_for": "119.54.125.192, 198.44.179.17",
"x_real_ip": "198.44.179.17",
"client_ip": "None"
}
},
"usage": {
"Basic IP Query": "/ipacquisition",
"Detailed IP Info": "/ipacquisition?info=detailed",
"Geolocation Info": "/ipacquisition?geo=1",
"Threat Info": "/ipacquisition?threat=1"
}
},
"cached_time": "2025-12-03 16:46:45"
}
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 | string | 返回状态码(成功) |
| 500 | string | 返回的状态码(失败) |
<?php
// 初始化cURL会话
$ch = curl_init();
// 设置请求URL,用户中心获取token,自行替换其他参数
curl_setopt($ch, CURLOPT_URL, "http://api.naiscat.cn/api/get.ipacquisition?info=detailed");
// 设置请求头
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: YOUR_TOKEN'
));
// 返回响应而不是直接输出
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// 执行请求并获取响应
$response = curl_exec($ch);
// 关闭cURL会话
curl_close($ch);
// 将响应解析为JSON格式
$data = json_decode($response, true);
// 输出JSON数据
print_r($data);
?>
import requests
# 设置请求URL和头部,用户中心获取token,自行替换其他参数
url = "http://api.naiscat.cn/api/get.ipacquisition?info=detailed"
headers = {
'Authorization': 'YOUR_TOKEN'
}
# 发送GET请求
response = requests.get(url, headers=headers)
# 将响应解析为JSON格式
data = response.json()
# 输出JSON数据
print(data)
// 发送GET请求,用户中心获取token,自行替换其他参数
fetch("http://api.naiscat.cn/api/get.ipacquisition?info=detailed", {
method: "GET",
headers: {
"Authorization": "YOUR_TOKEN"
}
})
.then(response => response.json()) // 将响应解析为JSON格式
.then(data => console.log(data)) // 输出JSON数据
.catch(error => console.error('Error:', error));
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) throws Exception {
// 创建URL对象,用户中心获取token,自行替换其他参数
URL url = new URL("http://api.naiscat.cn/api/get.ipacquisition?info=detailed");
// 打开连接
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// 设置请求方法
conn.setRequestMethod("GET");
// 设置请求头
conn.setRequestProperty("Authorization", "YOUR_TOKEN");
// 读取响应
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String inputLine;
StringBuffer content = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
content.append(inputLine);
}
in.close();
// 输出JSON数据
System.out.println(content.toString());
}
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main() {
using (HttpClient client = new HttpClient()) {
// 设置请求头
client.DefaultRequestHeaders.Add("Authorization", "YOUR_TOKEN");
// 发送GET请求,用户中心获取token,自行替换其他参数
HttpResponseMessage response = await client.GetAsync("http://api.naiscat.cn/api/get.ipacquisition?info=detailed");
// 将响应解析为字符串
string responseBody = await response.Content.ReadAsStringAsync();
// 输出JSON数据
Console.WriteLine(responseBody);
}
}
}
require 'net/http'
require 'uri'
# 创建URI对象,用户中心获取token,自行替换其他参数
uri = URI.parse("http://api.naiscat.cn/api/get.ipacquisition?info=detailed")
# 创建GET请求
request = Net::HTTP::Get.new(uri)
# 设置请求头
request["Authorization"] = "YOUR_TOKEN"
# 发送请求并获取响应
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
# 输出JSON数据
puts response.body
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
// 创建GET请求,用户中心获取token,自行替换其他参数
req, err := http.NewRequest("GET", "http://api.naiscat.cn/api/get.ipacquisition?info=detailed", nil)
if err != nil {
panic(err)
}
// 设置请求头
req.Header.Add("Authorization", "YOUR_TOKEN")
// 发送请求并获取响应
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
// 读取响应体
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
// 输出JSON数据
fmt.Println(string(body))
}