
Ask HN: Recommendations to do IP/Geo location on a website? - technics256
I need to implement some geolocation system to limit visitors who can access a health website to two states (CA &amp; NY).<p>What methods&#x2F;services&#x2F;libraries do you recommend to accomplish this?<p>Stack is Node&#x2F;Express backend and React front end, if it matters.
======
thrwaway69
For 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
You could modify the example here - [https://ipdata.co/blog/how-to-block-
website-visitors-from-a-...](https://ipdata.co/blog/how-to-block-website-
visitors-from-a-specific-country/) to work with states easily enough.

