SDK

Node.js RDAP SDK

Look up domains, IPs, and ASNs from Node.js. Bulk lookups, zero runtime dependencies, ships with TypeScript types.

Node.js 20 or later

Install

npm install rdapapi

First 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.

import { RdapClient } from "rdapapi";

const client = new RdapClient("your-api-key");

// Domain lookup
const domain = await client.domain("google.com");
console.log(domain.registrar.name); // "MarkMonitor Inc."
console.log(domain.dates.expires);  // "2028-09-14T04:00:00Z"
console.log(domain.nameservers);    // ["ns1.google.com", ...]

// IP address lookup
const ip = await client.ip("8.8.8.8");
console.log(ip.name); // "GOGL"
console.log(ip.cidr); // ["8.8.8.0/24"]

// ASN lookup
const asn = await client.asn(15169);
console.log(asn.name); // "GOOGLE"

Bulk domain lookups

Send up to 10 domains in one request. Available on Pro and Business plans.

const result = await client.bulkDomains(
  ["google.com", "github.com", "example.com"],
  { follow: true },
);

console.log(result.summary); // { total: 3, successful: 3, failed: 0 }

for (const r of result.results) {
  if (r.status === "success" && r.data) {
    console.log(`${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.

import {
  NotFoundError,
  NotSupportedError,
  RateLimitError,
} from "rdapapi";

try {
  await client.domain("example.nope");
} catch (err) {
  if (err instanceof NotSupportedError) {
    console.log("The TLD is not covered by RDAP.");
  } else if (err instanceof NotFoundError) {
    console.log("The domain is not registered.");
  } else if (err instanceof RateLimitError) {
    console.log(`Rate limited. Retry after ${err.retryAfter}s`);
  }
}

Resources

Other languages

Ready to integrate?

Start with a free trial. Plans from $9/mo.