对IP地址进行地址解析? [英] Geocode an IP address?
问题描述
有人知道我可以用来将用户的IP地理编码为纬度和经度的任何开放式RESTful API吗?
Does anyone know of any open RESTful API that I can call to geocode a user's IP to the latitude and longitude?
理想情况下,它类似于: http://google.com/geocode_api/? IP = 1.2.3.4 ,它将返回纬度和经度.
Ideally, it would be something like: http://google.com/geocode_api/?IP=1.2.3.4 and it would return the latitude and longtitude.
推荐答案
另一个具有城市准确信息的免费REST API是 http://freegeoip.net 请求非常简单.您将使用类似的
Another free REST API with city accurate information would be http://freegeoip.net Requests are fairly straight forward. You would use something like
http://freegeoip.net/{format}/{ip_or_hostname}
对IP地址进行地址解析,其格式可以为csv
,xml
或json
.他们的网站上有所有详细信息.
to geocode an IP address, where format can be csv
, xml
or json
. Their website has all the details.
[更新:] 过去,FreeGeoIP.net不能作为公共服务连续使用.但是,该软件始终是开源的,可在 Github 上获得.如果您需要高度可靠的服务或者用例超过了当前每小时15.000请求的配额,那么使用Docker运行本地安装是相当容易的.
[UPDATE:] FreeGeoIP.net was not continuously available in the past as a public service. The software was, however, always open source and is available on Github. It's fairly easy to get your local installation running using Docker, if you need a highly reliable service or your use case exceeds the current quota of 15.000 requests/hour.
这篇关于对IP地址进行地址解析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!