PHPackages                             whoisjson/whoisjson - 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. whoisjson/whoisjson

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

whoisjson/whoisjson
===================

A PHP client for the WhoisJSON API - Get WHOIS, DNS, and SSL certificate information in JSON format

v1.0.0(11mo ago)0181MITPHP &gt;=7.4

Since May 30Pushed 11mo agoCompare

[ Source](https://github.com/Whoisjson/whoisjson-php-client)[ Packagist](https://packagist.org/packages/whoisjson/whoisjson)[ RSS](/packages/whoisjson-whoisjson/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

WhoisJson PHP Package
=====================

[](#whoisjson-php-package)

A PHP wrapper for the [WhoisJSON API](https://whoisjson.com) - Get WHOIS, DNS, and SSL certificate information in JSON format.

Free accounts include 500 requests per month. [Check out our full documentation](https://whoisjson.com/documentation) for more details about our API.

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

[](#installation)

```
composer require whoisjson/whoisjson
```

Usage
-----

[](#usage)

First, [sign up for a free API key](https://whoisjson.com/signup) to get started with 500 monthly requests.

```
use WhoisJson\WhoisJsonClient;

// Initialize the client
$whois = new WhoisJsonClient('YOUR_API_KEY');

try {
    // WHOIS lookup
    $whoisInfo = $whois->whois('example.com');
    print_r($whoisInfo);

    // DNS lookup
    $dnsInfo = $whois->nslookup('example.com');
    print_r($dnsInfo);

    // SSL certificate info
    $sslInfo = $whois->sslCertCheck('example.com');
    print_r($sslInfo);
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}
```

Response Examples
-----------------

[](#response-examples)

### WHOIS Lookup Response

[](#whois-lookup-response)

```
[
    'server' => 'gamma',
    'name' => 'example.com',
    'idnName' => 'example.com',
    'status' => [
        'clientDeleteProhibited',
        'clientTransferProhibited'
    ],
    'nameserver' => [
        'dns1.example.com',
        'dns2.example.com'
    ],
    'ips' => '93.184.216.34',
    'created' => '1995-08-14T04:00:00Z',
    'changed' => '2024-02-14T08:00:00Z',
    'expires' => '2025-08-13T04:00:00Z',
    'registered' => true,
    'dnssec' => 'signedDelegation',
    'whoisserver' => 'whois.example.com',
    'contacts' => [
        'owner' => [[
            'handle' => 'REDACTED FOR PRIVACY',
            'name' => 'REDACTED FOR PRIVACY',
            'email' => 'REDACTED FOR PRIVACY',
            'country' => 'US'
        ]]
    ],
    'registrar' => [
        'id' => '123',
        'name' => 'Example Registrar, Inc.',
        'email' => 'support@example.com',
        'url' => 'https://example.com',
        'phone' => '+1.2345678900'
    ]
]
```

### NSLookup Response

[](#nslookup-response)

```
[
    'domain' => 'example.com',
    'records' => [
        'a' => ['93.184.216.34'],
        'aaaa' => ['2606:2800:220:1:248:1893:25c8:1946'],
        'mx' => [
            [
                'priority' => 10,
                'exchange' => 'mail.example.com'
            ]
        ],
        'ns' => [
            'ns1.example.com',
            'ns2.example.com'
        ],
        'txt' => ['v=spf1 include:_spf.example.com ~all'],
        'soa' => [
            'mname' => 'ns1.example.com',
            'rname' => 'hostmaster.example.com',
            'serial' => 2024021401,
            'refresh' => 7200,
            'retry' => 3600,
            'expire' => 1209600,
            'minimum' => 3600
        ]
    ]
]
```

### SSL Certificate Response

[](#ssl-certificate-response)

```
[
    'domain' => 'example.com',
    'valid' => true,
    'issuer' => [
        'organization' => "Let's Encrypt",
        'commonName' => 'R3',
        'countryName' => 'US'
    ],
    'subject' => [
        'commonName' => 'example.com'
    ],
    'validFrom' => '2024-01-01T00:00:00Z',
    'validTo' => '2024-04-01T00:00:00Z',
    'serialNumber' => '123456789',
    'version' => 3,
    'signatureAlgorithm' => 'SHA256withRSA',
    'subjectAlternativeNames' => [
        'example.com',
        'www.example.com'
    ]
]
```

API Reference
-------------

[](#api-reference)

### `new WhoisJsonClient($apiKey, $baseUrl = 'https://whoisjson.com/api/v1')`

[](#new-whoisjsonclientapikey-baseurl--httpswhoisjsoncomapiv1)

Creates a new WhoisJson client instance.

#### Parameters

[](#parameters)

- `$apiKey` (string): Your WhoisJSON API key
- `$baseUrl` (string, optional): Custom API base URL

### `whois($domain)`

[](#whoisdomain)

Get WHOIS information for a domain.

#### Parameters

[](#parameters-1)

- `$domain` (string): The domain name to lookup

#### Returns

[](#returns)

Array containing the WHOIS information.

### `nslookup($domain)`

[](#nslookupdomain)

Get DNS records for a domain.

#### Parameters

[](#parameters-2)

- `$domain` (string): The domain name to lookup

#### Returns

[](#returns-1)

Array containing the DNS records information.

### `sslCertCheck($domain)`

[](#sslcertcheckdomain)

Get SSL certificate information for a domain.

#### Parameters

[](#parameters-3)

- `$domain` (string): The domain name to check

#### Returns

[](#returns-2)

Array containing the SSL certificate information.

Error Handling
--------------

[](#error-handling)

The package throws exceptions in the following cases:

- Invalid API key
- Invalid domain name
- API rate limit exceeded
- Network errors
- Other API errors

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- GuzzleHttp 7.0 or higher
- ext-json

License
-------

[](#license)

MIT

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance50

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

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

354d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a3c5fe6eef97c3c18a294af993dce827807e285a8ce5172aa076a7915317741?d=identicon)[whoisjson](/maintainers/whoisjson)

---

Tags

phpwhoiswhois-client

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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