PHPackages                             yasir-dev/ip-geolocation - 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. yasir-dev/ip-geolocation

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

yasir-dev/ip-geolocation
========================

Get geo location information from IP address

v1.0.1(7y ago)17MITPHPPHP &gt;=7.1

Since Oct 3Pushed 7y agoCompare

[ Source](https://github.com/Yasir-dev/ip-geolocation)[ Packagist](https://packagist.org/packages/yasir-dev/ip-geolocation)[ Docs](https://github.com/Yasir-dev/IPGeoloaction)[ RSS](/packages/yasir-dev-ip-geolocation/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

IP Geolocation
==============

[](#ip-geolocation)

[![Build Status](https://camo.githubusercontent.com/43f7a36d627bcdbae7179288a08f15690bd8a3d34046820aa806896d6d3ef1c0/68747470733a2f2f7472617669732d63692e636f6d2f59617369722d6465762f69702d67656f6c6f636174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Yasir-dev/ip-geolocation) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/a84ece3b5c07d24b9b3f50700b8f4f8bd74dc0a8593980169dd1f8346937475b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f59617369722d6465762f69702d67656f6c6f636174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Yasir-dev/ip-geolocation/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/3d754938d0433feba2dc029d45f2e0744ecb90a05dd08f04158e07d00259f973/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f59617369722d6465762f69702d67656f6c6f636174696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Yasir-dev/ip-geolocation/?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/8179744a9e60fc08fbc9071680946e7117f1aacb6318c5658474000273f9e20c/68747470733a2f2f706f7365722e707567782e6f72672f79617369722d6465762f69702d67656f6c6f636174696f6e2f762f737461626c65)](https://packagist.org/packages/yasir-dev/ip-geolocation)

Get geolocation information based on the IP address of the user. This package uses [Geo IP Api](http://ip-api.com/) to get geo information. Both IPv4 and IPv6 are supported.

[![Diagram](https://github.com/Yasir-dev/ip-geolocation/raw/master/geo_ip_diagram.jpg)](https://github.com/Yasir-dev/ip-geolocation/blob/master/geo_ip_diagram.jpg)

Usage limits
------------

[](#usage-limits)

[Geo IP Api](http://ip-api.com/) allows only 150 requests per minute. If you exceed this limit your Ip will be blocked by [Geo IP Api](http://ip-api.com/)

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

[](#installation)

You can install the package using composer

```
composer require yasir-dev/ip-geolocation

```

Usage
-----

[](#usage)

```
// use the package
use ipGeolocation\GeoIPLocation;

//get the ip address
$ipAddress = (new GeoIPLocation())->getIpAddress();

// get the location object
$location = (new GeoIPLocation())->getGeoLocation();

//check the status for success
$location->getStatus();

//get the required information
$location->getCountry();
$location->getRegionName();
$location->getRegionCode();
$location->getPostalCode();
$location->getTimezone();
$location->getCurrencyIso();
$location->getCity();
$location->getLongitude();
$location->getLatitude();

//handling error (status fail)
if (!$location->getStatus()) {
    //get error message
    $location->getMessage();
}
```

Use Cases
---------

[](#use-cases)

- Determine user's location.
- Determine user's currency/language.
- Customise your website based on user's location.

Contribution
------------

[](#contribution)

Please feel free to open new issues, pull requests, fork or spread the package

License
-------

[](#license)

MIT © Yasir Khurshid

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

2775d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b7d24f3c5ebb7a5e49836865b9f9a36106d6a8e8b0d4ecc7a93ab7b832b5cc9?d=identicon)[yasir.khurshid](/maintainers/yasir.khurshid)

---

Top Contributors

[![Yasir-dev](https://avatars.githubusercontent.com/u/41165103?v=4)](https://github.com/Yasir-dev "Yasir-dev (23 commits)")

---

Tags

geoipgeolocationlocationipgeolocation

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yasir-dev-ip-geolocation/health.svg)

```
[![Health](https://phpackages.com/badges/yasir-dev-ip-geolocation/health.svg)](https://phpackages.com/packages/yasir-dev-ip-geolocation)
```

###  Alternatives

[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[adrianorosa/laravel-geolocation

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

6593.3k1](/packages/adrianorosa-laravel-geolocation)[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

139204.2k6](/packages/ipip-db)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)

PHPackages © 2026

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