Skip to content

Comment on Ask YC: Geolocation by IP Address API/Service?

Comments

Maxmind has a free javascript one to detect cities and states...the cities are a little off but the state is always dead on.

I can provide it later if you'd like?

I just tried Maxmind, and it thinks I'm in Roswell, GA. I'm in east Alabama.

Hey give the one up there a try. It should get your state right, I've never had any problems with it, although my testing has been limited to 12 trials...

Paste it in this thread, maybe? ;-D

Yeah I was at work and I needed to dig into some old files to find it, here we go:

<script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>

<script type="text/javascript"> var country = geoip_country_name(); var state = geoip_region(); alert("State: "+state); </script>

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.