zhengbingdong/ip-addrs
无需注册, 完全免费IP归属地查询API,快速查询IP地址的地理位置、运营商等信息,不限量,随便用
MIT · 最后更新 2个月前
# 完全免费的IP解析工具
无需注册, 完全免费IP归属地查询API,快速查询IP地址的地理位置、运营商等信息,不限量,随便用
## 官网
<a href="https://ip.zhengbingdong.com" target="_blank">免费IP解析</a>
## 更多分享信息内容请关注我的公众号:程序猿的栖息地

## 安装
```shell
$ composer require zhengbingdong/ip-addrs
```
## 用法
```php
<?php
use Zhengbingdong\IpAddr\IpAddrClient;
/**
* IP解析工具类
* Class DateTools
*/
class Client{
/**
* [get 解析IP]
* @since 2025年10月23日
* @author Dai哥
* @param [type] $ip [IP地址]
* @return [type] [description]
*/
public function index()
{
$ip = '127.0.0.1';
$info = IpAddrClient:get($ip);
}
}
```
## 返回值
```json
{
"ret": 200, // 200为正常
"data": {
"ip": "58.30.0.0", // 查询的IP地址
"country": "中国", // 国家/地区
"country_code": "cn", // 国家/地区简码
"prov": "北京", // 省份
"city": "北京", // 城市
"city_code": "beijing", // 城市简码
"city_short_code": "bj", // 城市简码
"area": "东城", // 区县
"post_code": "100000", //邮政编码
"area_code": "010", // 电话区号
"isp": "中国移动", // 运营商
"lng": "116.41005", // 城市中心-经度
"lat": "39.93157", // 城市中心-纬度
"long_ip": 975044608, // longip
"big_area": "华北", // 国内大区划分
},
"qt": 0.001 // 查询时间-秒
}
扩展中心
立即提交欢迎提交你的ThinkPHP扩展
推荐扩展
-
topthink/think-ai
1年前
-
topthink/think-api
1年前
-
topthink/think-dumper
Dumper extend for thinkphp
11个月前 -
topthink/think-validate
think validate
1年前 -
yzh52521/think-mailer
A powerful and beautiful php mailer for All of ThinkPHP and Other PHP Frameworks based Symfony mailer
2年前