PHPackages                             ysenn/ip2region - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ysenn/ip2region

ActiveLibrary

ysenn/ip2region
===============

Locate the province, city, and coordinates (latitude and longitude) based on an IP address.

v2.0.1(7mo ago)151↓100%MITPHPPHP &gt;=7.2

Since Sep 20Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/ysenn/ip2region)[ Packagist](https://packagist.org/packages/ysenn/ip2region)[ RSS](/packages/ysenn-ip2region/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

IP2Region
=========

[](#ip2region)

Locate the province, city, and coordinates (latitude and longitude) based on an IP address.
-------------------------------------------------------------------------------------------

[](#locate-the-province-city-and-coordinates-latitude-and-longitude-based-on-an-ip-address)

Examples
--------

[](#examples)

```
// First use
// View command help
// Initialize the IP database
php vendor/ysenn/ip2region/db_download.php -h

// ip2region
use IP2Region\IP2Region;

// IPv4-only support
$ip2region = new IP2Region();
// ip database file loading methods
// $ip2region->loadDBModel(IP2Region::VECTOR_INDEX);
// loading ip database file
$ip2region->loadDBFile();
// output raw data
//$ip2region->outputRawData();
return $ip2region->search('127.0.0.1');

// ip2location
use IP2Region\IP2Location;

// Dual-stack support
$ip2location = new IP2Location();
// loading ip database file
$ip2location->loadDBFile();
// output raw data
//$ip2location->outputRawData();
return $ip2location->search('127.0.0.1');
//return $ip2location->search('2001:0db8:85a3:0000:0000:8a2e:0370:7334'); // ipv6
```

### Third-Party Libraries &amp; Data

[](#third-party-libraries--data)

This project relies on several fantastic third-party resources.

- **\[ip2region\]**

    - **Link:** [ip2region](https://github.com/lionsoul2014/ip2region)
    - **License:** \[Apache-2.0 license\]
    - **Purpose:** This project uses the [ip2region](https://github.com/lionsoul2014/ip2region) as its data source.
- **\[IP2Location LITE\]**

    - **Link:** [IP2Location LITE](https://lite.ip2location.com)
    - **Purpose:** This project uses the [IP2Location LITE database](https://lite.ip2location.com) as its data source.
    - **License:**```
        IP2LOCATION LITE DATA LICENSE

        TERMS OF USE

        Copyright (c) 2025 IP2Location.com. All Rights Reserved.

        This download is provided free of charge by IP2Location.com under the following conditions:

        1. You must agree to our "Terms of Use", which are published online at https://lite.ip2location.com/terms-of-use at all times.

        2. You are not permitted to redistribute or resell this product.

        3. The use of "IP2Location.com" to endorse or promote products derived from this database is prohibited without specific prior written permission.

        5. Licensees may copy, distribute, display, and perform the work and create derivative works based on IP2Location LITE only if they give IP2LOCATION.COM credits in the manner specified below.

        All sites, advertising materials, and documentation mentioning features or the use of this database must display the following acknowledgment:

        "[Your site name or product name] uses the IP2Location LITE database for IP geolocation."

        IP2Location is a registered trademark of Hexasoft Development Sdn Bhd. All other trademarks are the property of their respective owners.

        ```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance62

Regular maintenance activity

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~121 days

Recently: every ~72 days

Total

7

Last Release

237d ago

Major Versions

v1.2.2 → v2.0.02025-09-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/473fa3ec8bd352604b4a6dc1c0bcf30bf7019c5d118fb7808eef8ce3754ad6a5?d=identicon)[ysenn](/maintainers/ysenn)

---

Top Contributors

[![ysenn](https://avatars.githubusercontent.com/u/106386154?v=4)](https://github.com/ysenn "ysenn (2 commits)")

### Embed Badge

![Health badge](/badges/ysenn-ip2region/health.svg)

```
[![Health](https://phpackages.com/badges/ysenn-ip2region/health.svg)](https://phpackages.com/packages/ysenn-ip2region)
```

###  Alternatives

[ip2location/ip2location-laravel

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

83516.9k1](/packages/ip2location-ip2location-laravel)[ip2location/ip2location-cakephp

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

224.6k](/packages/ip2location-ip2location-cakephp)[saeedvaziry/ip2location

IP to Location database

322.2k](/packages/saeedvaziry-ip2location)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
