PHPackages                             kubrey/geoservice - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kubrey/geoservice

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kubrey/geoservice
=================

Geolocation module using multiple free geo services

2.0.1(8y ago)03.4kMITPHPPHP &gt;=5.3.0

Since Sep 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kubrey/geoservice)[ Packagist](https://packagist.org/packages/kubrey/geoservice)[ RSS](/packages/kubrey-geoservice/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

Geo data detection by IP
========================

[](#geo-data-detection-by-ip)

### Searching geo data by IP address

[](#searching-geo-data-by-ip-address)

### Description

[](#description)

Include several services:

- Maxmind
- Ipgeobase.ru
- Ipinfo.io
- Freegeoip.net
- Geobytes.com
- Telize.com
- Maxmind Legacy(v1)
- IpApi(ip-api.com)

### Installation

[](#installation)

[Composer](http://getcomposer.org/).

Add `kubrey/geoservice` to your `composer.json`

OR

```
composer require kubrey/geoservice

```

If you have no composer, install beforehand:

Run in the project's root:

```
curl -s http://getcomposer.org/installer | php

```

And then :

```
php composer.phar init

```

### Usage

[](#usage)

```
require 'vendor/autoload.php';

use GeoServices\GeoService;
use GeoServices\GeoException;

$g = new GeoService();
try {
    //set maxmind v2  absolute path to mmdb file(if you want to use this method)
    $g->setMaxmindDb(dirname(__FILE__) . '/GeoLite2-City.mmdb');
    //set maxmind-legacy  absolute path to dat file(if you want to use this method)
    $g->setMaxmindOldDb(dirname(__FILE__).'/GeoLiteCity.dat');
    $data = $g->lookup('95.153.74.242');
    var_dump($data->city);
} catch (GeoException $ex) {
    echo $ex->getMessage();
}

```

`$data` is an instance of `GeoObject`, containing these properties:

- countryName
- city
- latitude
- longitude
- zip
- regionName
- countryCode
- isp

To set your own method priority:

```
$g->maxmind = 1;//run first
$g->ipgeobaseru = false;//do not use
$g->ipinfo = 3;

```

To set required geo parameters

```
$g->isCityRequired = false; - поиск города не обязателен

```

To set timeout in milliseconds:

```
$g->setGlobalTimeout(5000);

```

To set timeout for each online service in milliseconds:

```
$g->setRequestTimeout(1000);

```

### Tests

[](#tests)

PHPUnit:

```
/usr/bin/php vendor/phpunit/phpunit/phpunit --colors --bootstrap vendor/autoload.php tests

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Recently: every ~136 days

Total

8

Last Release

3142d ago

Major Versions

1.8.0 → 2.0.12017-11-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ab745970e4e681a9552aae39d9b2a88b7d78272082324e83e5cb153c47c2329?d=identicon)[kubrey](/maintainers/kubrey)

---

Top Contributors

[![kubrey](https://avatars.githubusercontent.com/u/1605716?v=4)](https://github.com/kubrey "kubrey (76 commits)")

---

Tags

geoipgeolocationipgeobaseipgeobase.ruip servicefree geo location

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kubrey-geoservice/health.svg)

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

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k14.9M92](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.2M84](/packages/stevebauman-location)[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

137207.1k6](/packages/ipip-db)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

91194.7k1](/packages/pulkitjalan-ip-geolocation)[adrianorosa/laravel-geolocation

Laravel Geo Location package to get details for a given IP Address

6598.6k1](/packages/adrianorosa-laravel-geolocation)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

19253.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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