GeoIP API
This module provides an API for determining the geographic location of an IP address, supporting various databases and services like Maxmind GeoIP2, Cloudflare, and Cloudfront. It acts as a utility for other modules to integrate geolocation data.
Provides an API for geolocating an IP address.
Drupal 8
Provides plugins for Maxmind GeoIP2 and CDNs (Cloudflare/Cloudfront/Custom header).
Drupal 7
The Drupal 7 version is considered feature complete and won't be actively developed by the current maintainers.
Uses the GeoLite Country or City databases. Unlike other IP to country code modules, this one does nothing on its own. It is an API/utility module for use by other modules.
As of 7.x-2.x the module also supports Maxminds GeoIP2 databases.
Note: the D7 version of this module is incompatible with the geoip PECL extension. For more information please review this issue.