JS 新浪API获取IP归属地

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js

返回值数据格式:var remote_ip_info = {“ret”:1,”start”:”59.37.164.179″,”end”:”59.37.165.17″,”country”:”u4e2du56fd”,”province”:”u5e7fu4e1c”,”city”:”u6c5fu95e8″,”district”:””,”isp”:”u7535u4fe1″,”type”:””,”desc”:””};

http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=61.135.169.125

返回值数据格式:var remote_ip_info = {“ret”:1,”start”:”61.135.164.0″,”end”:”61.135.169.125″,”country”:”u4e2du56fd”,”province”:”u5317u4eac”,”city”:”u5317u4eac”,”district”:””,”isp”:”u8054u901a”,”type”:””,”desc”:””};

JSON格式:
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json

返回的为utf-8编码,直接输出就可以了

原文地址:https://www.cnblogs.com/ghelement/p/4515608.html