Hacker News new | past | comments | ask | show | jobs | submit login

How accurate can you get with an IP address? I seems like it could act as a fallback if the geolocation web api is blocked.

I have a side project[0] that uses the geolocation api to post to Slack and seems to be pretty accurate, even on mobile. Maybe I'll try this as a fallback.

[0]: https://github.com/styfle/geoslack




Here's a guide on doing exactly that - falling back to IP geolocation when browser geolocation is blocked (or unavailable): https://ipinfo.io/developers/replacing-getcurrentposition


Geoslack looks really cool!! Using it as a fallback when location isn't allowed via the browser or if within an app from GPS would be a valid and common usecase!

I'd say you can pretty much trust it up to the country level and greater region, more specific than that the results will not always be highly accurate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: