{
  "openapi": "3.1.0",
  "info": {
    "title": "EVAOO Public Page Diagnostics",
    "version": "1.0.0",
    "description": "HTTP JSON diagnostics for public pages. The AI readiness score is a heuristic technical assessment, not an official AI platform rating or prediction of recommendations."
  },
  "servers": [
    {
      "url": "https://evaoo.com"
    }
  ],
  "paths": {
    "/api/ai-readiness": {
      "post": {
        "operationId": "scan_ai_readiness",
        "summary": "Inspect public HTML page readiness signals",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A technical report; optional warnings identify incomplete auxiliary probes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditReport"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/InputError"
          },
          "403": {
            "$ref": "#/components/responses/InputError"
          },
          "429": {
            "description": "Request quota reached. Retry later."
          },
          "502": {
            "description": "The target did not return an analyzable HTML page."
          },
          "504": {
            "description": "The diagnostic deadline was exceeded."
          },
          "408": {
            "description": "Request body could not be read before its deadline."
          },
          "413": {
            "description": "Request body exceeds the 16 KiB limit."
          },
          "422": {
            "description": "Target requires interactive verification, returned an empty page, or is not HTML."
          },
          "500": {
            "description": "Diagnostic service could not complete the report."
          }
        }
      }
    },
    "/api/og": {
      "get": {
        "operationId": "inspect_open_graph",
        "summary": "Read Open Graph metadata for a public URL",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Open Graph metadata in JSON."
          },
          "400": {
            "$ref": "#/components/responses/InputError"
          },
          "502": {
            "description": "The target could not be inspected."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuditRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Public domain or full HTTP(S) page URL",
            "minLength": 1,
            "maxLength": 4096
          },
          "track": {
            "type": "string",
            "enum": [
              "auto",
              "ecommerce",
              "brand"
            ],
            "default": "auto"
          }
        },
        "required": [
          "url"
        ]
      },
      "AuditReport": {
        "type": "object",
        "required": [
          "version",
          "auditedAt",
          "finalUrl",
          "requestedTrack",
          "resolvedTrack",
          "totalScore",
          "maxScore",
          "checks",
          "stages",
          "snapshot",
          "auditStatus",
          "warnings"
        ],
        "properties": {
          "version": {
            "type": "string"
          },
          "auditedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finalUrl": {
            "type": "string",
            "format": "uri"
          },
          "requestedTrack": {
            "type": "string",
            "enum": [
              "auto",
              "ecommerce",
              "brand"
            ]
          },
          "resolvedTrack": {
            "type": "string",
            "enum": [
              "ecommerce",
              "brand"
            ]
          },
          "totalScore": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "maxScore": {
            "const": 100
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "stages": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "snapshot": {
            "type": "object"
          },
          "auditStatus": {
            "type": "string",
            "enum": [
              "complete",
              "partial"
            ],
            "description": "Whether static probes completed; not a runtime protocol verification."
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "code",
                "url",
                "message"
              ],
              "properties": {
                "code": {
                  "type": "string",
                  "enum": [
                    "timeout",
                    "fetch_failed",
                    "too_large",
                    "http_error"
                  ]
                },
                "url": {
                  "type": "string"
                },
                "message": {
                  "type": "object",
                  "required": [
                    "zh",
                    "en"
                  ],
                  "properties": {
                    "zh": {
                      "type": "string"
                    },
                    "en": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "InputError": {
        "description": "The input cannot be inspected.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
