PHPackages                             juanparati/rdap-lib - 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. juanparati/rdap-lib

ActiveLibrary[API Development](/categories/api)

juanparati/rdap-lib
===================

A PHP RDAP client library

2.1(5y ago)69.4k↓54.4%3[1 PRs](https://github.com/juanparati/RDAPLib/pulls)MITPHPPHP &gt;=7.4CI failing

Since Oct 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/juanparati/RDAPLib)[ Packagist](https://packagist.org/packages/juanparati/rdap-lib)[ RSS](/packages/juanparati-rdap-lib/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)Dependencies (4)Versions (8)Used By (0)

[![](https://camo.githubusercontent.com/dffccb244ab4f1f6ad3e5b1b6c86d367622aeb4be23a04effcd1a4177036cdad/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6a75616e7061726174692f524441504c69622e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/dffccb244ab4f1f6ad3e5b1b6c86d367622aeb4be23a04effcd1a4177036cdad/68747470733a2f2f6170692e7472617669732d63692e636f6d2f6a75616e7061726174692f524441504c69622e7376673f6272616e63683d6d6173746572)

RDAPLib
=======

[](#rdaplib)

About
-----

[](#about)

RDAPLib is a Registration Data Access Protocol (RDAP) client library that query and resolve results into models, arrays or standard objects (stdObject).

This library uses [Guzzle](http://docs.guzzlephp.org/en/stable/) as default http client, however is possible to inject any custom HTTP client that is compliant with [PSR-18](https://www.php-fig.org/psr/psr-18/).

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

[](#installation)

```
composer require juanparati/rdap-lib "^2.0"

```

You may also require Guzzle 7 in case that you don't want to inject PSR-18 compliant client:

```
composer require guzzlehttp/guzzle "^7.0.1"

```

Usage
-----

[](#usage)

### Basic example

[](#basic-example)

```
$rdap = new \Juanparati\RDAPLib\RDAPClient();

$ip        = $rdap->ipLookup('94.234.38.5');
$domain    = $rdap->domainLookup('google.com');
$tld       = $rdap->tldLookup('io');
$entity    = $rdap->entityLookup('APL7-ARIN')
$as        = $rdap->asLookup(1);
$registrar = $rdap->registrarLookup(1);

```

### Output formats

[](#output-formats)

RDAPClient map the result into models, however is possible to return the results using the following types:

- RAW\_OUTPUT (JSON string)
- ARRAY\_OUTPUT (Nested array)
- OBJECT\_OUTPUT (stdClass)
- MODEL\_OUTPUT

The "lookups" method accept a secondary parameter where to specify the format.

Example:

```
 $rdap = new \Juanparati\RDAPLib\RDAPClient();

 $ip     = $rdap->ipLookup('94.234.38.5', \Juanparati\RDAPLib\RDAPClient\RAW_OUTPUT);
 $domain = $rdap->domainLookup('google.com', \Juanparati\RDAPLib\RDAPClient\ARRAY_OUTPUT);
 $tld    = $rdap->tldLookup('io', \Juanparati\RDAPLib\RDAPClient\OBJECT_OUTPUT);
 $entity = $rdap->entityLookup('APL7-ARIN')   // Default output is MODEL_OUTPUT

```

### Model format

[](#model-format)

The model format is suitable when data accessors or extra parameters are required. RDAPClient provides defaults models that are possible to replace. The models are based on [RFC-7483](https://tools.ietf.org/html/rfc7483).

For example the default method for "vcardArray" provides a method that can parse jCard format.

Example:

```
$rdap = new \Juanparati\RDAPLib\RDAPClient();

$domain = $rdap->domainLookup('google.com');
$contact = $rdap->entities[0]->vcardArray->parseCard();

```

The link model has another method that can generate HTML links:

$rdap = new \\Juanparati\\RDAPLib\\RDAPClient();

```
$domain = $rdap->domainLookup('google.com');
echo $rdap->links[0]->asLink();

```

It's possible to replace the current models with your own custom models. In order achieve that a custom ModelMapper is required.

Example:

```
// 1. Define our custom model that extends the default one.
class MyIpAddressModel extends \Juanparati\RDAPLib\Models\IpAddressModel {

    /**
     * Our new method
     */
    public function getFirstIpV4Ip() : ?string {
        return $this->v4[0] ?? null;
    }
}

// 2. Instantiate a custom mapper with the model replacement.
$mapper = new \Juanparati\RDAPLib\ModelMapper([
    'ipAddresses'  => \Juanparati\RDAPLib\Models\IpAddressModel::class,
]);

// 3. Instantiate the client injecting our custom mapper
$rdap = new \Juanparati\RDAPLib\RDAPClient([], null, null, $mapper);

```

### Use different endpoints

[](#use-different-endpoints)

By default RDAPLib uses the following endpoints according to the lookup type:

```
'ip'        => 'https://rdap.db.ripe.net/ip/',
'domain'    => 'https://rdap.org/domain/',
'tld'       => 'https://root.rdap.org/domain/',
'autnum'    => 'https://rdap.db.ripe.net/autnum/',
'entity'    => 'https://rdap.arin.net/registry/entity/',
'registrar' => 'https://registrars.rdap.org/entity/',

```

It's possible to replace the endpoints passing a new ones into the first parameter of the RDAPClient constructor.

Example:

```
$rdap = new \Juanparati\RDAPLib\RDAPClient(['ip' => 'https://rdap.org/ip/']);

```

### Use a custom HTTP Client

[](#use-a-custom-http-client)

RDAPLib allows to inject a custom [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP Client. The client will also require a message interface [PSR-7](https://www.php-fig.org/psr/psr-7/).

Example:

```
 $rdap = new \Juanparati\RDAPLib\RDAPClient(
    [],
    $myCompatiblePSR18HTTPClient,       // Psr\Http\Client\ClientInterface
    $myCompatiblePSR7MessageInterface   // Psr\Http\Message\RequestFactoryInterface
 );

```

Supporters
----------

[](#supporters)

- [superkredit.net](https://superkredit.net/)
- [fair-laan.se](https://fair-laan.se/)
- [fair-laan.dk](https://fair-laan.dk/)
- [matchbanker.fi](https://matchbanker.fi/)
- [mamuph.org](http://mamuph.org)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Every ~102 days

Recently: every ~5 days

Total

7

Last Release

1838d ago

Major Versions

0.9 → 2.02021-06-04

1.0 → 2.0.x-dev2021-06-22

PHP version history (2 changes)0.8PHP &gt;=7.1

2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/4caf72b4d969cfb8cdfbdc1d594c85b51c9316caf76b80aa0f9de7e3736cf59f?d=identicon)[juanparati](/maintainers/juanparati)

---

Top Contributors

[![juanparati](https://avatars.githubusercontent.com/u/835173?v=4)](https://github.com/juanparati "juanparati (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/juanparati-rdap-lib/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60216.0M85](/packages/mollie-mollie-api-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)

PHPackages © 2026

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