# zoujingli/ip2region

PHP版本的离线IP地址定位库

Repository: https://github.com/zoujingli/ip2region
Canonical: https://ross.abutalabs.com/products/zoujingli-ip2region
Language: PHP
License Family: other
Last push: 2026-07-11T09:55:53+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 92, release rhythm 83, longevity 100
- inputs: {"age_days": 3451, "days_push": 53, "days_rel": 117, "gap_med": 5, "n_releases_24m": 18}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1420, forks 210 (observed 2026-08-28T04:04:40.349884+00:00)

## What it is
A PHP library for offline IP geolocation lookups based on the ip2region XDB data format, supporting IPv4 and IPv6 with multiple caching strategies. It ships with a bundled IPv4 database and provides both a global helper function and an object-oriented API, plus a CLI tool for managing database files.

## Use cases
- look up the city and ISP of an IP address in PHP
- offline IP geolocation without external API calls
- resolve IPv6 addresses to regions
- identify private, loopback, and reserved IP addresses
- batch query IP locations with caching
- download and manage ip2region XDB database files

## When to choose
- you need fast, offline IP-to-region lookups in a PHP 7.1+ application with no extension dependencies
- you want a bundled IPv4 database that works out of the box via Composer
- you need both functional and OOP APIs plus caching modes for performance tuning

## When to avoid
- you need global, street-level, or highly precise geolocation data
- your project is not in PHP
- you require IPv6 support without downloading an extra database file

## Facets
- artifact type: library
- maturity: active
- function: search-engine, cli, developer-tools
- domain: networking, developer-tools
- platform: php, cli, cross-platform
- tags: ip-geolocation, ip2region, offline-database, ipv4, ipv6, xdb, composer-package, command-line

## Member repositories
- zoujingli/ip2region (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:40.349884+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:37:50.783925+00:00, confidence not recorded.
  - readme: https://github.com/zoujingli/ip2region (fetched 2026-08-28T04:04:40.349884+00:00, sha 528406c12465)
- Data as of 2026-08-30T08:39:29.467469+00:00.
