PHPackages                             eseath/sypexgeo - 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. eseath/sypexgeo

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

eseath/sypexgeo
===============

A PHP package for working with the SypexGeo database file.

v2.3.2(2y ago)12189.5k↓37.1%6[1 issues](https://github.com/Eseath/sypexgeo/issues)MITPHPPHP ^7.0|^8.0CI failing

Since Feb 1Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Eseath/sypexgeo)[ Packagist](https://packagist.org/packages/eseath/sypexgeo)[ RSS](/packages/eseath-sypexgeo/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (0)

SypexGeo PHP API
================

[](#sypexgeo-php-api)

[![Minimum PHP Version](https://camo.githubusercontent.com/9104d4815ca26c20fb814da03a49fbfc1c230dbb45b36016f81d5d0e181c8494/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d3838393242462e7376673f7374796c653d666c6174)](https://php.net/)[![Latest stable version](https://camo.githubusercontent.com/36cbf013f8a2d75787ce41da268e15491ae3e1f25dcfaff4cd247e5f63894409/68747470733a2f2f706f7365722e707567782e6f72672f6573656174682f737970657867656f2f762f737461626c65)](https://packagist.org/packages/eseath/sypexgeo)[![Build Status](https://camo.githubusercontent.com/83f5bf42b7d4e9538e15a836e82a7b0444e802ce0d91b11edce8ffe0e581453d/68747470733a2f2f7472617669732d63692e636f6d2f4573656174682f737970657867656f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Eseath/sypexgeo)

A PHP package for working with the [SypexGeo](https://sypexgeo.net) database file.

The current version supports Laravel 5.1 and later.

Installation
------------

[](#installation)

```
composer require eseath/sypexgeo

```

For non-Laravel projects, you need to manually download the database file:

- [Countries](https://sypexgeo.net/files/SxGeoCountry.zip)
- [Cities](https://sypexgeo.net/files/SxGeoCity_utf8.zip)

> The database is updated 2 times a month.

Setup
-----

[](#setup)

### Laravel

[](#laravel)

1\. If Laravel version &lt;= 5.4, add into `config/app.php`:

```
    'providers' => [
        \Eseath\SxGeo\SxGeoServiceProvider::class,
    ]
```

2\. Publish config `sxgeo.php` (optionally):

```
php artisan vendor:publish --provider="Eseath\SxGeo\SxGeoServiceProvider"

```

By default, in config specified URL to the database of cities. If you want the database of countries, change url:

```
...
    'dbFileURL' => 'https://sypexgeo.net/files/SxGeoCountry.zip',
...

```

3\. Download the database file:

```
php artisan sxgeo:update

```

You can use this command to upgrade database to the current version via CRON.

Usage
-----

[](#usage)

```
use Eseath\SxGeo\SxGeo;

$sxGeo = new SxGeo('/path/to/database/file.dat');
$fullInfo  = $sxGeo->getCityFull($ip);
$briefInfo = $sxGeo->get($ip);
```

### With Laravel

[](#with-laravel)

```
use SxGeo;

$data = SxGeo::getCityFull($ip);
```

Example Data
------------

[](#example-data)

```
array:3 [▼
    "city" => array:5 [▼
        "id" => 524901
        "lat" => 55.75222
        "lon" => 37.61556
        "name_ru" => "Москва"
        "name_en" => "Moscow"
    ]
    "region" => array:4 [▼
        "id" => 524894
        "name_ru" => "Москва"
        "name_en" => "Moskva"
        "iso" => "RU-MOW"
    ]
    "country" => array:6 [▼
        "id" => 185
        "iso" => "RU"
        "lat" => 60
        "lon" => 100
        "name_ru" => "Россия"
        "name_en" => "Russia"
    ]
]

```

```
array:2 [▼
    "city" => array:5 [▼
        "id" => 524901
        "lat" => 55.75222
        "lon" => 37.61556
        "name_ru" => "Москва"
        "name_en" => "Moscow"
    ]
    "country" => array:2 [▼
        "id" => 185
        "iso" => "RU"
    ]
]

```

Running Tests
-------------

[](#running-tests)

The tests are run automatically by Travis CI on multiple PHP and Laravel versions.

If you want to run tests locally, use the following command:

```
python3 ./test.py
```

Development
-----------

[](#development)

```
docker-compose run php-7.1 composer install
```

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community13

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 96.3% 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 ~197 days

Recently: every ~224 days

Total

14

Last Release

875d ago

Major Versions

1.1.0 → v2.0.02018-04-22

v1.x-dev → v2.3.02021-12-08

PHP version history (3 changes)v1.0.0PHP &gt;=5.6.4

v2.0.0PHP ^7.0

v2.1.0PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d5311ea7d1ca13e60b5d559ac409e19ef4471a85be72cf3e846f1de21683edf?d=identicon)[Ruslan A.](/maintainers/Ruslan%20A.)

---

Top Contributors

[![Eseath](https://avatars.githubusercontent.com/u/4947716?v=4)](https://github.com/Eseath "Eseath (52 commits)")[![ggmanuilov](https://avatars.githubusercontent.com/u/3313417?v=4)](https://github.com/ggmanuilov "ggmanuilov (2 commits)")

---

Tags

geogeoipiplaravellaravel-packagephpsypexgeolaravelgeoipgeosypexgeosxgeo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/eseath-sypexgeo/health.svg)

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.5M90](/packages/stevebauman-location)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[firefly-iii/data-importer

Firefly III Data Import Tool.

8035.8k](/packages/firefly-iii-data-importer)[venturedrake/laravel-crm

A free open source CRM built as a package for laravel projects

43311.2k](/packages/venturedrake-laravel-crm)[adrianorosa/laravel-geolocation

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

66101.2k1](/packages/adrianorosa-laravel-geolocation)

PHPackages © 2026

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