Google IP地理位置API [英] Google IP Geolocation API

查看:451
本文介绍了Google IP地理位置API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用任何Google API实时获取我的用户的IP地理位置?

Is there any way to use any of the Google APIs to get the IP Geolocation of my User in Live time?

我认为它将使用Google Analytics(分析)数据库,这是唯一一个可以真正在城市级别跟踪我的用户的数据库(我可以测试的任何其他IP-Location-API都可以显示距我近200公里的IP地址真实位置.Google会将其显示在200m(!)之外!)

I think it will use the Analytics Database and that is the only one, that tracks my user at city level that actually is correct (Any other IP-Location-API that I could test shows my IP address nearly 200km away from my real location. Google shows it 200m(!) away!)

我想知道我的用户的位置(在浏览器端并将其传输到我的服务器或在服务器端)以提供与城市有关的内容.但是我不想让我的用户成为这些烦人的弹出窗口之一,要求使用GPS,所以我想使用IP地址.

I want to know the Location of my User (At Browser side and transmit it to my Server or at Server side) to serve City dependent content. But I don't want to get my users one of these annoying pop ups asking for using GPS, so I want to use the IP address.

有什么建议吗?

推荐答案

如果您不想使用 HTML5样式客户端启用的GeoIP信息,您将需要一个GeoIP数据库,例如 MaxMind的GeoIP Lite数据库,它是免费的,并且在99%的用例中都很好用.任何其他具有更准确/详细信息的服务都会使您花费大量金钱. MaxMind受到很多人的好评,并且可以很好地满足我的需求.它可以为您提供国家/地区/城市/纬度-经度-坐标/大陆信息.

If you don't want to use HTML5 style client-enabled GeoIP information, you are going to need a GeoIP database like MaxMind's GeoIP Lite database, which is free and works well for 99% of use cases. Any other service with more accurate/detailed information is going to cost you a lot of money. MaxMind is praises by many people and works well for my needs, personally. It can give you Country/Region/City/Latitude-Longitude-Coordinates/Continent information.

这篇关于Google IP地理位置API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆