With a normal HTTP request, the only option you have is GeoIP, but that will not give you the country and operator no better.
Depending on the application and device you are using, there are various options for geolocation, for example, iPhone and Android browsers support JavaScript javascript HTML5, so you can put the code on the page to send you the location. However, they are all associated with some client-side code.
Another option involves a deal with networks, they can provide you with a phone number as an additional header in the request, and then you can request this number through the API from the operator to get the location of the phone with the network. However, for this function they take quite decent pennies, and accuracy can vary from about 100 m in an urban environment to 35 km in very rural areas.
Sam machin
source share