{
  "openapi": "3.1.0",
  "info": {
    "title": "DNS & WHOIS Lookup API",
    "version": "1.0.0",
    "description": "DNS records over DNS-over-HTTPS and domain registration data over RDAP, in clean JSON.\n\nResolve DNS records (A, AAAA, MX, TXT, NS, CNAME, SOA, SRV, CAA, PTR) and fetch domain registration data — registrar, status, nameservers, DNSSEC, and key dates. DNS is served over DNS-over-HTTPS and WHOIS via RDAP, the modern JSON replacement for legacy WHOIS.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/dns-whois.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/dns-whois-lookup"
  },
  "servers": [
    {
      "url": "https://api-dns-whois.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Tools",
      "description": "DNS & WHOIS Lookup API belongs to the Tools category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/dns": {
      "get": {
        "operationId": "dnsLookup",
        "summary": "DNS Lookup",
        "description": "DNS Lookup endpoint of the DNS & WHOIS Lookup API. Costs 10 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/dns-whois-lookup/dns-lookup"
        },
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "google.com"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "MX"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "domain": "google.com",
                  "type": "MX",
                  "record_count": 1,
                  "records": [
                    {
                      "name": "google.com",
                      "type": "MX",
                      "ttl": 289,
                      "data": "10 smtp.google.com."
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/whois": {
      "get": {
        "operationId": "whoisLookup",
        "summary": "WHOIS Lookup",
        "description": "WHOIS Lookup endpoint of the DNS & WHOIS Lookup API. Costs 10 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/dns-whois-lookup/whois-lookup"
        },
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "cloudflare.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "domain": "CLOUDFLARE.COM",
                  "handle": "1542998887_DOMAIN_COM-VRSN",
                  "status": [
                    "client delete prohibited",
                    "client transfer prohibited",
                    "client update prohibited"
                  ],
                  "registrar": "Cloudflare, Inc.",
                  "nameservers": [
                    "NS3.CLOUDFLARE.COM",
                    "NS4.CLOUDFLARE.COM"
                  ],
                  "dnssec": true,
                  "events": {
                    "registration": "2009-02-17T22:07:54Z",
                    "expiration": "2033-02-17T22:07:54Z",
                    "last_changed": "2024-01-09T16:45:28Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 10 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}