SDK
Python RDAP SDK
Look up domains, IPs, and ASNs from Python. Typed Pydantic responses, async support, bulk lookups.
Python 3.9 or later
Install
pip install rdapapiFirst request in 60 seconds
Get an API key from the dashboard, then drop your key into the client and call any of the lookup methods.
from rdapapi import RdapApi
api = RdapApi("your-api-key")
# Domain lookup
domain = api.domain("google.com")
print(domain.registrar.name) # "MarkMonitor Inc."
print(domain.dates.expires) # "2028-09-14T04:00:00Z"
print(domain.nameservers) # ["ns1.google.com", ...]
# IP address lookup
ip = api.ip("8.8.8.8")
print(ip.name) # "GOGL"
print(ip.cidr) # ["8.8.8.0/24"]
# ASN lookup
asn = api.asn(15169)
print(asn.name) # "GOOGLE"Bulk domain lookups
Send up to 10 domains in one request. Available on Pro and Business plans.
result = api.bulk_domains(
["google.com", "github.com", "example.com"],
follow=True,
)
print(result.summary) # total=3, successful=3
for r in result.results:
if r.status == "success":
print(f"{r.data.domain}: {r.data.registrar.name}")Error handling
Every API error maps to a typed exception. Catch NotSupportedError before NotFoundError since it is a subclass.
from rdapapi import RdapApi, NotFoundError, NotSupportedError, RateLimitError
try:
domain = api.domain("example.nope")
except NotSupportedError:
print("The TLD is not covered by RDAP.")
except NotFoundError:
print("The domain is not registered.")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")