PHPackages                             apiip/apiip.net - 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. apiip/apiip.net

ActiveLibrary[API Development](/categories/api)

apiip/apiip.net
===============

The official PHP library for apiip.net that allowing customers to automate IP address validation and geolocation lookup in websites, applications and back-office system. Visit our API docs at https://apiip.net/documentation

v1.2.0(2y ago)012.9k↓42.9%1Apache-2.0PHPPHP &gt;=7.4

Since Feb 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Apiipnet/php-apiip.net)[ Packagist](https://packagist.org/packages/apiip/apiip.net)[ RSS](/packages/apiip-apiipnet/feed)WikiDiscussions master Synced 1mo ago

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

IP to Location (PHP)
====================

[](#ip-to-location-php)

[![apiip.net website status](https://camo.githubusercontent.com/fb3cfe4a3cbb060b755e1a1c219567e1d70c73f752166b8ff46dad468e4a2479/68747470733a2f2f696d672e736869656c64732e696f2f776562736974653f646f776e5f636f6c6f723d72656426646f776e5f6d6573736167653d6f66666c696e65266c6162656c3d61706969702e6e6574253230776562736974652675705f636f6c6f723d737563636573732675705f6d6573736167653d6f6e6c696e652675726c3d687474707325334125324625324661706969702e6e6574253246) ](https://apiip.net)[![Uptime Robot status](https://camo.githubusercontent.com/41b4fca50692484a063c1975beb039cde042117d6edb8b9e01e32b8fc8be48cc/68747470733a2f2f696d672e736869656c64732e696f2f757074696d65726f626f742f7374617475732f6d3738393837393232392d3136666136363238393438373437306537353434643538613f6c6162656c3d415049253230737461747573)](https://status.apiip.net/)[![Uptime Robot ratio (30 days)](https://camo.githubusercontent.com/fadc8ff5e432e26d1e7c2da164e9edc829f24dcf222b391f5ece2526600dd7e5/68747470733a2f2f696d672e736869656c64732e696f2f757074696d65726f626f742f726174696f2f6d3738393837393232392d3136666136363238393438373437306537353434643538613f6c6162656c3d415049253230757074696d65253230253238333025323064617973253239)](https://status.apiip.net/)[![GitHub issues](https://camo.githubusercontent.com/71c4a6d9691c8703e3d4d43c8a8cf33d4acddc426e94614a7b6bc373259293e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f41706969706e65742f7068702d61706969702e6e6574)](https://camo.githubusercontent.com/71c4a6d9691c8703e3d4d43c8a8cf33d4acddc426e94614a7b6bc373259293e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d7261772f41706969706e65742f7068702d61706969702e6e6574)[![GitHub code size in bytes](https://camo.githubusercontent.com/a68cf01c4032ee62311579366e827cd59dd1185a7cb24286964b2f809443c329/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f41706969706e65742f7068702d61706969702e6e6574)](https://camo.githubusercontent.com/a68cf01c4032ee62311579366e827cd59dd1185a7cb24286964b2f809443c329/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f41706969706e65742f7068702d61706969702e6e6574)[![GitHub top language](https://camo.githubusercontent.com/ca9f68215a39d1da2cef669d628a0b723c82e4efc214f154067cfbae61c2fb17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f61706969706e65742f7068702d61706969702e6e6574)](https://camo.githubusercontent.com/ca9f68215a39d1da2cef669d628a0b723c82e4efc214f154067cfbae61c2fb17/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f61706969706e65742f7068702d61706969702e6e6574)

This is the official PHP client library for the [apiip.net](https://apiip.net) IP address geolocation API, allowing you to lookup your own IP address, or get any of the details for an IP.

Find geolocation data from IP addresses (e.g. city, country, lat/long) using the apiip.net API.

apiip.net provides 1.000 free requests per month. For higher plans, check out the [website](https://apiip.net)

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

[](#installation)

You need to get your API key from here:  and you'll get 1.000 free requests/month

Install the package with:

```
composer require apiip/apiip.net
```

Usage
-----

[](#usage)

The package needs to be configured with your account's API key, which is available in the [apiip.net Dashboard](https://apiip.net/user/dashboard)

```
use ApiipClient\Apiip;

$access_key = 'YOUR_ACCESS_KEY';
$client = new Apiip($access_key);
$details = $client->getLocation();

$details['city'];
Belgrade
```

HTTPS Encryption
----------------

[](#https-encryption)

By default, the SSL/TLS is turned on, if you want to disable it just pass the options parameter

#### Example

[](#example)

```
use ApiipClient\Apiip;

$access_key = 'YOUR_ACCESS_KEY';
$client = new Apiip($access_key, ['ssl' => false]);
```

Configuration
-------------

[](#configuration)

Call getLocation method with config object

```
use ApiipClient\Apiip;

$access_key = 'YOUR_ACCESS_KEY';
$client = new Apiip($access_key);
$details = $client->getLocation([
  'ip' => $ip_address, // 67.250.186.196, 188.79.34.191, 60.138.7.24 - for bulk request
  'output' => 'xml',
  'fields' => 'city,country',
  'languages' => 'es'
]);
```

OptionTypeDescriptionDefault`ip``string`*Optional*. Get location about the specify IP or multiple IPs.Requester IP`output``string`*Optional*. Specify response format, XML or JSON.JSON`fields``string`*Optional*. Specify response fields.All fields`languages``string`*Optional*. Specify response language.ENExample complete response
-------------------------

[](#example-complete-response)

```
{
  "ip": "67.250.186.196",
  "continentCode": "NA",
  "continentName": "North America",
  "countryCode": "US",
  "countryName": "United States",
  "countryNameNative": "United States",
  "city": "New York",
  "postalCode": "10001",
  "latitude": 40.8271,
  "longitude": -73.9359,
  "capital": "Washington D.C.",
  "phoneCode": "1",
  "countryFlagEmoj": "🇺🇸",
  "countryFlagEmojUnicode": "U+1F1FA U+1F1F8",
  "isEu": false,
  "borders": [
    "CAN",
    "MEX"
  ],
  "topLevelDomains": [
    ".us"
  ],
  "languages": {
    "en": {
      "code": "en",
      "name": "English",
      "native": "English"
    }
  },
  "currency": {
    "code": "USD",
    "name": "US Dollar",
    "symbol": "$",
    "number": "840",
    "rates": {
      "EURUSD": 1.11
    }
  },
  "timeZone": {
    "id": "America/New_York",
    "currentTime": "10/26/2021, 2:54:10 PM",
    "code": "EDT",
    "timeZoneName": "EDT",
    "utcOffset": -14400
  },
  "userAgent": {
    "isMobile": false,
    "isiPod": false,
    "isTablet": false,
    "isDesktop": true,
    "isSmartTV": false,
    "isRaspberry": false,
    "isBot": false,
    "browser": "Chrome",
    "browserVersion": "100.0.4896.127",
    "operatingSystem": "Windows 10.0",
    "platform": "Microsoft Windows",
    "source": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36"
  },
  "connection": {
    "asn": 12271,
    "isp": "Charter Communications Inc"
  },
  "security": {
    "isProxy": false,
    "isBogon": false,
    "isTorExitNode": false,
    "isCloud": false,
    "isHosting": false,
    "isSpamhaus": false,
    "suggestion": "allow",
    "network": "67.250.176.0/20"
  }
}
```

More Information
----------------

[](#more-information)

- [API Documentation](https://apiip.net/documentation)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~182 days

Total

5

Last Release

818d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa7395506b8944de61a1b03f9ebc20afc9df70145c8e2a0ab6784cb819da69e8?d=identicon)[apiip](/maintainers/apiip)

---

Top Contributors

[![Vojkan94](https://avatars.githubusercontent.com/u/42473261?v=4)](https://github.com/Vojkan94 "Vojkan94 (6 commits)")[![Apiipnet](https://avatars.githubusercontent.com/u/97898847?v=4)](https://github.com/Apiipnet "Apiipnet (1 commits)")

---

Tags

apiipgeoipgeoip-apiip-dataip-geolocationip-to-locationipaddressphpip2locationIP APIip to locationapiip.netapiipphp geolocationip location apiphp ip locationgeolocate with phpiplocation apiip geolocation api

### Embed Badge

![Health badge](/badges/apiip-apiipnet/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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