{
  "openapi": "3.1.0",
  "info": {
    "title": "wcag.dehl.net accessibility checker API",
    "version": "1.0.0",
    "description": "Scans one public web page for accessibility problems. Uses axe-core in a headless browser (engine \"axe\"); falls back to a static HTML analysis (engine \"static\"). Automated checks find only part of all barriers. Limit: 6 requests per minute per client. Rule data: https://wcag.dehl.net/wcag.json",
    "license": { "name": "Free to use", "url": "https://wcag.dehl.net/en/checker/" }
  },
  "servers": [{ "url": "https://wcag.dehl.net" }],
  "paths": {
    "/api/scan": {
      "get": {
        "operationId": "scanPage",
        "summary": "Scan a public web page for WCAG problems",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Absolute http(s) address of a public page. Private networks, credentials and non-standard ports are refused.",
            "schema": { "type": "string", "format": "uri" },
            "example": "https://www.example.org/"
          }
        ],
        "responses": {
          "200": { "description": "Scan result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Report" } } } },
          "400": { "description": "Address refused. error is one of: invalid, protocol, credentials, port, private.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": { "description": "Rate limit reached. Retry after 60 seconds.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "503": { "description": "Service not available (error: unavailable).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "504": { "description": "The page did not finish loading in time (error: timeout).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "502": { "description": "Page could not be read. error is one of: unreachable, http-error, not-html, too-many-redirects.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Report": {
        "type": "object",
        "required": ["url", "engine", "scannedAt", "findings"],
        "properties": {
          "url": { "type": "string", "description": "Final address after redirects" },
          "engine": { "type": "string", "enum": ["axe", "static"] },
          "scannedAt": { "type": "string", "format": "date-time" },
          "note": { "type": "string", "description": "\"browser-unavailable\" when the static engine was used as fallback" },
          "findings": { "type": "array", "items": { "$ref": "#/components/schemas/Finding" } }
        }
      },
      "Finding": {
        "type": "object",
        "required": ["id", "impact", "wcag", "count", "samples"],
        "properties": {
          "id": { "type": "string", "description": "axe-core rule id, e.g. image-alt", "example": "image-alt" },
          "impact": { "type": "string", "enum": ["critical", "serious", "moderate", "minor"] },
          "wcag": { "type": "array", "items": { "type": "string" }, "description": "Affected success criteria, e.g. [\"1.1.1\"]. Empty for best practices. Explanations: https://wcag.dehl.net/en/wcag/1-1-1.md" },
          "count": { "type": "integer", "description": "Number of affected elements" },
          "samples": {
            "type": "array",
            "maxItems": 5,
            "items": { "type": "object", "required": ["html"], "properties": { "html": { "type": "string" }, "target": { "type": "string", "description": "CSS selector" } } }
          },
          "help": { "type": "string" },
          "helpUrl": { "type": "string" }
        }
      },
      "Error": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string" } } }
    }
  }
}
