Show HN: User Country, geoIP with commonly used data
usercountry.com
usercountry.com
I figured I'd put this all together in one API service, to make that possible 2-3 steps of things to do in code to be just 1 step.
Please don't use geoip for language detection. Geographic location has literally nothing to do with the language the user understands.
There is a http header dedicated to client language preferences. Please use it.
>1. How accurate is the language data? > > We determine language purely based on what country the user resides in, based on their IP address. Like any human being, your user could live in (or stay in) a certain country and speak a different language than the official language of the country. For best results, you should also check the Accept-Language HTTP header of your user's client, and determine what to use in your web app. > > Similarly, Android apps could use the Locale.getDefault().getISO3Language() call and iOS apps could use the NSLocale.preferredLanguages()[0] as String call to get user languages.
If companies like google can massively fuck up language selection based on ip, you can guarantee other devs will too, if you give them the data.
Say your site offers English, Chinese, Japanese, and a number of other languages. Your user's HTTP header says they can accept Japanese. So you default to Japanese. Their IP says they're in China. Wouldn't you want Chinese to be the 2nd choice on the language list to choose from, because that's a more likely choice for the user (if they were to have to switch) rather than English, French, Spanish, etc.?
I'm sure it doesn't take a lot of imagination to think of a lot of other use cases. At the end of the day, it just gives you one more data point to act on. ;)