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

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

antonmakasin/sypexgeo
=====================

A PHP package for working with the SypexGeo database file.

v2.0.1(7y ago)017MITPHPPHP ^7.0

Since Feb 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/antonmakasin/sypexgeo)[ Packagist](https://packagist.org/packages/antonmakasin/sypexgeo)[ RSS](/packages/antonmakasin-sypexgeo/feed)WikiDiscussions master Synced today

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

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

[](#sypexgeo-php-api)

[![Latest stable version](https://camo.githubusercontent.com/36cbf013f8a2d75787ce41da268e15491ae3e1f25dcfaff4cd247e5f63894409/68747470733a2f2f706f7365722e707567782e6f72672f6573656174682f737970657867656f2f762f737461626c65)](https://packagist.org/packages/eseath/sypexgeo)[![Build Status](https://camo.githubusercontent.com/8fd5df0e21d782fd2e3c29d57a302caefda237021ff39e7da96a5c893a50af69/68747470733a2f2f7472617669732d63692e6f72672f4573656174682f737970657867656f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Eseath/sypexgeo)

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

The current version supports Laravel 5.5 and later. If you need support Laravel 5.4 or older, see version 1.\*.

Installation for Laravel &gt;=5.5
---------------------------------

[](#installation-for-laravel-55)

1\. Add the package through composer:

```
composer require eseath/sypexgeo

```

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.

Also you can download the database manually:

- [Сountries](https://sypexgeo.net/files/SxGeoCountry.zip)
- [Сities](https://sypexgeo.net/files/SxGeoCity_utf8.zip)

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"
    ]
]

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

2883d ago

Major Versions

v1.1.0 → v2.0.02018-04-22

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

v2.0.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1459e01045f2c88d9cd3e5662c73a6b45a77e975e26d342de8d2a082a6715f1?d=identicon)[antonmakasin](/maintainers/antonmakasin)

---

Tags

laravelgeoipgeosypexgeosxgeo

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[eseath/sypexgeo

A PHP package for working with the SypexGeo database file.

13176.3k](/packages/eseath-sypexgeo)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

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

PHPackages © 2026

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