Is it possible to get user's location information through their ip?


Is there any possibility using programming to get locations from a supposed visitor to your website?

Example: "So and so" with ip: visited my site:

Through this ip obtained can I accurately determine geographic information of such user? The locality details I am referring to are the country , the state , the city and if possible the neighborhood .

I want to know if through programming (regardless of language) I can obtain such data from a visitor to my site.


function getLocation(){
  if (navigator.geolocation)
    alert("O seu navegador não suporta Geolocalização.");

function showPosition(position){
   alert("Latitude: " + position.coords.latitude + " Longitude: " + position.coords.longitude);  
Scroll to Top