当前位置: 首页 > 工具软件 > PHP-ip查询 > 使用案例 >

淘宝,搜狐,ip-api 免费IP地址查询API接口

上官飞
2023-12-01
  1. 淘宝  
  • [get]请求接口

http://ip.taobao.com/service/getIpInfo.php?ip=118.182.201.41

  • 返回数据格式

{"code":0,"data":{"ip":"118.182.201.41","country":"中国","area":"","region":"甘肃","city":"白银","county":"XX","isp":"电信","country_id":"CN","area_id":"","region_id":"620000","city_id":"620400","county_id":"xx","isp_id":"100017"}}

【注意:这个有调用频率的限制】

2. 搜狐IP地址查询接口(默认GBK)

  • 请求接口

http://pv.sohu.com/cityjson

  • 返回数据格式
var returnCitySN = {"cip": "118.182.201.41", "cid": "620000", "cname": "����ʡ"};

3.搜狐IP地址查询接口(可设置编码)

  • 请求接口

http://pv.sohu.com/cityjson?ie=utf-8

  • 返回数据格式

var returnCitySN = {"cip": "118.182.201.41", "cid": "620000", "cname": "甘肃省"};

4. 国际化显示

  • 请求接口(英文显示)

http://ip-api.com/json/

  • 返回数据格式

{"as":"AS4134 No.31,Jin-rong Street","city":"Lanzhou","country":"China","countryCode":"CN","isp":"Chinanet","lat":36.0594,"lon":103.826,"org":"Chinanet GS","query":"118.182.201.41","region":"GS","regionName":"Gansu","status":"success","timezone":"Asia/Shanghai","zip":""}

  • 请求接口(中文显示)

http://ip-api.com/json/?lang=zh-CN

  • 返回数据格式
{"as":"AS4134 No.31,Jin-rong Street","city":"兰州","country":"中国","countryCode":"CN","isp":"Chinanet","lat":36.0594,"lon":103.826,"org":"Chinanet GS","query":"118.182.201.41","region":"GS","regionName":"甘肃","status":"success","timezone":"Asia/Shanghai","zip":""}
  • 请求接口(根据某个IP地址查询)

http://ip-api.com/json/118.182.201.41?lang=zh-CN

  • 返回数据格式
{"as":"AS4134 No.31,Jin-rong Street","city":"兰州","country":"中国","countryCode":"CN","isp":"Chinanet","lat":36.0594,"lon":103.826,"org":"Chinanet GS","query":"118.182.201.41","region":"GS","regionName":"甘肃","status":"success","timezone":"Asia/Shanghai","zip":""}

 

 类似资料: