Batch IP geolocation script.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

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.

Output file format: IP, ISO2 country code, Country name


python ip_file > geolocalized_ips

Sample result:,US,United States,CH,Switzerland,FR,France,US,United States