Analysis updated 2026-05-18
Show region-specific content or language to users based on their IP location without calling external APIs.
Enforce geo-restrictions or block traffic from specific countries directly in your application.
Log and analyze where your traffic originates for security and analytics without external dependencies.
| lionsoul2014/ip2region | dianping/cat | yunaiv/yudao-cloud | |
|---|---|---|---|
| Stars | 19,008 | 18,951 | 18,927 |
| Language | Java | Java | Java |
| Setup difficulty | easy | hard | hard |
| Complexity | 2/5 | 4/5 | 4/5 |
| Audience | developer | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
ip2region is an offline library that translates an IP address into geographic and network information, specifically the country, province, city, and internet service provider, without making any network requests. Most IP-to-location lookups call a remote API, which adds latency, costs money, and stops working if you go offline. ip2region bundles all the lookup data in a compact binary file format called xdb that you ship with your application. Lookups against the xdb file take around 10 microseconds (incredibly fast, that's about ten millionths of a second). You can optionally load part or all of the file into memory to make it even faster. The library supports both IPv4 and IPv6 addresses and exposes a consistent API across many programming languages, including Go, Java, Python, JavaScript, Rust, C, C++, PHP, C#, Lua, Erlang, and even an Nginx extension. You would use ip2region when you need to geolocate users inside your own infrastructure, for example to show region-specific content, enforce geo-restrictions, or log where traffic comes from, without depending on an external service. The core project is written in Java, though client libraries are available in over a dozen languages. The bundled IP data is updated periodically, teams with high accuracy requirements can integrate commercial data from the ip2region community.
Offline IP-to-location lookup library that translates IP addresses to country, city, and ISP without network requests. Ships with compact data file for fast, reliable geolocation.
Mainly Java. The stack also includes Java, Go, Python.
Use freely for any purpose including commercial. Keep the notice and disclose changes to the patent grant.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.