PHPackages                             peaky-blind3rs/ip-address-interface - 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. peaky-blind3rs/ip-address-interface

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

peaky-blind3rs/ip-address-interface
===================================

IP Address Interface

1.0.0(2y ago)07MITPHPPHP &gt;=8.2

Since Jul 15Pushed 2y agoCompare

[ Source](https://github.com/Peaky-Blind3rs/ip-address-interface)[ Packagist](https://packagist.org/packages/peaky-blind3rs/ip-address-interface)[ RSS](/packages/peaky-blind3rs-ip-address-interface/feed)WikiDiscussions main Synced 1mo ago

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

IP Address Interface Library for PHP
------------------------------------

[](#ip-address-interface-library-for-php)

This library offers a standard interface to implement IP Geolocation and Threat Intelligence API in your PHP projects. It offers developers a way to craft various IP data adapter classes for their unique project requirements.

[![Packagist](https://camo.githubusercontent.com/07e50ea6d92b71c85119d31cc90aecbdffe3c409cb292d75ed9c2b4a57efa778/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7065616b792d626c696e643372732f69702d616464726573732d696e746572666163652e737667)](https://packagist.org/packages/peaky-blind3rs/ip-address-interface)[![Latest Stable Version](https://camo.githubusercontent.com/bb3bb637f1242dd53f16b71e649cab9e02331734f5c772b18778d34e831bb15b/68747470733a2f2f706f7365722e707567782e6f72672f7065616b792d626c696e643372732f69702d616464726573732d696e746572666163652f76)](https://packagist.org/packages/peaky-blind3rs/ip-address-interface)[![Total Downloads](https://camo.githubusercontent.com/2a138a1d6d9976a1479989d22fb535d15a27c57f1cc732fc314e5dd35f7072f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7065616b792d626c696e643372732f69702d616464726573732d696e746572666163652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/peaky-blind3rs/ip-address-interface)[![Build Status](https://github.com/peaky-blind3rs/ip-address-interface/actions/workflows/main.yml/badge.svg)](https://github.com/peaky-blind3rs/ip-address-interface/actions)[![codecov](https://camo.githubusercontent.com/035f54d5c262f3187e59b2b1f00df53fa222682a2e097c817ffd6d5edeb05469/68747470733a2f2f636f6465636f762e696f2f67682f5065616b792d426c696e643372732f69702d616464726573732d696e746572666163652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d41534e41583745443031)](https://codecov.io/gh/Peaky-Blind3rs/ip-address-interface)[![Type Coverage](https://camo.githubusercontent.com/7044f4d7afdb474267db958f6fb9022742a9cc390c8b22a4c64c1efb24fa8228/68747470733a2f2f73686570686572642e6465762f6769746875622f5065616b792d426c696e643372732f69702d616464726573732d696e746572666163652f636f7665726167652e737667)](https://camo.githubusercontent.com/7044f4d7afdb474267db958f6fb9022742a9cc390c8b22a4c64c1efb24fa8228/68747470733a2f2f73686570686572642e6465762f6769746875622f5065616b792d426c696e643372732f69702d616464726573732d696e746572666163652f636f7665726167652e737667)[![Psalm level](https://camo.githubusercontent.com/0f3b7deb3407c97a998beb7d01ae5d46eca97598dacd4c0b7b375979a20c1ca6/68747470733a2f2f73686570686572642e6465762f6769746875622f5065616b792d426c696e643372732f69702d616464726573732d696e746572666163652f6c6576656c2e7376673f)](https://psalm.dev/)[![PSR-12](https://camo.githubusercontent.com/23315bffd6a733df7d9e3a580d65ce774d478a1d8d985f953ea35374554acccf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5053522d2d31322d627269676874677265656e)](https://www.php-fig.org/psr/psr-12/)[![PHP Version](https://camo.githubusercontent.com/2ac2f0dcd33bb170e73aa9bb8fc8f491617fd99337dca35099f91987a0362de9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322e372d626c7565)](https://camo.githubusercontent.com/2ac2f0dcd33bb170e73aa9bb8fc8f491617fd99337dca35099f91987a0362de9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322e372d626c7565)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

### Requirements

[](#requirements)

- PHP 8.2 or higher
- psr/http-message 1.1 or higher

### Installation

[](#installation)

The package can be installed via [Composer](https://getcomposer.org/). Run the following command:

```
composer require peaky-blind3rs/ip-address-interface
```

### Usage

[](#usage)

Using [IPInfo Adapter](https://ipinfo.io)

```
use PeakyBlind3rs\IpAddressInterface\Interface\Model\IpAddressInterface;
use PeakyBlind3rs\IpAddressInterface\IPServiceFactory;

$instance = IPServiceFactory::getInstance('ipinfo://nobody:your-api-token@ipinfo.io/?timeout=30');

$result = $instance->lookup('27.126.160.0');

if ($result instanceof IpAddressInterface) {
    // Request was successful, use getter methods to get data
} else {
    // Requested Ended in Error and $result hold instance of \Psr\Http\Message\ResponseInterface
}
```

Or if you want to use [IPData Adapter](https://ipdata.co)

```
use PeakyBlind3rs\IpAddressInterface\Interface\Model\IpAddressInterface;
use PeakyBlind3rs\IpAddressInterface\IPServiceFactory;

$instance = IPServiceFactory::getInstance('ipdata://nobody:your-api-key@ipdata.co/?timeout=30');

$result = $instance->lookup('27.126.160.0');

if ($result instanceof IpAddressInterface) {
    // Request was successful, use getter methods to get data
} else {
    // Requested Ended in Error and $result hold instance of \Psr\Http\Message\ResponseInterface
}
```

If you want to use your own adapter, your adapter needs to implement `\PeakyBlind3rs\IpAddressInterface\Interface\IpLookupInterface`

```
namespace MyNamespace;

class MyAdapter implements \PeakyBlind3rs\IpAddressInterface\Interface\IpLookupInterface {

}
```

And then add your adapter to class map and use it

```
use MyNamespace\MyAdapter;
use PeakyBlind3rs\IpAddressInterface\IPServiceFactory;
use PeakyBlind3rs\IpAddressInterface\Interface\Model\IpAddressInterface;

IPServiceFactory::classMaps([
    'myadapter' => MyAdapter::class
]);

$instance = IPServiceFactory::getInstance('myadapter://nobody:your-api-key@myadapter-api.tld/?timeout=30');

$result = $instance->lookup('27.126.160.0');

if ($result instanceof IpAddressInterface) {
    // Request was successful, use getter methods to get data
} else {
    // Requested Ended in Error and $result hold instance of \Psr\Http\Message\ResponseInterface
}
```

### Testing

[](#testing)

To run the tests, execute:

```
composer test
```

### Coding Standards

[](#coding-standards)

Check your code for PSR compliance:

```
composer cs-check
```

### Static Analysis

[](#static-analysis)

Analyze your code statically:

```
composer static-analysis
```

### License

[](#license)

This project is licensed under the MIT License. Refer to the [LICENSE.md](LICENSE.md) file for further details.

### Contributing

[](#contributing)

Please consult the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.

### Acknowledgements

[](#acknowledgements)

- Thanks to the PHP community for providing the language we cherish.
- Thanks to [Composer](https://getcomposer.org/) for handling the package dependencies effectively.

### Contact

[](#contact)

- Have any issues? Report them via the project issue tracker.
- Got some enhancements in mind? Feel free to create a pull request or open an issue.

Happy coding!

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

Unknown

Total

1

Last Release

1033d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31902253491200939ca82e1de87a910323d8300de0835186d2eb44b15971509e?d=identicon)[PB-TommyShelby](/maintainers/PB-TommyShelby)

---

Top Contributors

[![PB-TommyShelby](https://avatars.githubusercontent.com/u/138579051?v=4)](https://github.com/PB-TommyShelby "PB-TommyShelby (91 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/peaky-blind3rs-ip-address-interface/health.svg)

```
[![Health](https://phpackages.com/badges/peaky-blind3rs-ip-address-interface/health.svg)](https://phpackages.com/packages/peaky-blind3rs-ip-address-interface)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[eliashaeussler/typo3-solver

Extension for TYPO3 CMS to extend TYPO3's exception handling with AI generated solutions

292.1k](/packages/eliashaeussler-typo3-solver)

PHPackages © 2026

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