Loading... > 开发过程中可能会用到的IP获取 1. 搜狐(默认GBK编码) `http://pv.sohu.com/cityjson?ie=utf-8` 返回结果如下: ```json var returnCitySN = {"cip": "220.249.113.155", "cid": "420100", "cname": "湖北省武汉市"}; ``` 2. 淘宝 `https://www.taobao.com/help/getip.php` 返回结果如下: ```json ipCallback({ip:"220.249.113.155"}) ``` 3. Ip-api `http://ip-api.com/json` 返回结果如下: ```json { status: "success", country: "China", countryCode: "CN", region: "HB", regionName: "Hubei", city: "Wuhan", zip: "", lat: 30.589, lon: 114.2681, timezone: "Asia/Shanghai", isp: "CNC Group CHINA169 Hubei Province Network", org: "Wuhan University", as: "AS4837 CHINA UNICOM China169 Backbone", query: "220.249.113.155" } ``` 添加参数返回不一样的值 `http://ip-api.com/json/?lang=zh-CN` ```json { status: "success", country: "中国", countryCode: "CN", region: "HB", regionName: "湖北省", city: "武汉", zip: "", lat: 30.589, lon: 114.2681, timezone: "Asia/Shanghai", isp: "CNC Group CHINA169 Hubei Province Network", org: "Wuhan University", as: "AS4837 CHINA UNICOM China169 Backbone", query: "220.249.113.155" } ``` 或者查询某个IP的信息 `http://ip-api.com/json/81.69.6.231?lang=zh-CN` ```json { status: "success", country: "荷兰", countryCode: "NL", region: "NH", regionName: "North Holland", city: "Amsterdam", zip: "1015", lat: 52.3798, lon: 4.88814, timezone: "Europe/Amsterdam", isp: "EuroNet Internet", org: "Wanadoo Nederland BV", as: "AS45090 Shenzhen Tencent Computer Systems Company Limited", query: "81.69.6.231" } ``` 最后修改:2022 年 03 月 24 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 0 如果觉得我的文章对你有用,请随意赞赏