PHPackages                             ip2geo-dev/sdk - 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. ip2geo-dev/sdk

ActiveLibrary[API Development](/categories/api)

ip2geo-dev/sdk
==============

Official PHP SDK for Ip2Geo - IP to Geolocation API

v0.0.1(3mo ago)11proprietaryPHP ^8.0

Since Apr 19Compare

[ Source](https://github.com/ip2geo/php-sdk)[ Packagist](https://packagist.org/packages/ip2geo-dev/sdk)[ Docs](https://ip2geo.dev)[ RSS](/packages/ip2geo-dev-sdk/feed)WikiDiscussions Synced 3w ago

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

 [ ![Ip2Geo Logo](https://camo.githubusercontent.com/a796f4432d6695d4c6e3e053407f7d52a57f03e2188de285159da7e0c7f2d125/68747470733a2f2f63646e2d70726f642e69703267656f2e6465762f6173736574732f707974686f6e2f67656e6572616c732f69703267656f2e737667) ](https://ip2geo.dev)

 Your go-to IP-to-Geo cloud service — fast, accurate, and built for developers. Start free with 1,000 monthly stored conversions.

 [**Website**](https://ip2geo.dev) • [**Dashboard**](https://app.ip2geo.dev) • [**Documentation**](https://docs.ip2geo.dev) • [**Services Status**](https://status.ip2geo.dev)

Intro to the PHP SDK
--------------------

[](#intro-to-the-php-sdk)

This package provides a lightweight, zero-dependency way to integrate Ip2Geo into your PHP applications.

### Requirements

[](#requirements)

- PHP 8.0 or higher
- ext-curl
- ext-json

### Installing

[](#installing)

```
composer require ip2geo-dev/sdk
```

### Initializing

[](#initializing)

```
use Ip2Geo\Ip2Geo;

Ip2Geo::init('your-api-key');
```

You may also pass options:

```
Ip2Geo::init('your-api-key', [
    'version_update_message' => true,
    'cache'                  => true,
    'cache_max_size'         => 1000,
    'cache_ttl'              => 300,
]);
```

### Using

[](#using)

```
use Ip2Geo\Ip2Geo;

$convertedIp = Ip2Geo::convertIp('8.8.8.8');

$convertedIps = Ip2Geo::convertIps([
    '8.8.8.8',
    '1.1.1.1',
    '9.9.9.9',
    '64.6.64.6',
]);

// [
//     'success' => true,
//     'code'    => 200,
//     'message' => 'Success',
//     'data'    => [ ... ],
//     '_req'    => [
//         'reqId'   => 'string',
//         'resTime' => 123,
//     ],
// ]
```

### Retrieving conversions

[](#retrieving-conversions)

```
$conversion  = Ip2Geo::getConversion('conversion-id');
$conversions = Ip2Geo::getConversions(['id-a', 'id-b']);
$list        = Ip2Geo::listConversions(0, 50);
```

### Selecting fields

[](#selecting-fields)

```
$conversion = Ip2Geo::getConversion('conversion-id', [
    Ip2Geo::SELECT['IP'],
    Ip2Geo::SELECT['COUNTRY_NAME'],
]);
```

### Validating an IP

[](#validating-an-ip)

```
$result = Ip2Geo::ipValidation('8.8.8.8');
// ['ip4' => true, 'ip6' => false]
```

Features
--------

[](#features)

- Zero runtime dependencies (uses PHP built-ins only)
- Static facade — no instantiation required
- Built-in LRU cache with configurable size and TTL
- IPv4 and IPv6 validation
- Mirrors the official Python SDK behavior

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

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

96d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/240383190?v=4)[Ip2Geo](/maintainers/ip2geo)[@ip2geo](https://github.com/ip2geo)

---

Tags

geoipgeolocationIPgeoip2geoip-to-geo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ip2geo-dev-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/ip2geo-dev-sdk/health.svg)](https://phpackages.com/packages/ip2geo-dev-sdk)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP PHP API

2.5k92.0M379](/packages/geoip2-geoip2)[ipip/db

IPIP.net officially supported IP database ipdb format parsing library

139208.9k6](/packages/ipip-db)[maxh/php-nominatim

Wrapper for Nominatim API

51411.1k2](/packages/maxh-php-nominatim)[ipip/datx

IPIP.net官方支持的IP数据库datx格式解析库

3731.5k1](/packages/ipip-datx)[ipgeolocation/ipgeolocation-php-sdk

Official PHP SDK for the IPGeolocation.io IP Location API with single and bulk lookup support.

424.8k](/packages/ipgeolocation-ipgeolocation-php-sdk)[jbohme/nominatim-laravel

Wrapper for Nominatim API to Laravel

1241.2k](/packages/jbohme-nominatim-laravel)

PHPackages © 2026

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