3

How can you calculate the geographic distance (e.g. 500 miles) between 2 IP addresses?

Is there some API that lets you look this up?

8
  • What do you mean by 'distance'?
    – Carl Norum
    Apr 30, 2013 at 4:38
  • Do you mean geographic distance or a some definition of 127.0.0.1 - 8.8.8.8 = ??
    – m0nhawk
    Apr 30, 2013 at 4:38
  • 2
    IP addresses don't really correspond to physical locations, so your mapping will be necessarily coarse and inaccurate. Is that ok?
    – Carl Norum
    Apr 30, 2013 at 4:39
  • 1
    There is a service to determine an address' geocoordinates. Don't expect much higher accuracy than to a nearest city. Apr 30, 2013 at 4:40
  • 1
    Here's a service I found by a simple google search: ip2location.com I'm sure there are many others.
    – Carl Norum
    Apr 30, 2013 at 4:41

1 Answer 1

-1

This might be the closest you're gonna get: Who provides a WHOIS API? as @carl norum said not all IP addresses resolve to a physical location due to ISP and DNS server locations and other fun routing magic. But if you do get the client's ISP it's up to that ISP to release the physical address of their client.

Not the answer you're looking for? Browse other questions tagged or ask your own question.