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
That is pretty cool. I m lov.
Wow, this looks great.
Thank you for sharing!
Any bulk option for a few million?
I mean its a question of having enough credits and time
The how is pretty easy
I feel this problem can be solved with a fewer number of probes via determining the intersection of circles instead of in this hierarchical way, but I have not thought about this problem enough. Neat tool!
Oh yeah for sure. I'm just not smart enough to do the maths so I brute forced it
finally i can use these

No provider is safe now, fake locations will be found and shamed
Now run this to geolocate all your IPs (with 250 servers per request as CLI suggest) and please report how many left
Guys @ some hosters you might think they will run a GlobalPing container or would spend one or more vps to support Globalping
Unlike my bank account, at least I'm in the black here.
ugh expensive, I need a few million per week.
Any volume discounts?
You trying to make an ipinfo competitor?
IPv9 support when?
Customers were casting doubts on our Antarctica location.
If
geolocateadds IPv9, the results can shut them up once and forever.Now someone offer this as a service xD
I do accept pull requests, the ball is in your court
Nice. This is useful.
No, for gaming, I call it "cloud bending".
Using that raw latency data to optimize my routing rules.
Turn into a webpage.
Reader inputs their GlobalPing token and the webpage runs the geolocate procedure, with animation and stuff.
It's doable but it would require a lot more effort and resources and I'm not sure how much demand there is for this. Especially since most people (no account) wouldn't be able able to run it more than ~2 times.
The CLI tool feels like a better fit
I made some updates:
Is it necessary to run probe from >3 location at phase 1?
For many instances no, but some targets could be right on the border of continents, so the more probes are used the better the accuracy for those edge cases
I understand. More probes == more accurate result. However, I think it's possible to improve the credit mileage through some calculations, if duration of the process aren't a concern.
It's possible but the few ideas I had still required a considerable amount of probes to see the benefits in terms of accuracy. Higher than the limit for unauthenticated users.
Lowering the probes while retaining accuracy requires research and math I'm not yet ready to jump into
Let say there's n probes. Calculating ping time between those probes is nC2. But, that's too much.
Therefore, it's easier to have 190-ish or 200ish territories as the row&column.
After the first two probe, it's possible to make rough guess. Then, the choose random probe within the possible location. At worst, it's on the other side of planet, but that's okay
This would require having a pre-compiled DB of latencies if I understand correctly.
You say a matrix of 200 locations. But what if the target's location is not in the DB?
I would then need to use the geographic coordinates of all GP probes to essentially create a large enough radius around the best candidates from the DB and run a measurement.
But that measurement to be accurate would still require plenty of probes. And that assumes the target location is close by to the DB.
What if its in a rare location, like Hawaii with nothing close by. It will most likely completely fail or require a huge radius with a large amount of probes.
Am I missing something?