3 ms·
Ask HN: Recommendations to do IP/Geo location on a website?
I need to implement some geolocation system to limit visitors who can access a health website to two states (CA & NY).
What methods/services/libraries do you recommend to accomplish this?
Stack is Node/Express backend and React front end, if it matters.
- thrwaway69 7y agoFor language dependent solution, https://www.npmjs.com/package/express-ipfilter https://www.npmjs.com/package/express-ipfilter looks alright. You could try .htacesss or nginx proxy to block certain ip ranges for language agnostic solution. https://www.maxmind.com/en/home https://www.maxmind.com/en/home provides ips mapped to location but I don't think you will find anything accurate for states. Another would be to get location data from the client and send it to backend to decode and see if the user is in correct state. (Of course, someone could sniff that but people can already change their ips).
- jonathan-kosgei 7y agoYou could modify the example here - https://ipdata.co/blog/how-to-block-website-visitors-from-a-specific-country/ https://ipdata.co/blog/how-to-block-website-visitors-from-a-... to work with states easily enough.