Get a visitor's country from their IP address in Node.js, Python, PHP and Go
Looking up a country from an IP takes one HTTP request. Getting the right IP, handling IPv6 and private addresses, caching results and failing gracefully takes a little more. Working examples in four languages.