Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the location of a web request?

Tags:

geolocation

What's the best way to get the location (to a country level) of where a web request is coming from?

like image 853
DaveDev Avatar asked Oct 21 '25 17:10

DaveDev


1 Answers

There are 3 ways, generally speaking:

  • Use GeoIP or some similar database or service which maps IPs to physical locations
  • Use the W3C geolocation api (supported by newer browsers only)
  • Google gears geolocation
like image 85
Vlad H Avatar answered Oct 25 '25 12:10

Vlad H