wp-statistics/GeoLite2-Country

Free MaxMind GeoLite2-Country database for IP geolocation. Ultra-lightweight (~2MB), auto-updated via jsDelivr CDN.

212

114 commits

updated Sep 22, 2026

See the code

README

GeoLite2-Country - Free IP to Country Database

npm version npm downloads License GitHub Stars

Free MaxMind GeoLite2-Country database for IP geolocation. Lightweight country-level lookup from any IP address. Automatically updated and served via jsDelivr CDN.

Website: geo.wp-statistics.com


Features

  • Country-Level Lookup - Fast country detection from IP addresses
  • Ultra Lightweight - Smallest database option (~2 MB)
  • Auto-Updated - Database updated automatically
  • Fast CDN - Served via jsDelivr with global edge locations
  • No Authentication - Direct download, no API keys required
  • Free Forever - Open source under CC BY-SA 4.0 license

Quick Start

Direct Download

https://cdn.jsdelivr.net/npm/geolite2-country/GeoLite2-Country.mmdb.gz

PHP

use GeoIp2\Database\Reader;

$reader = new Reader('/path/to/GeoLite2-Country.mmdb');
$record = $reader->country('128.101.101.101');

echo $record->country->name;     // 'United States'
echo $record->country->isoCode;  // 'US'

Node.js

const { Reader } = require('@maxmind/geoip2-node');

const reader = await Reader.open('./GeoLite2-Country.mmdb');
const response = reader.country('128.101.101.101');

console.log(response.country.names.en);  // 'United States'
console.log(response.country.isoCode);   // 'US'

Python

import geoip2.database

reader = geoip2.database.Reader('./GeoLite2-Country.mmdb')
response = reader.country('128.101.101.101')

print(response.country.name)      # 'United States'
print(response.country.iso_code)  # 'US'

WordPress (WP Statistics)

use WP_Statistics\Service\Geolocation\GeolocationFactory;

$location = GeolocationFactory::getLocation('128.101.101.101');
echo $location['country_code'];  // 'US'

Database Info

PropertyValue
CDN URLhttps://cdn.jsdelivr.net/npm/geolite2-country/GeoLite2-Country.mmdb.gz
npmnpm install geolite2-country
Update ScheduleAutomatic
Size~2 MB (compressed)
FormatMaxMind DB (MMDB)
LicenseCC BY-SA 4.0

Country vs City Database

FeatureGeoLite2-CountryGeoLite2-City
File Size~2 MB~68 MB
DataCountry onlyCountry, city, coordinates
SpeedFastestFast
Best ForGeo-blocking, basic analyticsDetailed location needs

Choose Country if you only need country-level data. Choose City for detailed location information.



Attribution

This database is provided by MaxMind. When using this database, please include appropriate attribution as required by the CC BY-SA 4.0 license.


License

GeoLite2-Country by MaxMind is licensed under CC BY-SA 4.0.

Maintained by VeronaLabs and the WP Statistics team.

country
geoip
ip
location
maxmind

Contributors

wp-statistics/GeoLite2-Country

Free MaxMind GeoLite2-Country database for IP geolocation. Ultra-lightweight (~2MB), auto-updated via jsDelivr CDN.

212

114 commits

updated Sep 22, 2026

See the code

README

GeoLite2-Country - Free IP to Country Database

npm version npm downloads License GitHub Stars

Free MaxMind GeoLite2-Country database for IP geolocation. Lightweight country-level lookup from any IP address. Automatically updated and served via jsDelivr CDN.

Website: geo.wp-statistics.com


Features

  • Country-Level Lookup - Fast country detection from IP addresses
  • Ultra Lightweight - Smallest database option (~2 MB)
  • Auto-Updated - Database updated automatically
  • Fast CDN - Served via jsDelivr with global edge locations
  • No Authentication - Direct download, no API keys required
  • Free Forever - Open source under CC BY-SA 4.0 license

Quick Start

Direct Download

https://cdn.jsdelivr.net/npm/geolite2-country/GeoLite2-Country.mmdb.gz

PHP

use GeoIp2\Database\Reader;

$reader = new Reader('/path/to/GeoLite2-Country.mmdb');
$record = $reader->country('128.101.101.101');

echo $record->country->name;     // 'United States'
echo $record->country->isoCode;  // 'US'

Node.js

const { Reader } = require('@maxmind/geoip2-node');

const reader = await Reader.open('./GeoLite2-Country.mmdb');
const response = reader.country('128.101.101.101');

console.log(response.country.names.en);  // 'United States'
console.log(response.country.isoCode);   // 'US'

Python

import geoip2.database

reader = geoip2.database.Reader('./GeoLite2-Country.mmdb')
response = reader.country('128.101.101.101')

print(response.country.name)      # 'United States'
print(response.country.iso_code)  # 'US'

WordPress (WP Statistics)

use WP_Statistics\Service\Geolocation\GeolocationFactory;

$location = GeolocationFactory::getLocation('128.101.101.101');
echo $location['country_code'];  // 'US'

Database Info

PropertyValue
CDN URLhttps://cdn.jsdelivr.net/npm/geolite2-country/GeoLite2-Country.mmdb.gz
npmnpm install geolite2-country
Update ScheduleAutomatic
Size~2 MB (compressed)
FormatMaxMind DB (MMDB)
LicenseCC BY-SA 4.0

Country vs City Database

FeatureGeoLite2-CountryGeoLite2-City
File Size~2 MB~68 MB
DataCountry onlyCountry, city, coordinates
SpeedFastestFast
Best ForGeo-blocking, basic analyticsDetailed location needs

Choose Country if you only need country-level data. Choose City for detailed location information.



Attribution

This database is provided by MaxMind. When using this database, please include appropriate attribution as required by the CC BY-SA 4.0 license.


License

GeoLite2-Country by MaxMind is licensed under CC BY-SA 4.0.

Maintained by VeronaLabs and the WP Statistics team.

country
geoip
ip
location
maxmind

Contributors