Reputation: 1508
How can I access some of the Geo encoding for a website I am making?
I would like to extract the location information of where the site is being viewed/used at. This would allow the check-in process to go more smoothly when the users do.
Any suggestions for VB.NET in Visual Studio 2008?
Thanks
Upvotes: 4
Views: 173
Reputation: 32614
Free geo ip is a free web service that will give you all the information you need.
http://freegeoip.net/static/index.html
You make a call to the service
http://freegeoip.net/{format}/{ip_or_hostname}
And the service returns in a JSON format:
show({"city": "Mountain View", "region_code": "CA", "region_name": "California", "metrocode": "807", "zipcode": "94043", "longitude": "-122.057", "country_name": "United States", "country_code": "US", "ip": "209.85.145.147", "latitude": "37.4192"});
Since it is free you can only process 1000 requests per hour.
Upvotes: 1
Reputation: 284
If you want to do it under your own control the process is often referred to as geo-ip. There are several ways to get this data and I don't have enough personal experience with one to suggest a particular vendor.
https://www.google.com/search?q=geo-ip
if you want to get really low level you look up the client ip whois record and see who owns the ip and their contact address. That seems to be what most of those mentioned in the google search are doing anyway.
I have used some of the free lookup databases from behind asp.net but I usually did all the heavy lifting in sql sprocs and just dumped the result to the front end as I had more sql horsepower at the time than webserver.
Upvotes: 1
Reputation: 163438
I would suggest simply using Google Analytics. It's free and quite robust.
They geocode all requests to your site, so you can see it on a map and what not.
Upvotes: 1