lionsoul2014/ip2region
FreeIp2region (2.0 - xdb) is a offline IP address manager framework and locator, support billions of data segments, ten microsecond searching performance. xdb engine implementation for many programming languages
About lionsoul2014/ip2region
ip2region is an offline IP address localization library and IP data management framework that provides city-level geolocation for both IPv4 and IPv6 addresses. It achieves 10-microsecond level query efficiency using the xdb data format, which supports billions of IP data segments. The project includes raw data sources and pre-built xdb files, along with query client implementations for 14 programming languages (Golang, PHP, Java, C, Lua, Python, Rust, JavaScript, C#, etc.). It offers two memory acceleration modes: vIndex Index Caching (512KiB) and full file caching. The framework allows fully customizable region data and automatically deduplicates and compresses IP segments during generation.
Key Features
Pros & Cons
- Fully offline, no external API calls needed
- Extremely fast query performance (10 microseconds)
- Supports both IPv4 and IPv6
- Multi-language client support for easy integration
- Open-source and free to use
- Data deduplication and compression reduce storage needs
- Scalable to billions of IP segments with xdb format
- Precision limited to city level (not street-level)
- Data updates require manual generation or download of new xdb files
- IPv6 data coverage may be less comprehensive than IPv4
- Documentation primarily in English and Chinese