libmaxminddb

C library for reading and querying MaxMind DB files.

brewmacoslinux
Try with needOr install directly
Source

About

C library for the MaxMind DB file format

Commands

mmdblookup

Examples

look up IP address in MaxMind database$ mmdblookup --file GeoLite2-City.mmdb --ip 8.8.8.8
get city and country for an IP address$ mmdblookup --file GeoLite2-City.mmdb --ip 1.1.1.1 city country
find geographic coordinates for IP address$ mmdblookup --file GeoLite2-City.mmdb --ip 203.0.113.1 location latitude longitude
query MaxMind database with verbose output$ mmdblookup --file GeoLite2-ASN.mmdb --ip 8.8.8.8 --verbose
integrate MaxMind database library into C code$ gcc -o myapp myapp.c $(pkg-config --cflags --libs libmaxminddb)