IP geolocation script
This repository contains a small script that you can use when you need to geolocate a bunch of IP addresses. It uses the IP2C API, which is free and doesn't require any registration or API key.
It takes a file containing a list of IPs as an input, and outputs a CSV friendly format.
Input file format: a file containing one IPv4 address per line, in dotted notation (e.g. 126.96.36.199)
Output file format: IP, ISO2 country code, Country name
python geolocate.py ip_file > geolocalized_ips
188.8.131.52,US,United States 184.108.40.206,CH,Switzerland 220.127.116.11,FR,France 18.104.22.168,US,United States