geoip-api/README.md

400 B

geoip-api

HTTP API for converting an IPv4 address to a country code.

Uses the iptoasn.com dataset.

Setup

Grab the latest ip2asn-v4.tsv.gz and extract it to data/ip2asn-v4.tsv.

Then just use cargo as usual.

Usage

$ http GET 'http://127.0.0.1:8000/192.168.0.1'
{
  "asn": 0,
  "country_code": "None",
  "asn_desc": "Not routed"
}