{
  "openapi": "3.1.0",
  "info": {
    "title": "EuroVDC Public API",
    "description": "Domain search, WHOIS lookup, product listing and AI-powered suggestions for EuroVDC hosting platform.",
    "version": "1.0.0",
    "contact": {
      "name": "EuroVDC Support",
      "email": "support@eurovdc.eu",
      "url": "https://www.eurovdc.eu/en/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.eurovdc.eu/en/api",
      "description": "English"
    }
  ],
  "paths": {
    "/ping": {
      "get": {
        "operationId": "ping",
        "summary": "API health check",
        "responses": {
          "200": { "description": "API is alive" }
        }
      }
    },
    "/search_domain": {
      "post": {
        "operationId": "searchDomain",
        "summary": "Check domain availability across multiple TLDs",
        "description": "Checks whether a domain name is available for registration. Returns availability status and pricing for each TLD.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["domain"],
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Domain name to search (e.g. mycompany or mycompany.com)",
                    "example": "mycompany"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Domain availability results with pricing per TLD" }
        }
      }
    },
    "/whois": {
      "post": {
        "operationId": "whoisLookup",
        "summary": "WHOIS lookup for a domain",
        "description": "Returns registration details, owner, expiration date, nameservers and registrar for a domain.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["domain"],
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Full domain name to look up (e.g. example.com)",
                    "example": "example.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "WHOIS registration data" },
          "429": { "description": "Rate limit exceeded (5 requests per 30 seconds)" }
        }
      }
    },
    "/tlds": {
      "get": {
        "operationId": "listTlds",
        "summary": "List all available TLDs with pricing",
        "description": "Returns all supported TLD extensions with registration, renewal and transfer prices in EUR.",
        "responses": {
          "200": { "description": "TLD price list" }
        }
      }
    },
    "/top_tlds": {
      "get": {
        "operationId": "topTlds",
        "summary": "List popular TLDs",
        "description": "Returns the most commonly used TLD extensions.",
        "responses": {
          "200": { "description": "Popular TLD list" }
        }
      }
    },
    "/list_products/{type}": {
      "get": {
        "operationId": "listProducts",
        "summary": "List hosting/VPS/SSL/email/VPN products",
        "description": "Returns all available products and plans with pricing. Filter by type.",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": false,
            "schema": {
              "type": "string",
              "enum": ["all", "hostingaccount", "server", "ssl", "email", "vpn", "other"],
              "default": "all"
            },
            "description": "Product type filter"
          }
        ],
        "responses": {
          "200": { "description": "Product list with plans and pricing" }
        }
      }
    },
    "/ai_suggest": {
      "post": {
        "operationId": "aiDomainSuggest",
        "summary": "AI-powered domain name suggestions",
        "description": "Describe a business idea and get 8 short, brandable domain name candidates with availability checked across .com, .io, .ai, .de, .net and 100+ TLDs.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["prompt"],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Plain language description of the business or project",
                    "example": "An online store selling handmade organic soap"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Suggested domain names with availability status" }
        }
      }
    },
    "/ai_server_suggest": {
      "post": {
        "operationId": "aiServerSuggest",
        "summary": "AI-powered VPS/server plan recommendation",
        "description": "Describe your workload and get an instant recommendation for the best-fit VPS or cloud server plan with pricing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["prompt"],
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "Plain language description of the server workload",
                    "example": "I need a server to run a Node.js app with 10k daily users"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Recommended server plan with specs and pricing" }
        }
      }
    }
  }
}
