Domain Whois AI Agent / LLM

Domain Intelligence and Analysis
POST /api/v1/domain/whois_live Bearer

Everything an AI coding assistant needs to write a working Domain Whois integration without opening another page: endpoint, authentication, parameters, a real request, both response shapes and the platform rules it cannot infer from a single example. Copy the brief below and paste it into Claude, Cursor, GitHub Copilot, ChatGPT or any other agent.

Machine-readable spec — Markdown

# Domain Whois API — Way2API®

- **Endpoint:** `POST https://app.way2api.com/api/v1/domain/whois_live`
- **Auth:** `Authorization: Bearer YOUR_API_KEY` (or `X-API-Key: YOUR_API_KEY`)
- **Content-Type:** `application/json`
- **Category:** Domain Intelligence and Analysis
- **Availability:** Available worldwide
- **Docs:** https://app.way2api.com/documentation/domain-whois-lookup-v1

## What it does

Domain WHOIS Lookup API — Retrieve comprehensive WHOIS registration information for any domain name. Returns registrar details, registration/expiry dates, registrant contact, administrative and technical contacts, name servers, and domain status.

## Request body (application/json)

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `domain_name` | string | yes | Fully qualified domain name to look up (e.g. example.com, example.co.in). |

## Example request

```bash
curl -X POST https://app.way2api.com/api/v1/domain/whois_live \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain_name":"kwikapi.com"}'
```

## Success response — 200

```json
{
    "status": "SUCCESS",
    "status_code": 200,
    "charged": true,
    "success": true,
    "message": "",
    "message_code": "OK",
    "order_id": "W2A1739512345abcdef01",
    "data": {
        "order_id": "W2A1739512345abcdef01",
        "result": {
            "domain_name": "kwikapi.com",
            "domain_registered": "yes",
            "create_date": "2019-03-19",
            "update_date": "2024-02-18",
            "expiry_date": "2025-03-19",
            "domain_registrar": {
                "iana_id": "1068",
                "registrar_name": "NAMECHEAP INC",
                "whois_server": "whois.namecheap.com",
                "website_url": "http://www.namecheap.com",
                "email_address": "[email protected]",
                "phone_number": "+1.9854014545"
            },
            "registrant_contact": {
                "name": "Redacted for Privacy",
                "company": "Privacy service provided by Withheld for Privacy ehf",
                "street": "Kalkofnsvegur 2",
                "city": "Reykjavik",
                "state": "Capital Region",
                "zip_code": "101",
                "country_name": "Iceland",
                "country_code": "IS",
                "email_address": "[email protected]",
                "phone": "+354.4212434",
                "fax": "N/A",
                "mailing_address": "Kalkofnsvegur 2, 101 Reykjavik, Capital Region, Iceland"
            },
            "administrative_contact": {
                "name": "Redacted for Privacy",
                "company": "Privacy service provided by Withheld for Privacy ehf",
                "street": "Kalkofnsvegur 2",
                "city": "Reykjavik",
                "state": "Capital Region",
                "zip_code": "101",
                "country_name": "Iceland",
                "country_code": "IS",
                "email_address": "[email protected]",
                "phone": "+354.4212434",
                "fax": "N/A",
                "mailing_address": "Kalkofnsvegur 2, 101 Reykjavik, Capital Region, Iceland"
            },
            "technical_contact": {
                "name": "Redacted for Privacy",
                "company": "Privacy service provided by Withheld for Privacy ehf",
                "street": "Kalkofnsvegur 2",
                "city": "Reykjavik",
                "state": "Capital Region",
                "zip_code": "101",
                "country_name": "Iceland",
                "country_code": "IS",
                "email_address": "[email protected]",
                "phone": "+354.4212434",
                "fax": "N/A",
                "mailing_address": "Kalkofnsvegur 2, 101 Reykjavik, Capital Region, Iceland"
            },
            "name_servers": [
                "dns3.cloudns.net",
                "dns4.cloudns.net",
                "dns7.cloudns.net",
                "dns8.cloudns.net"
            ],
            "domain_status": [
                "clientTransferProhibited"
            ]
        }
    }
}
```

## Error response — 422

```json
{
    "status": "SUCCESS",
    "status_code": 422,
    "charged": true,
    "success": false,
    "message": "domain_name must be a valid domain name (e.g. example.com).",
    "message_code": "VERIFICATION_FAILED",
    "order_id": "W2A1739512345abcdef01",
    "data": {
        "order_id": "W2A1739512345abcdef01",
        "error_code": "verification_failed"
    }
}
```

## Integration rules

- Every response is JSON carrying `status`, `status_code`, `charged`, `success`, `message`, `message_code` and (once a call reaches the provider) `order_id`. The verification payload is under `data.result`.
- `charged` (boolean) is the authority on billing. Do NOT infer it from the HTTP status: `422` is returned both for input we rejected (not charged) and for a lookup the provider ran and billed us for that returned a negative result (charged).
- `message_code` is a fixed vocabulary — branch on it instead of parsing `message`. Values: `OK`, `ACCEPTED`, `PROVIDER_NO_RESPONSE`, `VERIFICATION_FAILED`, `NO_RECORD_FOUND`, `INVALID_INPUT`, `REQUEST_FAILED`, `MISSING_API_KEY`, `INVALID_API_KEY`, `INSUFFICIENT_BALANCE`, `NO_API_ACCESS`, `NOT_FOUND`, `RATE_LIMITED`, `INTERNAL_ERROR`, `PROVIDER_UNAVAILABLE`.
- `success` reports the verification outcome; `status` reports the ORDER lifecycle (`SUCCESS`/`PENDING`/`FAILED`). They differ on a charged negative result: the order completed and was billed while the verification did not pass.
- A failed verification is still a successful HTTP call — the outcome lives in the response body, so do not treat `200` as "verified".
- Status codes: `200` result returned, `202` pending or provider did not respond (both charged — quote the `order_id`), `401` missing/invalid key, `402` insufficient balance, `403` no access to this service, `422` see `charged`, `429` rate limited (honour the `Retry-After` header), `503` temporarily unavailable.
- Rate limits are per API key, per service, on a 1-minute sliding window.
- Load the API key from an environment variable or secret store. Never hard-code it, never commit it, and never ship it in client-side code — calls must be made from your backend.

Prompts to pair it with

  • Write a production-ready Domain Whois integration in PHP using this spec, with error handling and retries.
  • Given this spec, generate typed request/response models and a client class.
  • Review my existing Domain Whois integration against this spec and list what I handle incorrectly.
⚠ Before you paste generated code

Never let an assistant hard-code your API key — load it from an environment variable or a secret store, and call this endpoint from your backend only. A failed verification is still a successful HTTP call, so check the success field in the body rather than treating 200 as verified.