PHPackages                             ip2geo/ip2geo-php - 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/ip2geo-php

ActiveLibrary[API Development](/categories/api)

ip2geo/ip2geo-php
=================

Official PHP SDK for the Ip2Geo API

1.0.0(6mo ago)11MITPHPPHP &gt;=7.4

Since Dec 24Pushed 6mo agoCompare

[ Source](https://github.com/vijaykrpp/ip2geo-php)[ Packagist](https://packagist.org/packages/ip2geo/ip2geo-php)[ RSS](/packages/ip2geo-ip2geo-php/feed)WikiDiscussions main Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

ip2geo — PHP SDK
================

[](#ip2geo--php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/6fe1d49b05360244f3c9ed8e085cbbad3859546aed777e9c397a4e2da84a2b47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69703267656f2f69703267656f2d706870)](https://packagist.org/packages/ip2geo/ip2geo-php)[![Total Downloads](https://camo.githubusercontent.com/3adaaccbaf4a3dd3487f97ea93fbc0e9c18461183066b4a49c80f0576e5b8abc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69703267656f2f69703267656f2d706870)](https://packagist.org/packages/ip2geo/ip2geo-php)[![License](https://camo.githubusercontent.com/81c155b260c4c23f8ca9b5ee21f0635e6ffac015a2be43d4fe064822497fd584/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f69703267656f2f69703267656f2d706870)](https://packagist.org/packages/ip2geo/ip2geo-php)[![PHP Version](https://camo.githubusercontent.com/6eeb5897aa125b845bee558827391d7dafc19ebd1f810409f58a95416865ec32/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f69703267656f2f69703267656f2d706870)](https://packagist.org/packages/ip2geo/ip2geo-php)[![Repo Size](https://camo.githubusercontent.com/56ee5428f9877affe922a01d36ff2b535fa388e2a7cb346c9c6c899c23480117/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f76696a61796b7270702f69703267656f2d706870)](https://github.com/vijaykrpp/ip2geo/ip2geo-php)

Official PHP SDK for the **Ip2Geo API** — fast IP geolocation, network intelligence, and security risk detection.

---

🚀 Get an API Key (Free)
-----------------------

[](#-get-an-api-key-free)

You need an API key to use Ip2Geo.

👉 **Get your free API key here:**

### Free plan includes

[](#free-plan-includes)

- ✅ **100,000 requests / month**
- ✅ **No credit card required**
- ✅ Full access to **security intelligence data**
- ✅ Instant activation

---

🧠 Why Ip2Geo?
-------------

[](#-why-ip2geo)

- Most IP data providers:
    - Charge extra for security fields
    - Require credit cards upfront
    - Hide important data behind higher tiers
    - Ip2Geo provides security intelligence by default, even on the free plan.

✨ Features
----------

[](#-features)

- 🌍 Accurate IP geolocation (country, city, timezone, ISP)
- 🛡️ **Security intelligence included**:
    - VPN detection
    - Proxy detection
    - TOR detection
    - Hosting / ASN classification
    - Trust score &amp; risk level
- ⚡ Fast global API
- 📦 Simple, lightweight PHP SDK
- 🔓 No hidden paid-only fields (others charge extra for security data)

---

📦 Installation
--------------

[](#-installation)

```
composer require ip2geo/ip2geo-php
```

Quick Start
-----------

[](#quick-start)

```

```

### Lookup your IP

[](#lookup-your-ip)

```

```

API Response
------------

[](#api-response)

```
{
  "success": true,
  "ip": "8.8.8.8",
  "version": "ipv4",
  "geo": {
    "city": "Chicago",
    "country": "United States",
    "countryCode": "US",
    "region": null,
    "regionCode": null,
    "latitude": 37.751,
    "longitude": -97.822,
    "postalCode": null,
    "geonameId": 6252001,
    "accuracyRadius": 1000,
    "metroCode": null,
    "continentName": "North America",
    "continentCode": "NA",
    "isEuMember": false
  },
  "countryInfo": {
    "name": "United States of America",
    "alpha2Code": "US",
    "alpha3Code": "USA",
    "flag": "https://api.ip2geoapi.com/assets/flags/us.svg",
    "callingCodes": [
      "1"
    ],
    "currencies": [
      {
        "code": "USD",
        "name": "United States dollar",
        "symbol": "$"
      }
    ],
    "languages": [
      {
        "iso639_1": "en",
        "iso639_2": "eng",
        "name": "English",
        "nativeName": "English"
      }
    ]
  },
  "timezoneInfo": {
    "timezone": "America/Chicago",
    "utcOffsetSeconds": -21600,
    "utcOffsetText": "-06:00",
    "utcOffsetHours": -6,
    "isDst": false,
    "abbreviation": "CST",
    "localTime": "2025-12-22T21:46:07-06:00"
  },
  "network": {
    "cidr": "8.8.8.8/32",
    "prefixLen": 32,
    "asn": 15169,
    "asFormatted": "AS15169",
    "asName": "GOOGLE",
    "isp": "Google",
    "organization": "Google",
    "connectionType": "Corporate",
    "mobile": {
      "mcc": null,
      "mnc": null
    }
  },
  "asDetails": {
    "asn": 15169,
    "abuser_score": "0.001 (Low)",
    "descr": "GOOGLE, US",
    "country": "us",
    "active": true,
    "org": "Google LLC",
    "domain": "google.com",
    "abuse": "network-abuse@google.com",
    "type": "hosting",
    "created": "2000-03-30",
    "updated": "2012-02-24",
    "rir": "ARIN"
  },
  "security": {
    "isHosting": true,
    "isProxy": false,
    "proxyType": null,
    "isVpn": false,
    "vpnProvider": null,
    "vpnProviderUrl": null,
    "isTor": false,
    "isAnonymous": true,
    "trustScore": 65,
    "riskLevel": "medium"
  }
}
```

📄 Response Formats
------------------

[](#-response-formats)

### JSON (default)

[](#json-default)

```
$data = $client->lookup("8.8.8.8");
```

### YAML

[](#yaml)

```
$data = $client->lookup("8.8.8.8", [
    "format" => "yml"
]);
```

### XML

[](#xml)

```
$data = $client->lookup("8.8.8.8", [
    "format" => "xml"
]);
```

### JSONP Callbacks

[](#jsonp-callbacks)

```
$data = $client->lookup("8.8.8.8", [
    "format" => "jsonp",
    "callback" => "cbFunction"
]);
```

Parameter Reference
-------------------

[](#parameter-reference)

ParameterTypeRequiredAccepted ValuesDescription`ip``str`Yes\*IPv4 / IPv6IP address to lookup. If `check`, your **own IP** is detected automatically.`format``str`Optional`json` (default), `xml`, `yml`, `jsonp`Response format. Defaults to JSON.`callback``str`OptionalAlphanumeric + `_` (max 64 chars)JSONP callback function name. **Only valid when `format="jsonp"`**.📘 Documentation
---------------

[](#-documentation)

Full API documentation and field reference:

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance68

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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 ~1 days

Total

2

Last Release

189d ago

Major Versions

v0.1.0 → 1.0.02025-12-26

### Community

Maintainers

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

---

Top Contributors

[![vijaykrpp](https://avatars.githubusercontent.com/u/32255903?v=4)](https://github.com/vijaykrpp "vijaykrpp (8 commits)")

---

Tags

fraud-detectionipip-geolocation-apiip-infoip-intelligenceip-lookupip-phpipapiiplocationiplookupproxy-detectiontor-detectionvpn-detection

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k14](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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