PHPackages                             ip-api-io/ipapi-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. ip-api-io/ipapi-php

ActiveLibrary[API Development](/categories/api)

ip-api-io/ipapi-php
===================

Official PHP client for ip-api.io — IP geolocation, email validation, fraud detection and risk scoring API

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.1CI failing

Since Jun 14Pushed 1mo agoCompare

[ Source](https://github.com/ip-api-io/ipapi-php)[ Packagist](https://packagist.org/packages/ip-api-io/ipapi-php)[ Docs](https://ip-api.io)[ RSS](/packages/ip-api-io-ipapi-php/feed)WikiDiscussions main Synced 1w ago

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

ip-api-io/ipapi-php — Official PHP client for [ip-api.io](https://ip-api.io)
============================================================================

[](#ip-api-ioipapi-php--official-php-client-for-ip-apiio)

[![Packagist](https://camo.githubusercontent.com/87b410cef08a17342e9b8a0fd4e5f1e7f848867e87d5c7fe2cfa9176d441b26c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69702d6170692d696f2f69706170692d706870)](https://packagist.org/packages/ip-api-io/ipapi-php)[![test](https://github.com/ip-api-io/ipapi-php/actions/workflows/test.yml/badge.svg)](https://github.com/ip-api-io/ipapi-php/actions/workflows/test.yml)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

The official PHP client for the [ip-api.io](https://ip-api.io) IP intelligence platform. One client covers [IP geolocation](https://ip-api.io/what-is-my-ip), [email validation](https://ip-api.io/email-validation) and [verification](https://ip-api.io/email-verification-api)(syntax, MX, SMTP deliverability), [fraud detection](https://ip-api.io/fraud-detection-api)and [risk scoring](https://ip-api.io/risk-score), [VPN](https://ip-api.io/vpn-detection-api)/[proxy](https://ip-api.io/proxy-detection-api)/[Tor detection](https://ip-api.io/tor-detection), [disposable email detection](https://ip-api.io/disposable-email-checker), [ASN lookup](https://ip-api.io/asn-lookup), [WHOIS](https://ip-api.io/whois-lookup), [reverse DNS](https://ip-api.io/reverse-dns-lookup), [MX records](https://ip-api.io/mx-record-lookup) and [domain age](https://ip-api.io/domain-age-checker).

Zero Composer dependencies — just `ext-curl` and `ext-json`.

Install
-------

[](#install)

```
composer require ip-api-io/ipapi-php
```

Quickstart
----------

[](#quickstart)

```
use IpApiIo\Client;

$client = new Client(apiKey: 'YOUR_API_KEY'); // free key at https://ip-api.io

// Where is this IP, and is it risky?
$info = $client->lookup('8.8.8.8');
echo $info['location']['country'];               // "United States"
var_dump($info['suspicious_factors']['is_vpn']);  // false

$risk = $client->riskScore('8.8.8.8');
echo "{$risk['score']} {$risk['risk_level']}";    // 0 low

$email = $client->validateEmail('user@example.com');
echo $email['reachable'];                          // "yes"
```

An API key is required — the API rejects keyless requests with `401`. Sign up at [ip-api.io](https://ip-api.io) for a free key.

Documentation
-------------

[](#documentation)

Each guide documents the methods for one capability, with runnable examples and a link to the matching ip-api.io product page:

- **[IP geolocation &amp; bulk lookup](docs/ip-geolocation.md)** — `lookup`, `lookupBatch`
- **[Email validation &amp; verification](docs/email-validation.md)** — `emailInfo`, `validateEmail`, `validateEmailBatch`
- **[Fraud detection &amp; risk scoring](docs/fraud-risk-scoring.md)** — `riskScore`, `emailRiskScore`, `ipReputation`
- **[VPN, proxy &amp; Tor detection](docs/vpn-proxy-tor.md)** — `torCheck`, `suspicious_factors`
- **[ASN &amp; DNS lookups](docs/asn-and-dns.md)** — `asn`, `whois`, `reverseDns`, `forwardDns`, `mxRecords`
- **[Domain age checker](docs/domain-age.md)** — `domainAge`, `domainAgeBatch`
- **[Errors, rate limits &amp; usage](docs/error-handling.md)** — exception types, `rateLimit`, `usageSummary`

Methods
-------

[](#methods)

Every method maps to one ip-api.io endpoint and its product page:

MethodEndpointProduct page`lookup(?string $ip = null)``GET /api/v1/ip[/{ip}]`[IP geolocation](https://ip-api.io/what-is-my-ip)`lookupBatch(array $ips)``POST /api/v1/ip/batch` (≤100 IPs)[Bulk IP lookup](https://ip-api.io/bulk-ip-lookup)`emailInfo(string $email)``GET /api/v1/email/{email}`[Email validation](https://ip-api.io/email-validation)`validateEmail(string $email)``GET /api/v1/email/advanced/{email}`[Advanced email validation](https://ip-api.io/advanced-email-validation)`validateEmailBatch(array $emails)``POST /api/v1/email/advanced/batch` (≤100)[Email list cleaning](https://ip-api.io/email-list-cleaning)`riskScore(?string $ip = null)``GET /api/v1/risk-score[/{ip}]`[Risk score](https://ip-api.io/risk-score)`emailRiskScore(string $email)``GET /api/v1/risk-score/email/{email}`[Fraud detection](https://ip-api.io/fraud-detection-api)`ipReputation(string $ip)``GET /api/v1/ip-reputation/{ip}`[IP reputation](https://ip-api.io/ip-reputation)`torCheck(string $ip)``GET /api/v1/tor/{ip}`[Tor detection](https://ip-api.io/tor-detection)`asn(string $ip)``GET /api/v1/asn/{ip}`[ASN lookup](https://ip-api.io/asn-lookup)`whois(string $domain)``GET /api/v1/dns/whois/{domain}`[WHOIS lookup](https://ip-api.io/whois-lookup)`reverseDns(string $ip)``GET /api/v1/dns/reverse/{ip}`[Reverse DNS](https://ip-api.io/reverse-dns-lookup)`forwardDns(string $hostname)``GET /api/v1/dns/forward/{hostname}`—`mxRecords(string $domain)``GET /api/v1/dns/mx/{domain}`[MX record lookup](https://ip-api.io/mx-record-lookup)`domainAge(string $domain)``GET /api/v1/domain/age/{domain}`[Domain age checker](https://ip-api.io/domain-age-checker)`domainAgeBatch(array $domains)``POST /api/v1/domain/age/batch`[Domain age checker](https://ip-api.io/domain-age-checker)`rateLimit()``GET /api/v1/ratelimit`—`usageSummary()``GET /api/v1/usage/summary`—All methods return parsed JSON as associative arrays.

Error handling
--------------

[](#error-handling)

The client throws typed exceptions and **never retries** — on `429`, `RateLimitError::$reset` tells you when your quota renews:

```
use IpApiIo\AuthenticationError;
use IpApiIo\RateLimitError;

try {
    $client->lookup('8.8.8.8');
} catch (RateLimitError $e) {
    echo "limit={$e->limit} remaining={$e->remaining} resets_at={$e->reset}";
} catch (AuthenticationError $e) {
    echo 'invalid API key';
}
```

See [docs/error-handling.md](docs/error-handling.md) for the full exception taxonomy.

Links
-----

[](#links)

- Full tutorial:
- Website:
- API reference:
- OpenAPI spec:
- Get a free API key:

---

`ip-api-io/ipapi-php` is the official client for [ip-api.io](https://ip-api.io). It is not affiliated with ip-api.com or ipapi.com.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

46d ago

### Community

Maintainers

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

---

Tags

asnemail-validationfraud-detectiongeoipip-apiip-geolocationvpn-detectionwhoisgeoipwhoisfraud detectionIP APIip geolocationemail validationvpn detectiontor detectionrisk-scoreasn lookup

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ip-api-io-ipapi-php/health.svg)

```
[![Health](https://phpackages.com/badges/ip-api-io-ipapi-php/health.svg)](https://phpackages.com/packages/ip-api-io-ipapi-php)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP PHP API

2.5k92.0M380](/packages/geoip2-geoip2)[fingerprint/fingerprint-pro-server-api-sdk

Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.

33274.4k1](/packages/fingerprint-fingerprint-pro-server-api-sdk)[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)

PHPackages © 2026

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