Geolocate an IP address to a location using latency
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Geolocate an IP address to a location using latency

This tool is for all of you with a bunch of Globalping credits laying around

The recent ipinfo blog post inspired me to make a little tool that uses Globalping's probe network to run latency tests against any IP address and resolve it to a location.

It worked out pretty well so I wanted to share it with you https://github.com/jimaek/geolocation-tool

I also wrote an accompanying blog post if you have a few minutes to kill https://blog.globalping.io/we-have-ipinfo-at-home-or-how-to-geolocate-ips-in-your-cli-using-latency/

The tool itself is very simple, just install and run.

Important to note: There is no need to report accuracy issues, by default a limit of 50 probes per phase is set. This is enough for unauthenticated users to run the tool once, but not enough to provide accurate results. I recommend setting a limit of 250 probes for good accuracy.

geolocate 45.95.160.61 
Geolocating 45.95.160.61...

Note: A limit of 50 offers worse results. For better accuracy it is
recommended to set a limit of at least 100 probes. The higher the limit
the higher the accuracy. Best results start at 250.

Phase 1: Detecting continent...
  Measuring from 30 probes...

  [███████████████████████████████████████░]  96.7%   29/30 - Best: NA (45.47 ms)                   

  Africa: 254.18 ms
  Asia: 219.64 ms
  Europe: 115.57 ms
  North America: 45.47 ms
  Oceania: 214.11 ms
  South America: 118.31 ms

Best continent: North America (45.47 ms)

Phase 2: Detecting country...
  Measuring from 50 probes...

  [████████████████████████████████████████] 100.0%   50/50 - Best: US (0.48 ms)                    

  United States: 0.48ms
  Mexico: 25.09ms
  Canada: 42.88ms

Best country: United States (0.48ms)

Phase 3: Detecting US state...
  Measuring from 50 probes...

  [████████████████████████████████████████] 100.0%   50/50 - Best: FL (0.01 ms)                    

  Florida: 0.01ms
  Oklahoma: 0.33ms
  South Carolina: 12.46ms

Best state: Florida (0.01ms)

Phase 4: Detecting city...
  Measuring from 34 probes...

  [████████████████████████████████████████] 100.0%   34/34 - Best: Miami (0.00 ms)                 

Top 3 Locations:
─────────────────────────────────────────────────
  1. Miami, Florida, USA                      0.00 ms
  2. West Palm Beach, Florida, USA            4.57 ms
  3. Port Saint Lucie, Florida, USA           4.99 ms

═══════════════════════════════════════════════════
                      SUMMARY
═══════════════════════════════════════════════════
  Location: Miami, Florida, USA
  Minimum Latency: 0.00 ms
  Confidence: Very High
═══════════════════════════════════════════════════

And yes, this tool will eat through your credits like crazy :)

Pull requests are welcome https://github.com/jimaek/geolocation-tool

Comments

Sign In or Register to comment.