PHPackages                             jayin/ipgeo - 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. jayin/ipgeo

ActiveLibrary

jayin/ipgeo
===========

Get IP GEO

0.2.0(3y ago)06MITPHPPHP &gt;=7.0

Since Jun 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Jayin/IpGeo)[ Packagist](https://packagist.org/packages/jayin/ipgeo)[ RSS](/packages/jayin-ipgeo/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

IpGeo
=====

[](#ipgeo)

获取IP的地理位置信息(所属国家、省、市、区、经纬度)

支持地图：

- 腾讯地图
- TODO 百度地图
- TODO CZ88

Install
-------

[](#install)

```
$ composer require jayin/ipgeo -vvv
```

Usage
-----

[](#usage)

```
$ipGeo = new IpGeo();
$ipGeo->setConfig([
    'driver' => 'Tencent',
    'drivers' => [
        'Tencent' => [
            [
                'app_key' => '{app_key}',
            ]
        ],
    ]
]);
$ip = '61.140.183.172';
$info = $ipGeo->geo($ip);

// 指定配置
$info = $ipGeo->useDriver('baidu')->geo($ip)
```

返回格式如下

```
{
    "driver": "Tencent",
    "ip": "61.140.183.172",
    "lat": 23.12908,
    "lng": 113.26436,
    "nation": "中国",
    "province": "广东省",
    "city": "广州市",
    "district": ""
}
```

Test
----

[](#test)

```
$  composer run test
```

License
-------

[](#license)

MIT

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

1438d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/62f80da352033f962733c8ce149a74f1ea586ab9bcb6b805311281d9563509b7?d=identicon)[Jayin](/maintainers/Jayin)

---

Top Contributors

[![Jayin](https://avatars.githubusercontent.com/u/2763894?v=4)](https://github.com/Jayin "Jayin (3 commits)")

---

Tags

geolocationipip-geolocation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jayin-ipgeo/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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