{
  "openapi": "3.1.0",
  "info": {
    "title": "Fisher.digital Website Checker API",
    "version": "1.0.0",
    "description": "Free website health checker. Scores any public website 0–100 with plain-English findings. Powered by Fisher.digital.",
    "contact": { "name": "Jamie Fisher", "email": "jamie@fisher.digital", "url": "https://fisher.digital/" }
  },
  "servers": [ { "url": "https://fisher.digital" } ],
  "paths": {
    "/api/checker.php": {
      "get": {
        "summary": "Check a website's health",
        "parameters": [
          { "name": "url", "in": "query", "required": true, "schema": { "type": "string" }, "description": "The website address to check, e.g. example.co.uk" }
        ],
        "responses": {
          "200": { "description": "Health check result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckResponse" } } } },
          "400": { "description": "Invalid URL" },
          "429": { "description": "Rate limited" },
          "503": { "description": "Temporarily disabled" }
        }
      },
      "post": {
        "summary": "Check a website's health",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" } }, "required": ["url"] } } } },
        "responses": {
          "200": { "description": "Health check result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckResponse" } } } },
          "400": { "description": "Invalid URL" },
          "429": { "description": "Rate limited" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CheckResponse": {
        "type": "object",
        "properties": {
          "api_version": { "type": "string" },
          "ok": { "type": "boolean" },
          "result": {
            "type": "object",
            "properties": {
              "domain": { "type": "string" },
              "health": { "type": "integer", "minimum": 0, "maximum": 100 },
              "band": { "type": "string", "enum": ["healthy","good","attention","poor"] },
              "band_label": { "type": "string" },
              "summary": { "type": "string" },
              "findings": { "type": "array", "items": { "type": "string" } },
              "checked_at": { "type": "string", "format": "date-time" },
              "cached": { "type": "boolean" }
            }
          },
          "attribution": { "type": "object", "properties": { "powered_by": { "type": "string" }, "url": { "type": "string" }, "note": { "type": "string" } } },
          "links": { "type": "object", "properties": { "human_report": { "type": "string" }, "docs": { "type": "string" } } }
        }
      }
    }
  }
}
