{
  "openapi": "3.1.0",
  "info": { "title": "PHII Labs site check", "version": "1.0.0", "description": "Scores a website 0-100 for AI search readiness: crawler access, text without JavaScript, structured data, answer pages, sitemap, llms.txt, speed and instant contact. Throttled per IP." },
  "servers": [{ "url": "https://phiilabs.com" }],
  "paths": {
    "/api/scan": {
      "post": {
        "summary": "Check a site",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "type": "object", "required": ["url"], "properties": { "url": { "type": "string", "example": "yourcompany.ae" } } } } }
        },
        "responses": {
          "200": { "description": "Score and checks", "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" }, "score": { "type": "integer" }, "problems": { "type": "integer" }, "platform": { "type": ["string", "null"] }, "checks": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "status": { "type": "string", "enum": ["pass", "warn", "fail", "locked"] }, "detail": { "type": "string" }, "fix": { "type": "string" }, "weight": { "type": "number" }, "earned": { "type": "number" } } } } } } } } },
          "400": { "description": "Not a website address" },
          "422": { "description": "The site could not be reached" },
          "429": { "description": "Too many checks from this IP" }
        }
      }
    }
  }
}
