PHPackages                             ip2location/ipinfodb-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ip2location/ipinfodb-php

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

ip2location/ipinfodb-php
========================

Library to query geolocation information from IPInfoDB free API service.

1.0.0(4y ago)1359611MITPHPPHP &gt;=7.2

Since Jun 4Pushed 2y ago1 watchersCompare

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/94379d176f5c855e2852cfc00e69fbdd6121daa1281ef7d703f7985d80f0fe0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6970326c6f636174696f6e2f6970696e666f64622d7068702e737667)](https://packagist.org/packages/ip2location/ipinfodb-php)[![Total Downloads](https://camo.githubusercontent.com/3826d527f7ba0277687265756c8cf412eea27a5b896a2bbce88a7f64cd114067/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6970326c6f636174696f6e2f6970696e666f64622d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ip2location/ipinfodb-php)

IPInfoDB PHP
============

[](#ipinfodb-php)

This IPInfoDB PHP class provides a fast lookup of country, region, city, latitude, longitude, ZIP code and time zone as values. The IPInfoDB web service is designed for server-to-server call.

This library can be used in many types of projects such as:

- Locate where is your website visitors come from
- Analyze your web server logs to determine the countries of your visitors
- Country blocker
- Page redirection according to country
- Geotargeting in advertisement

IPInfoDB free API uses the geolocation data from [IP2Location LITE database](https://lite.ip2location.com). IP2Location Commercial version provides higher accuracy is available at  with no rate limit.

Methods
-------

[](#methods)

Below are the methods supported in this class.

Method NameDescriptiongetCountryReturn country code and country name information of the IP address.getCityReturn city information of the IP address, such as region, city, latitude, longitude, ZIP Code and time zone.FAQ
---

[](#faq)

#### How to I get the API key?

[](#how-to-i-get-the-api-key)

Please register your API key at .

#### Is there any restriction for using this web service?

[](#is-there-any-restriction-for-using-this-web-service)

There is a rate limit of 2 queries per second.

Copyright
=========

[](#copyright)

Copyright (C) 2021 - 2024 by IPInfoDB.com,

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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

1809d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

geolocationgeolocation-apigeolocation-databaseip-address-apiip-address-lookupip2locationipinfodbipinfodb-phpgeolocationzip codetime zoneip2locationip2locationlitearea codeispmccip geolocationmncusage type

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ip2location/ip2location-php

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

2133.9M33](/packages/ip2location-ip2location-php)[torann/geoip

Support for multiple Geographical Location services.

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

Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.

83516.9k1](/packages/ip2location-ip2location-laravel)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)[anthonymartin/geo-location

Powerful GeoCoding library: Retrieve bounding box coordinates, distances between geopoints, point in polygon, get longitude and latitude from addresses and more with GeoLocation for PHP

196949.5k5](/packages/anthonymartin-geo-location)[atchondjo/geoip2country

A lightweight but powerful IP address lookup database solution to determine visitors country

344.1k](/packages/atchondjo-geoip2country)

PHPackages © 2026

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