Skip to content

v0.5.0

Choose a tag to compare

@boutetnico boutetnico released this 24 Apr 21:12
· 6 commits to main since this release

TLD catalog endpoints

Two new methods list the TLDs the API can resolve and how often each registry's RDAP server populates common fields. Neither endpoint counts against your monthly quota.

$tlds = $api->tlds();
if ($tlds !== null) {
    echo $tlds->meta->count." TLDs, coverage ".round($tlds->meta->coverage * 100)."%\n";

    foreach ($tlds->data as $tld) {
        if ($tld->field_availability !== null) {
            echo "{$tld->tld}: expires_at={$tld->field_availability->expires_at}\n";
        }
    }
}

Filters: since (ISO 8601), server (hostname). Pass the previous etag via if_none_match to skip unchanged transfers. The method returns null on HTTP 304.

$later = $api->tlds(['if_none_match' => $tlds->etag]);
$com = $api->tld('com');

New response classes in RdapApi\Responses\: TldListResponse, TldResponse, TldEntry, TldListMeta, TldMeta, TldThresholds, FieldAvailability.

NotSupportedException

A new NotSupportedException subclass of NotFoundException is thrown on HTTP 404 when the API returns error: "not_supported" (no RDAP coverage for the TLD, IP range, or ASN range). Existing catch (NotFoundException $e) blocks keep working.

use RdapApi\Exceptions\NotFoundException;
use RdapApi\Exceptions\NotSupportedException;

try {
    $api->domain('example.nope');
} catch (NotSupportedException $e) {
    echo "TLD not covered by RDAP\n";
} catch (NotFoundException $e) {
    echo "Domain not registered\n";
}

Install

composer require rdapapi/rdapapi-php:^0.5

Full Changelog: v0.3.0...v0.5.0