The libmaxminddb library provides a C library for reading MaxMind DB files, including the GeoIP2 databases from MaxMind.