通过GeoIP获取ip所属地 (国家,城市,时区,邮编,经纬度等)
2012-08-08 15:59
591 查看
或者 使用某网站的API
API 1.
1. 返回文字
Html代码
http://api.hostip.info/get_html.php?ip=12.215.42.19&position=true
2. 返回图片
Html代码
<IMG SRC="http://api.hostip.info/flag.php?ip=12.215.42.19" ALT="IP Address Lookup">
API 2. (需要申请api key ,免费的,类似google)
城市:
Html代码
http://api.ipinfodb.com/v3/ip-city/?key=<your_api_key>&ip=74.125.45.100
国家(更快) :
Html代码
http://api.ipinfodb.com/v3/ip-country/?key=<your_api_key>&ip=74.125.45.100
Parameter Required Default Value
Please use the appropriate API for your needs. You can help us keep the load low on our servers by making sure that :
If you only need the country name, avoid using the city precision API.
If you track your visitors, avoid querying our API for all your page views (you can store the geolocation in a cookie, see below for an example)
API Precision Timezone Domains lookups
Please use the appropriate API for your needs. You can help us keep the load low on our servers by making sure that :
If you only need the country name, avoid using the city precision API.
If you track your visitors, avoid querying our API for all your page views (you can store the geolocation in a cookie, see below for an example)
key: c9dcc88453e33a9e63ebad8d65f91583e87abd8185dd95f09fbeef6c62264f7d
其他参考
http://pecl.php.net/package/geoip http://www.geoiptool.com/ http://www.hostip.info/use.html http://phpweby.com/software/ip2country http://www.ipinfodb.com/index.php
API 1.
1. 返回文字
Html代码
http://api.hostip.info/get_html.php?ip=12.215.42.19&position=true
2. 返回图片
Html代码
<IMG SRC="http://api.hostip.info/flag.php?ip=12.215.42.19" ALT="IP Address Lookup">
API 2. (需要申请api key ,免费的,类似google)
城市:
Html代码
http://api.ipinfodb.com/v3/ip-city/?key=<your_api_key>&ip=74.125.45.100
国家(更快) :
Html代码
http://api.ipinfodb.com/v3/ip-country/?key=<your_api_key>&ip=74.125.45.100
Parameter Required Default Value
key | Yes | <empty> | API key provided with your free account. |
ip | No | Client IP | IP address |
format | No | raw | raw, xml, json |
callback | No | <empty> | Required when using json callback. |
If you only need the country name, avoid using the city precision API.
If you track your visitors, avoid querying our API for all your page views (you can store the geolocation in a cookie, see below for an example)
API Precision Timezone Domains lookups
ip-city | City | Yes | Yes |
ip-country | Country | No | Yes |
If you only need the country name, avoid using the city precision API.
If you track your visitors, avoid querying our API for all your page views (you can store the geolocation in a cookie, see below for an example)
key: c9dcc88453e33a9e63ebad8d65f91583e87abd8185dd95f09fbeef6c62264f7d
其他参考
http://pecl.php.net/package/geoip http://www.geoiptool.com/ http://www.hostip.info/use.html http://phpweby.com/software/ip2country http://www.ipinfodb.com/index.php
相关文章推荐
- 通过GeoIP获取ip所属地 (国家,城市,时区,邮编,经纬度等)
- 通过GeoIP获取ip所属地 (国家,城市,时区,邮编,经纬度等)
- Laravel根据Ip获取国家,城市信息
- 天气获取通过经纬度或城市信息
- 通过获取用户ip地址定位到用户的城市并显示
- ios项目开发(天气预报项目):通过经纬度获取当前城市名称
- php 通过ip获取所在城市地址信息 获取计算机外网ip
- geoip+php演示样例:通过ip,获取国家名称和代码
- php通过经纬度获取城市
- geoip_api_php 通过ip找到国家的库包
- 通过google map api接口实现通过城市地点获取经纬度
- 百度地图---通过ip定位获取当前城市
- 通过IP地址获取IP所在城市和所使用运营商
- 通过前端获取客户端ip和所在城市,并在后端获得这些值
- 获取指定(访客)IP的所有信息,地址、邮政编码、国家、经纬度等的API
- geoip+php示例:通过ip,获取国家名称和代码
- Laravel根据Ip获取国家,城市信息
- android 获取经纬度城市名(通过baidumapapi 以及 json解析)
- 通过邮编获取城市