PHPackages                             gemz/geoip - 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. gemz/geoip

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

gemz/geoip
==========

Get GeoIp informations from ip-api.com

1.0.1(6y ago)121MITPHPPHP ^7.2CI failing

Since May 6Pushed 6y agoCompare

[ Source](https://github.com/gemzio/geoip)[ Packagist](https://packagist.org/packages/gemz/geoip)[ Docs](https://github.com/gemzio/geoip)[ RSS](/packages/gemz-geoip/feed)WikiDiscussions master Synced 3w ago

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

Get GeoIp informations from ip-api.com
======================================

[](#get-geoip-informations-from-ip-apicom)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4f88183ae91cc5be252101ec84efe4412670d8a8857bfa6b9c1d410742955059/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656d7a2f67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/geoip)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5c77a591c9d13eae5c2e7905e4e2eb71a5713614e56ce1e3d7e3e52be499c174/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f67656d7a696f2f67656f69702f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/gemzio/geoip/actions?query=workflow%3Arun-tests+branch%3Amaster)[![Quality Score](https://camo.githubusercontent.com/b6939ff042c1b7c8caabf63037437ff4d26e11b8829beab2633d15a5ba90de27/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f67656d7a696f2f67656f69702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/gemzio/geoip)[![Total Downloads](https://camo.githubusercontent.com/fcabc2a09dd32b809bdd2d114c7f5578bdfa7ae6444d7e8e586ce3b52664b9e5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656d7a2f67656f69702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gemz/geoip)

This package uses [ip-api.com](https://ip-api.com) for getting geo ip informations.

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

[](#installation)

You can install the package via composer:

```
composer require gemz/geoip
```

Usage
-----

[](#usage)

```
use \Gemz\GeoIp\GeoIp;

// get by domain
$result = GeoIp::for('gemz.io')->get();

// get by ip
$result = GeoIp::for('52.59.200.190')->get();

// result in specific locale
// supported are de, en, fr, es default is en
$result = GeoIp::for('gemz.io')->locale('en')->get();

// response is an array with these values
array:17 [
  "status" => "success"
  "country" => "Germany"
  "countryCode" => "DE"
  "region" => "HE"
  "regionName" => "Hesse"
  "city" => "Frankfurt am Main"
  "zip" => "60313"
  "lat" => 50.1109
  "lon" => 8.68213
  "timezone" => "Europe/Berlin"
  "isp" => "Amazon Technologies Inc."
  "org" => "AWS EC2 (eu-central-1)"
  "as" => "AS16509 Amazon.com, Inc."
  "asname" => "AMAZON-02"
  "reverse" => "ec2-52-59-200-190.eu-central-1.compute.amazonaws.com"
  "proxy" => false
  "query" => "52.59.200.190"
]

// if request is not successful
[
    "status" => "fail",
    "query" => "notvalid domain",
]
```

### Testing

[](#testing)

```
composer test
composer test-coverage
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stefan Riehl](https://github.com/stefanriehl)

Support us
----------

[](#support-us)

Gemz.io is maintained by [Stefan Riehl](https://github.com/stefanriehl). You'll find all open source projects on [Gemz.io github](https://github.com/gemzio).

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

3

Last Release

2249d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4265046f24e014f773ad4f7cb289fb27b313d75f2810085462b7bd590d963ebe?d=identicon)[stefanriehl](/maintainers/stefanriehl)

---

Tags

geoipgemz

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gemz-geoip/health.svg)

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

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k15.3M97](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k8.5M90](/packages/stevebauman-location)[willdurand/geocoder

Common files for PHP Geocoder

17437.9M170](/packages/willdurand-geocoder)[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

139208.9k6](/packages/ipip-db)[adrianorosa/laravel-geolocation

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

66101.2k1](/packages/adrianorosa-laravel-geolocation)[bobey/geoip2-geolite2-composer

This tiny repository aims to provide an easy solution to require GeoIP2 / GeoLite2 databases inside your project using composer.

17896.8k1](/packages/bobey-geoip2-geolite2-composer)

PHPackages © 2026

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