接口信息
接口状态: 正常
总调用: 20,562
请求方法: GET
需要登录
请求地址:
https://wsapi.top/API/ip.php
示例地址:
https://wsapi.top/API/ip.php?ip=123.123.123.123&style=json&limit=10
请求参数
参数名类型必填说明
apikeystring调用API的密钥,注册账户免费获取
ipstring查询的IP,多个ip用|分隔
stylestring返回格式,可选:json、cn、text
limitinteger多个IP查询数量上限,可自定义,分隔符|,最多30个/次
在线测试
此处将显示接口返回结果...
返回示例:
{
    "ip块起始ip": "223.247.32.216",
    "ip块结束ip": "223.247.32.217",
    "ip块起始ip整形": "3757514968",
    "ip块结束ip整形": "3757514969",
    "所属的七大洲": "亚洲",
    "国家": "中国",
    "省份": "安徽",
    "城市": "池州",
    "区县": "青阳",
    "互联网供应商": "电信",
    "经度": "117.84744",
    "纬度": "30.63932",
    "行政区码": "341723",
    "电话和区号": "0566",
    "邮编": "242800",
    "时区": "Asia\/Shanghai",
    "货币": "CNY",
    "海拔": "12",
    "气象站": "无数据",
    "国家简称": "CN",
    "错误信息": "无数据",
    "IP版本": "v4"
}
调用示例
<?php
$url = 'https://wsapi.top/API/ip.php';
$params = ['apikey' => 'YOUR_VALUE', 'ip' => 'YOUR_VALUE', 'style' => 'YOUR_VALUE', 'limit' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = "https://wsapi.top/API/ip.php"
params = {
    'apikey': 'YOUR_VALUE',
    'ip': 'YOUR_VALUE',
    'style': 'YOUR_VALUE',
    'limit': 'YOUR_VALUE',}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://wsapi.top/API/ip.php');
const params = {
    'apikey': 'YOUR_VALUE',
    'ip': 'YOUR_VALUE',
    'style': 'YOUR_VALUE',
    'limit': 'YOUR_VALUE',};
Object.keys(params).forEach(k => url.searchParams.append(k, params[k]));
fetch(url).then(r => r.text()).then(d => console.log(d));
API列表