PHPackages                             benjamin-smith/php-ipify - 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. [API Development](/categories/api)
4. /
5. benjamin-smith/php-ipify

ActiveLibrary[API Development](/categories/api)

benjamin-smith/php-ipify
========================

PHP client library for ipify: A Simple IP Address API.

1.0.0(10y ago)4713.0k↓50%10MITPHPPHP &gt;=5.3.0

Since Jun 11Pushed 7y ago4 watchersCompare

[ Source](https://github.com/benjamin-smith/php-ipify)[ Packagist](https://packagist.org/packages/benjamin-smith/php-ipify)[ Docs](https://github.com/benjamin-smith/php-ipify)[ RSS](/packages/benjamin-smith-php-ipify/feed)WikiDiscussions master Synced 1mo ago

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

php-ipify
=========

[](#php-ipify)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/ee4206699fc7877f2ba1cfd19ec5e43ba7843d106e7d2c870bbbc7b5449d53b2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62656e6a616d696e2d736d6974682f7068702d69706966792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/benjamin-smith/php-ipify)[![Quality Score](https://camo.githubusercontent.com/7012b50b8d375cf1e21b1e8535b64e474d767a93085ae3c7ee32caf3b35d3b54/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f62656e6a616d696e2d736d6974682f7068702d69706966792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/benjamin-smith/php-ipify)[![Total Downloads](https://camo.githubusercontent.com/ca3f917cf98baafd22e7312f171598431ad95bf8b4c6c631c131674bc515e6b6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62656e6a616d696e2d736d6974682f7068702d69706966792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/benjamin-smith/php-ipify)

This library will retrieve your public IP address from [ipify's API service](https://www.ipify.org/), and return it as a string.

This library also has some other nice features you might care about:

- This library handles exceptions properly, and usage examples below show you how to deal with errors in a foolproof way.
- This library only makes API requests over HTTPS.

Install
-------

[](#install)

Via Composer

```
$ composer require benjamin-smith/php-ipify
```

Usage
-----

[](#usage)

```
echo Ipify\Ip::get();
```

Or, if your inclined to catch any errors:

```
try {
    $ip = Ipify\Ip::get();
} catch (ConnectionError $e) {
    // If you get here, it means you were unable to reach the ipify service,
    // most likely because of a network error on your end.
} catch (ServiceError $e) {
    // If you get here, it means ipify is having issues, so the request
    // couldn't be completed :(
} catch (Exception $e) {
    // Something else happened (non-ipify related).
}
```

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

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)

- [Benjamin Smith](https://github.com/benjaminsmith)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 92.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 ~139 days

Total

3

Last Release

3717d ago

Major Versions

0.1.1 → 1.0.02016-03-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/87b5c3edc9db528238b82272681dcb2051a32fc783e0354408b339bf389bed7d?d=identicon)[benjamin-smith](/maintainers/benjamin-smith)

---

Top Contributors

[![benjamin-smith](https://avatars.githubusercontent.com/u/1483102?v=4)](https://github.com/benjamin-smith "benjamin-smith (12 commits)")[![Oxicode](https://avatars.githubusercontent.com/u/1320709?v=4)](https://github.com/Oxicode "Oxicode (1 commits)")

---

Tags

ipify

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/benjamin-smith-php-ipify/health.svg)

```
[![Health](https://phpackages.com/badges/benjamin-smith-php-ipify/health.svg)](https://phpackages.com/packages/benjamin-smith-php-ipify)
```

###  Alternatives

[razorpay/razorpay

Razorpay PHP Client Library

2024.8M44](/packages/razorpay-razorpay)[pubnub/pubnub

This is the official PubNub PHP SDK repository.

1314.6M17](/packages/pubnub-pubnub)[culqi/culqi-php

Cliente Culqi API para PHP

41356.8k1](/packages/culqi-culqi-php)[ahmadawais/sendy-php-api

Sendy PHP API Wrapper: Complete API interfacing.

8673.5k](/packages/ahmadawais-sendy-php-api)[epayco/epayco-php

Epayco API client for PHP

25187.2k3](/packages/epayco-epayco-php)[yunchuang/appstore-connect-api

sdk for appstore connect api

3865.3k](/packages/yunchuang-appstore-connect-api)

PHPackages © 2026

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