3 ms·
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
by styfle 9y ago
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 https://github.com/styfle/geoslack
- jonathan-kosgei 9y agoGeoslack 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.
- coderholic 9y agoHere'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 https://ipinfo.io/developers/replacing-getcurrentposition