1. Go to this page and download the library: Download rdapapi/rdapapi-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use RdapApi\Exceptions\AuthenticationException;
use RdapApi\Exceptions\NotFoundException;
use RdapApi\Exceptions\NotSupportedException;
use RdapApi\Exceptions\RateLimitException;
use RdapApi\Exceptions\SubscriptionRequiredException;
try {
$domain = $api->domain('example.nope');
} catch (NotSupportedException $e) {
// Catch before NotFoundException: it's a subclass.
echo 'The TLD is not covered by RDAP.';
} catch (NotFoundException $e) {
echo 'The domain is not registered.';
} catch (RateLimitException $e) {
echo "Rate limited, retry after {$e->retryAfter} seconds";
} catch (AuthenticationException $e) {
echo 'Invalid API key';
} catch (SubscriptionRequiredException $e) {
echo 'Subscription
if ($domain->dates->expires !== null) {
echo "Expires: {$domain->dates->expires}";
}
// Or use PHP 8's nullsafe operator
echo $domain->entities->registrant?->name;
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.