PHPackages                             ip2location/ip2proxy-codeigniter4 - 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. ip2location/ip2proxy-codeigniter4

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

ip2location/ip2proxy-codeigniter4
=================================

IP2Proxy library for CodeIgniter 4. This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges and residential proxies using IP2Proxy BIN database. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats, last seen date and provider names.

1.0.0(2y ago)551MITPHP

Since Nov 28Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ip2location/ip2proxy-codeigniter4)[ Packagist](https://packagist.org/packages/ip2location/ip2proxy-codeigniter4)[ Docs](https://www.ip2location.com)[ RSS](/packages/ip2location-ip2proxy-codeigniter4/feed)WikiDiscussions main Synced 1mo ago

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

IP2Proxy CodeIgniter 4 Library
==============================

[](#ip2proxy-codeigniter-4-library)

This module allows user to reverse search of IP address to detect VPN servers, open proxies, web proxies, Tor exit nodes, search engine robots, data center ranges, residential proxies, consumer privacy networks, and enterprise private networks. Other information available includes proxy type, country, state, city, ISP, domain name, usage type, AS number, AS name, threats, last seen date and provider names.

This library will only work with CodeIgniter 4. For CodeIgniter 3, you can get it from [here](https://github.com/ip2location/codeigniter-ip2proxy).

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

[](#installation)

Upload `Controllers` and `Libraries` to CodeIgniter `app` folder.

Usage
-----

[](#usage)

This module is able to query the IP address information from either BIN database or web service. This section will explain how to use this extension to query from BIN database and web service.

Sample codes are given in this project, under **Controllers** folder. You may run the sample code by using &lt;your\_domain&gt;/index.php/ip2proxy\_test.

### BIN Database

[](#bin-database)

Use following codes in your application for get geolocation information.

```
    // (optional) Define IP2Proxy database path.
    define('IP2PROXY_DATABASE', '/path/to/ip2proxy/database');

    $ipx = new IP2Proxy_lib();
    $countryCode = $ipx->getCountryShort('1.0.241.135');
```

Below are the methods supported for BIN data file lookup.

```
    $countryShort = $ipx->getCountryShort($ip);
    $countryLong = $ipx->getCountryLong($ip);
    $region = $ipx->getRegion($ip);
    $city = $ipx->getCity($ip);
    $isp = $ipx->getISP($ip);
    $doamin = $ipx->getDomain($ip);
    $usageType = $ipx->getUsageType($ip);
    $proxyType = $ipx->getProxyType($ip);
    $asn = $ipx->getASN($ip);
    $as = $ipx->getAS($ip);
    $lastSeen = $ipx->getLastSeen($ip);
    $threat = $ipx->getThreat($ip);
    $provider = $ipx->getProvider($ip);
    $isProxy = $ipx->isProxy($ip);
```

### Web Service

[](#web-service)

Use following codes in your application for get geolocation information.

```
    // (required) Define IP2Proxy API key.
    define('IP2PROXY_API_KEY', 'your_api_key');

    // (required) Define IP2Proxy Web service package of different granularity of return information.
    define('IP2PROXY_PACKAGE', 'PX1');

    // (optional) Define to use https or http.
    define('IP2PROXY_USESSL', false);

    $ipx = new IP2Proxy_lib();
    print_r ($ipx->getWebService('1.0.241.135'));
```

To use IP2Location.io API for getting the geolocation information, you can use the following code to do so:

```
	// (required) Define IP2Location.io API key.
    define('IP2LOCATION_IO_API_KEY', 'your_api_key');

    // (optional) Define Translation information. Refer to https://www.ip2location.io/ip2location-documentation for available languages.
    define('IP2LOCATION_IO_LANGUAGE', 'zh-cn');

    $ipl = new IP2Proxy_lib();
    print_r ($ipl->getWebService('1.0.241.135'));
```

### MySQL Query

[](#mysql-query)

Use following codes in your application for get geolocation information.

```
    define('IP2PROXY_DATABASE_TABLE', 'ip2proxy_table_name');

    $db = model('IP2Proxy_model', false);
    print_r ($db->lookup('1.0.241.135'));
```

Dependencies
------------

[](#dependencies)

This module requires IP2Proxy BIN data file or IP2Proxy API key to function. You may download the BIN data file at

- IP2Proxy LITE BIN Data (Free):
- IP2Proxy Commercial BIN Data (Comprehensive):

You can also sign up for [IP2Proxy Web Service](https://www.ip2location.com/web-service/ip2proxy) or [IP2Location.io IP GEOLOCATION API](https://www.ip2location.io/sign-up) to get one free API key.

IPv4 BIN vs IPv6 BIN
--------------------

[](#ipv4-bin-vs-ipv6-bin)

- Use the IPv4 BIN file if you just need to query IPv4 addresses.
- Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

SUPPORT
-------

[](#support)

Email:

Website:

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance51

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

902d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

codeigniter-ip2proxyip-lookupip2proxy-bin-databaseproxy-informationproxy-lookupweb-serviceproxyweb servicegeolocationip geolocationip-lookupip-databasegeolocation-informationip-address-databaseip2proxy-bin-databasecodeigniter-ip2proxy

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ip2location-ip2proxy-codeigniter4/health.svg)

```
[![Health](https://phpackages.com/badges/ip2location-ip2proxy-codeigniter4/health.svg)](https://phpackages.com/packages/ip2location-ip2proxy-codeigniter4)
```

###  Alternatives

[fideloper/proxy

Set trusted proxies for Laravel

7.3k174.4M559](/packages/fideloper-proxy)[ocramius/proxy-manager

A library providing utilities to generate, instantiate and generally operate with Object Proxies

5.0k82.4M230](/packages/ocramius-proxy-manager)[symfony/var-exporter

Provides tools to export, instantiate, hydrate, clone and lazy-load PHP objects

2.1k378.1M441](/packages/symfony-var-exporter)[friendsofphp/proxy-manager-lts

Adding support for a wider range of PHP versions to ocramius/proxy-manager

1.2k139.1M104](/packages/friendsofphp-proxy-manager-lts)[torann/geoip

Support for multiple Geographical Location services.

2.2k14.2M76](/packages/torann-geoip)[ip2location/ip2location-php

\[Official Release\] IP2Location PHP API to get location info from IPv4 and IPv6 address.

2133.9M33](/packages/ip2location-ip2location-php)

PHPackages © 2026

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