IP地址归属地查询
应用参数 | 类型 | 是否必填 | 默认值 | 示例值 | 说明 |
ip | string | true | 202.96.128.166 | ip地址/域名 | |
en_name | string | true | 必须为ip.get |
系统参数 | 类型 | 是否必填 | 说明 |
ak | string | true | 开发者密钥 |
{ "success": "1", "result": { "status": "OK", "ip": "202.96.128.166", "ip_str": "202.96.128.1", "ip_end": "202.96.128.254", "inet_ip": "3395322022", "inet_str": "3395321857", "inet_end": "3395322110", "areano": "020", "postno": "510000", "operators": "电信", "att": "中国,广东,广州", "detailed": "中国广东广州电信", "area_style_simcall": "中国,广东,广州", "area_style_areanm": "中华人民共和国,广东省,广州市" } }
<?php $ch = curl_init(); $url = 'http://api.liangmlk.cn?ak=xxxx&en_name=ip.get&ip=xxxx'; curl_setopt($ch,CURLOPT_URL,$url); $res = curl_exec($ch); curl_close($ch); return $res; ?>
import requests url = 'http://api.liangmlk.cn?ak=xxxx&en_name=ip.get&ip=xxxx' print( requests.get(url).json() )
curl http://api.liangmlk.cn?ak=xxxx&en_name=ip.get&ip=xxxx