Skip to main content

Make your first WHOIS request

WHOIS returns normalized domain registration data through the AntAPI Gateway. Use a single lookup for an immediate result, or a batch job for a collection of domains.

Start with a free WHOIS coverage request to verify your key, then look up a domain. Run both examples in your terminal or backend.

1. Prepare your project​

Follow Set up your project if you have not prepared an account and key. If you already have an active project, open API keys in Console and create or use a key for that project. You can continue with your existing key; a new key is not required for this guide.

2. Configure your backend​

Provide your project key through your server's environment or secret manager:

VariableValue
ANTAPI_KEYYour project API key.

For a local terminal session, replace the placeholder with your key:

export ANTAPI_KEY="your-project-key"

The official Gateway is https://api.antapi.dev. The CLI uses it automatically; no Gateway setting is required. Send the key in the Authorization header, including for free endpoints.

Keep keys on your server

Run examples in a trusted terminal or backend. Never put an API key in a browser bundle, public repository, screenshot, or log.

3. Verify access with a free request​

curl --include \
"https://api.antapi.dev/whois/v1/tlds" \
--header "Authorization: Bearer $ANTAPI_KEY"

This request checks TLD coverage and does not consume balance. Authentication and rate limits still apply. Check coverage before submitting domains: support and temporary availability can differ by TLD. A successful JSON response has code: 0. The TLD reference explains the coverage fields.

4. Look up a domain​

Check the published lookup price, your USD balance and your project's available budget before this paid request:

curl --include \
"https://api.antapi.dev/whois/v1/domains/example.com" \
--header "Authorization: Bearer $ANTAPI_KEY"

Send a bare domain name without a URL scheme, port, or path. Unicode and Punycode names are supported. The domain lookup reference defines the complete parameters and response fields.

On success, data contains the result. Read data.registration.registered for the registration observation and data.quality.warnings for missing or redacted data. A conclusively unregistered domain is a successful lookup; an inconclusive result does not establish availability to purchase. See Response data and quality before treating missing fields as facts.

Choose a workflow​

Use a single lookup when you need one immediate result. Follow Batch lookups to submit a collection asynchronously, then read progress and paginated results or cancel remaining work. TLD queries, batch progress, existing result pages, and cancellation are free. The WHOIS API reference lists every published endpoint and price; the data quality guide explains successful billable units and duplicate domains.

5. Check the response and usage​

For these WHOIS calls, check the HTTP status and the JSON envelope. A successful response has code: 0, an endpoint-specific data payload, and an empty error string. For asynchronous work, an acceptance response starts a job; it does not confirm completed work or a final charge.

Save the X-Request-ID response header for investigation. Open usage and request records to review the request and any final paid receipt. Use Balance and billing to distinguish a reservation from a final charge.

Before production​

  • Follow API key security and use separate keys where access needs independent management.
  • Persist a stable idempotency key before an asynchronous submission or a paid request you may need to retry.
  • Handle rate limits, errors, and uncertain outcomes with deliberate backoff and recovery.
  • Read the product's success definition and complete API reference before counting results or deciding what to retry.