Download the PHP package rdapapi/rdapapi-php without Composer
On this page you can find all versions of the php package rdapapi/rdapapi-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package rdapapi-php
rdapapi-php
Official PHP SDK for the RDAP API — look up domains, IP addresses, ASNs, nameservers, and entities via the RDAP protocol.
Installation
Requires PHP 8.2 or later.
Quick Start
Usage
Configuration
Domain Lookup
The TLDs with no RDAP server — .it, .eu and .tr among them — are read from the
registry's WHOIS server and come back in the same shape. meta->source says which
protocol answered and meta->server names the host that did:
meta->rdap_server is deprecated and null when WHOIS answered — use meta->server, which
names the host over either protocol. meta->raw_rdap_url is the RDAP URL that was fetched,
so it too is null whenever source is whois.
Redacted Fields
Most contact fields come back null, and a field the registry never collected looks exactly
like one it withheld. A server that declares the difference (RFC 9537) gets reported in
redacted, on every response type. It mirrors the record, so a claim about
entities->registrant->name sits at redacted->entities['registrant']['name']:
The methods are removal, emptyValue, partialValue and replacementValue. They stay
plain strings, so a method we do not recognise reaches you unchanged. redacted is null
when the server declared nothing — which is not evidence that nothing was withheld.
IP Address Lookup
geofeed is returned exactly as the network publishes it — never fetched, never inherited
from a parent network.
ASN Lookup
Nameserver Lookup
Entity Lookup
Bulk Domain Lookup
Requires a Pro or Business plan. Up to 10 domains per call. follow and whois apply to
every domain in the request.
Supported TLDs Catalog
List every TLD the API can resolve, with the protocol that answers for it, the date support was added, and a qualitative summary of which fields the registry's RDAP server populates. Does not count against your monthly quota.
protocol is rdap or whois; a whois entry has no rdap_server_host or
rdap_server_url (both null) and no field_availability, which is measured from RDAP
responses only. rdap_server_host is deprecated in favour of server.
Filter to recent additions or to a single registry:
Pass back the previous etag to skip the transfer when nothing has changed:
Look up a single TLD:
Health Check
ping() costs no quota and makes no upstream call. It never throws: an unreachable host or
an error response comes back as false, which is what a liveness probe is asking about.
Error Handling
All API errors are thrown as typed exceptions that extend RdapApiException:
NotSupportedException extends NotFoundException, so catching NotFoundException still handles both cases.
SubscriptionRequiredException covers every 403, and one of them is not about billing: forbidden is a temporary IP block that lifts on its own and that API rate limits never cause. Branch on errorCode before telling anyone to subscribe.
| Exception | HTTP Status | errorCode |
|---|---|---|
ValidationException |
400 | invalid_domain, invalid_ip, invalid_asn, invalid_nameserver, invalid_handle, invalid_prefix, invalid_since, bad_request |
AuthenticationException |
401 | unauthenticated |
SubscriptionRequiredException |
403 | subscription_required, plan_upgrade_required (bulk needs Pro or Business), forbidden (a temporary IP block, not a billing state) |
NotFoundException |
404 | not_found — the namespace is covered but no record exists; domain_reserved, not_registrable |
NotSupportedException |
404 | not_supported — nothing we can query covers this TLD, IP range or handle |
ValidationException |
422 | request_failed — the body failed validation |
RateLimitException |
429 | rate_limit_exceeded, quota_exceeded, too_many_requests |
UpstreamException |
503, 502 | lookup_failed (503), bad_gateway (502) — carries retryAfter when the registry named one |
TemporarilyUnavailableException |
503 | temporarily_unavailable, service_unavailable |
RdapApiException |
any other | method_not_allowed (405), payload_too_large (413), gateway_timeout (504), server_error |
Branch on errorCode, never on the message: messages are display text and may be reworded at any time. Any code above can answer any endpoint.
All exceptions expose statusCode, errorCode, and getMessage(). RateLimitException, TemporarilyUnavailableException and UpstreamException also have retryAfter: seconds to wait, read from the Retry-After header in either form the HTTP spec allows — a count of seconds, or a date, which is what a throttling registry's own header often carries — and falling back to the body's retry_after. It is null when the API gave no estimate.
NotFoundException has reason, the registry's wording on a domain_reserved, and registrableDomain, the name to look up instead on a not_registrable; both are null otherwise. Failed bulk results carry them as reason and registrable_domain.
ValidationException has errors, the per-field messages a 422 sends (empty on a 400):
Nullable Fields
Fields that may be absent in API responses use nullable types (?string, ?int, ?bool). Check for null before using. null means the registry published nothing — dnssec is null where the registry publishes no DNSSEC status, which is not the same as false:
Development
Set up pre-commit hooks (runs lint + tests before each commit):
License
MIT — see LICENSE.