Mobile app version of vmapp.org
Login or Join
Sherry384

: How do websites such as Groupon or Zillow detect user location? I have noticed that Groupon.com or Zillow.com knows what city I am located in quite reliably and without asking permission. Does

@Sherry384

Posted in: #Geolocation

I have noticed that Groupon.com or Zillow.com knows what city I am located in quite reliably and without asking permission.

Does anyone know what they or similar big players do to get your location? Are they using private ip-based databases or something else?

I need to know what city a user is in, are there any online services that I can use to get a user's location for free?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

1 Comments

Sorted by latest first Latest Oldest Best

 

@RJPawlick198

They are most likely using geolocation by IP address or hostname.

There are many services that provide data for this. One that I know of that's easy to use is freegeoip.net. They have an API that you can call 10,000 times per hour to get geolocation data.

For example, if you make an HTTP GET request to freegeoip.net/json/stackoverlow.com, you can get data back in multiple formats. This example returns JSON:

{
"ip": "69.172.201.208",
"country_code": "US",
"country_name": "United States",
"region_code": "NY",
"region_name": "New York",
"city": "New York",
"zip_code": "10004",
"time_zone": "America/New_York",
"latitude": 40.689,
"longitude": -74.021,
"metro_code": 501
}

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme