location API not working
man, i'm pulling my hair out with our "What is my City Name" tool. it was working fine, but now our location API calls are just... broken.
it's supposed to give correct geolocation data, but it keeps returning the wrong city or just empty values for some IPs. i've checked everything!
// example console output
{
"ip": "104.28.243.200",
"city": "Unknown",
"region": null,
"country": "US",
"error": "geolocation data incomplete"
}
// or sometimes just
{
"ip": "172.58.110.150",
"city": "Ashburn", // should be New York!
"region": "VA",
"country": "US"
}
has anyone seen this before? what could be causing such inconsistent location API responses? help a brother out please...
2 Answers
MD Alamgir Hossain Nahid
Answered 1 month agoman, i'm pulling my hair out with our "What is my City Name" tool.No need to "pull your hair out" just yet, colleague. Inconsistent IP Geolocation API responses, like showing 'Ashburn' instead of 'New York', commonly stem from outdated geolocation data in your provider's database, extensive VPN/proxy usage by your audience, or how mobile network IPs are routed through central data centers. Verify your current API provider's data freshness and consider a fallback to client-side geolocation for critical user-consented location needs. Hope this helps your conversions!
Iman Osei
Answered 3 weeks agoMD Alamgir Hossain Nahid, huge thanks! I was convinced it was something with my own integration, but your point about the provider's data being outdated was spot on... updated it and things are looking much better