{
  "openapi": "3.1.0",
  "info": {
    "title": "Money Engine Website Audit APIs",
    "version": "1.0.0",
    "description": "Heuristic audits of public website pages. Results include evidence and limits for every recommendation."
  },
  "paths": {
    "/_api/scan": {
      "post": {
        "operationId": "scanPublicWebsites",
        "summary": "Scan public websites for visible conversion gaps",
        "description": "Choose the server for the desired audit. Free requests accept up to 2 URLs. A verified purchase may scan up to 20 URLs. JavaScript is not rendered; findings require human confirmation.",
        "servers": [
          { "url": "https://restaurant-conversion.floot.app", "description": "Restaurant booking and menu audit" },
          { "url": "https://job-apply-audit.floot.app", "description": "Career site and job application audit" },
          { "url": "https://rfq-readiness.floot.app", "description": "Manufacturer RFQ readiness audit" },
          { "url": "https://donation-friction.floot.app", "description": "Nonprofit donation friction audit" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["urls"],
                "properties": {
                  "urls": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": { "type": "string", "format": "uri", "maxLength": 2048 }
                  }
                }
              },
              "example": { "urls": ["https://example.org", "https://example.net"] }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Website scan results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["results"],
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["website", "finalUrl", "statusCode", "score", "level", "reasons", "checkedPages", "leadLinks", "brokenLeadLinks", "evidence", "scanMethodology"],
                        "properties": {
                          "website": { "type": "string" },
                          "finalUrl": { "type": ["string", "null"], "format": "uri" },
                          "statusCode": { "type": ["integer", "null"] },
                          "score": { "type": "integer", "minimum": 0, "maximum": 100 },
                          "level": { "type": "string", "enum": ["HIGH", "MEDIUM", "LOW"] },
                          "reasons": { "type": "array", "items": { "type": "string" } },
                          "checkedPages": { "type": "array", "items": { "type": "string", "format": "uri" } },
                          "leadLinks": { "type": "array", "items": { "type": "string", "format": "uri" } },
                          "brokenLeadLinks": { "type": "array", "items": { "type": "string" } },
                          "evidence": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": ["criterion", "found", "sourceUrl", "excerpt"],
                              "properties": {
                                "criterion": { "type": "string" },
                                "found": { "type": "boolean" },
                                "sourceUrl": { "type": ["string", "null"], "format": "uri" },
                                "excerpt": { "type": ["string", "null"] }
                              }
                            }
                          },
                          "scanMethodology": { "type": "string" },
                          "error": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "description": "Invalid JSON or scan input" },
          "402": { "description": "More than 2 URLs require verified paid access" },
          "413": { "description": "Request body exceeds the allowed size" }
        }
      }
    }
  }
}