Trouble getting accurate IP geolocation for my web tool
hey everyone, i'm pretty new to all this but just launched a super simple web tool called 'what is my country?' it's basically just to show users their current country and ip location. it's been a fun learning experience, but i'm running into some frustrating issues with ip geolocation accuracy.
sometimes it's spot on, which is great, but other times, especially for mobile users or those using vpns/proxies, it's way off. i'm seeing things like a generic data center in another country, or just completely wrong information. it's kinda embarrassing when someone from paris gets told they're in a dallas server farm!
for example, when i try to log the geolocation data i get output like this:
{
"ip": "104.28.1.1",
"country_code": "US",
"country_name": "United States",
"region_name": "Texas",
"city": "Dallas",
"latitude": 32.7767,
"longitude": -96.7970,
"isp": "Cloudflare, Inc.",
"is_proxy": true,
"confidence": "low"
}this is for a user who i know for a fact is in germany, not dallas. makes my tool look a bit broken.
so, i was hoping some of you seasoned folks could help a brother out please. i have a few specific questions:
- what are some reliable (and ideally free or low-cost) ip geolocation apis or services you guys recommend for a small tool like mine?
- are there any common strategies to improve accuracy, especially when dealing with vpns, proxies, or mobile networks? i'm talking about getting more precise ip location data.
- any beginner pitfalls i should avoid when trying to get better ip location data?
just looking for some practical advice to make my little tool more useful. thanks a bunch!
0 Answers
No answers yet.
Be the first to provide a helpful answer!