canyougrab.it
Guide

How to Check Domain Availability with an API

Published: March 20, 2026

If you need to check whether a domain name is available to register, doing it manually through a registrar website does not scale. Whether you are building a domain search tool, protecting a brand across TLDs, or screening startup name ideas, you need a programmatic approach. This guide covers how domain availability checking works under the hood, the trade-offs of building it yourself versus using an API, and working code examples to get started.

Why check domain availability programmatically?

Registrar websites let you check one domain at a time. That works for buying a single domain, but breaks down when you need to:

An API lets you automate these workflows. Send a list of domains, get structured results back, and integrate availability data into your own systems.

How domain availability checking works

There are two primary methods for determining whether a domain is registered: DNS resolution and WHOIS/RDAP queries. Each has strengths and limitations.

DNS resolution

The fastest approach. Query the authoritative DNS servers for a domain. If the response is NXDOMAIN (non-existent domain), the domain is very likely available. If there are active DNS records (A, NS, MX), the domain is registered. DNS lookups complete in milliseconds and are not subject to the strict rate limits that WHOIS servers impose.

The limitation: some registered domains have no DNS records configured (parked domains, recently expired domains in a grace period). DNS alone can produce false positives, reporting a domain as available when it is actually registered.

WHOIS and RDAP queries

WHOIS is the traditional protocol for querying domain registration databases. It returns the registrar, creation date, expiry date, and nameservers. RDAP is the modern replacement with structured JSON responses instead of free-text.

WHOIS is more authoritative than DNS for availability, but slower and heavily rate-limited. Most registries allow roughly 43 queries per minute before throttling. Response formats vary across registrars, making parsing unreliable at scale.

Combining both for accuracy

The most reliable approach uses DNS as the fast first check and WHOIS/RDAP as confirmation when DNS is inconclusive. This is the approach used by canyougrab.it — each lookup queries DNS servers directly via Unbound, with WHOIS/RDAP as a fallback. Results include a confidence score so you know how reliable each result is.

Building it yourself vs. using an API

You can build your own availability checker by running a recursive DNS resolver and a WHOIS client. The operational overhead includes:

If domain checking is a core feature of your product, building in-house gives you full control. If it is a supporting feature, an API saves significant engineering time. You send domains, you get results — no infrastructure to manage.

Using the canyougrab.it API

The canyougrab.it API lets you check up to 100 domains per request with a single POST call. Here is how it works:

Authentication

Sign up at portal.canyougrab.it to get an API key. Pass it in the Authorization header as a Bearer token.

cURL example

curl -X POST https://api.canyougrab.it/api/check/bulk \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"domains": ["example.com", "my-startup.io", "newbrand.dev"]}'

Python example

import requests

resp = requests.post(
    "https://api.canyougrab.it/api/check/bulk",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"domains": ["example.com", "my-startup.io", "newbrand.dev"]}
)
for r in resp.json()["results"]:
    status = "available" if r["available"] else "taken"
    print(f'{r["domain"]}: {status} ({r["confidence"]})')

JavaScript (fetch) example

const resp = await fetch("https://api.canyougrab.it/api/check/bulk", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
  body: JSON.stringify({
    domains: ["example.com", "my-startup.io", "newbrand.dev"]
  })
});
const { results } = await resp.json();
results.forEach(r => {
  console.log(`${r.domain}: ${r.available ? "available" : "taken"} (${r.confidence})`);
});

Interpreting the response

Each result in the response includes:

A result with confidence: "high" from a WHOIS or RDAP source is definitive. A DNS-only result with confidence: "medium" is a strong signal but could miss parked domains with no DNS records.

Rate limits and pricing

The API offers a free tier with 500 lookups per month and 30 requests per minute — enough to test your integration and run small checks. Paid plans scale to 300,000 lookups per month for high-volume use cases. See pricing details for the full tier breakdown.

Try it now

Get your free API key and start checking domain availability in seconds. No credit card required.

Get Your API Key →

Further reading