Posted on 10-06-2021 01:57 AM
Hi all,
How can i detect computer location from last reported Public IP Address ? I mean I want to see the city/state information from the last reported public IP address?
I tried compose a script with XML API for extension attribute but there are billions IP ranges. Thats why i want to ask is there any easy method ?
For example my IP address is 62.16x.xxx.xx - I want to see Tbilisi City
Can you please help ?
Posted on 10-06-2021 03:54 AM
If they are DHCP addresses given out by a local ISP, there is not good way that I know of to pin point their location. It would be cool if that could happen.
Posted on 10-06-2021 06:13 AM
@EmreU I don't think they have an API you can script, but https://www.whatismyip.com/ip-address-lookup/ will possibly provide the location detail for a given IP address
10-06-2021 09:32 AM - edited 10-06-2021 09:36 AM
You should probably think twice about doing this, and expect to budget something towards it if you proceed. Geolocating IPs is still a guessing game in many ways, and one that can have harmful outcomes. You will need to get a paid account with an API lookup service to do the resolution, since the free services allow only a handful of lookups and typically ban automated ones. Jamf has previously stated they will not support location tracking features beyond lost mode due to privacy concerns.
If doing this yourself on a one off basis in the browser would be adequate, I keep a bookmarklet on my favorites bar for such occasions:
javascript%3At=window.frames%5B0%5D.document.getElementById(%22FIELD_IP_ADDRESS_VALUE%22).innerText;window.open(('http://ip-api.com/%23'+t))