geoip-rs 0.2.1

geoip-rs provides geographical information about the calling or the specified IP address
Documentation

geoip-rs

geoip-rs is a geoip service: it provides geographical information about the calling or the specified IP address.

When called with no query params, it resolves the calling IP address. For example: https://api.geoip.rs

When called with the ip query param, it resolves the specified IP address. For example: https://api.geoip.rs/?ip=216.58.205.132

If the provided IP address is invalid, it falls back to the calling IP address.

Running

Once built with cargo build --release, run it with ./target/release/geoip-rs. By default the english location dataset is loaded.

You can specify different datasets as command line arguments, for example

./target/release/geoip-rs data/GeoLite2-City-Blocks-IPv4.csv data/GeoLite2-City-Locations-ja.csv

or environment variables, for example

export GEOIP_RS_BLOCKS_FILE_PATH=./data/GeoLite2-City-Blocks-IPv4.csv
export GEOIP_RS_LOCATIONS_FILE_PATH=./data/GeoLite2-City-Locations-ja.csv
./target/release/geoip-rs

Datasets

geoip-rs uses the free datasets provided by maxmind. They are not bundled: you have to download them separately.

Download "GeoLite2 City" dataset in CSV format from here and unzip it into the data folder.

License

This project is licensed under the Apache License, Version 2.0