{
  "openapi": "3.1.1",
  "info": {
    "title": "Kannmu Public Data API",
    "version": "1.0.0",
    "description": "Read-only JSON snapshots from Kannmu. Requests need no credentials or parameters. Filter the complete response in your client."
  },
  "servers": [{ "url": "https://kannmu.top" }],
  "externalDocs": { "description": "Developer guide", "url": "https://kannmu.top/developers/" },
  "paths": {
    "/tools/catalog.json": {
      "get": {
        "operationId": "getToolsCatalog",
        "summary": "Read the browser tools catalog",
        "responses": {
          "200": {
            "description": "Tool groups and entries, including links to published resources where available.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ToolsCatalog" } } }
          }
        }
      }
    },
    "/games/catalog.json": {
      "get": {
        "operationId": "getGamesCatalog",
        "summary": "Read the browser games catalog",
        "responses": {
          "200": {
            "description": "Game groups and entries with links to the playable pages.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GamesCatalog" } } }
          }
        }
      }
    },
    "/search.json": {
      "get": {
        "operationId": "getArticleIndex",
        "summary": "Read the article search index",
        "description": "Returns entry metadata for filtering in your client. Resolve URL paths against the site origin.",
        "responses": {
          "200": {
            "description": "Index entries for articles and their translations.",
            "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ArticleIndexEntry" } } } }
          }
        }
      }
    },
    "/tools/gguf-size-planner/data.json": {
      "get": {
        "operationId": "getGgufSizes",
        "summary": "Read the GGUF file size snapshot",
        "responses": {
          "200": {
            "description": "Published file sizes, source links, summary metrics, and chart values.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GgufSizes" } } }
          }
        }
      }
    },
    "/about/profile.json": {
      "get": {
        "operationId": "getResearchProfile",
        "summary": "Read the public research profile",
        "responses": {
          "200": {
            "description": "Bilingual profile, research interests, publication metadata, and patent summary.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ResearchProfile" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DirectoryMetadata": {
        "type": "object",
        "required": ["schema_version", "site", "default_language", "directories", "groups"],
        "properties": {
          "schema_version": { "type": "integer", "const": 1 },
          "site": { "type": "string", "format": "uri" },
          "default_language": { "type": "string", "const": "en" },
          "directories": {
            "type": "object",
            "required": ["en", "zh-CN"],
            "properties": {
              "en": { "type": "string", "format": "uri" },
              "zh-CN": { "type": "string", "format": "uri" }
            }
          },
          "groups": { "type": "array", "items": { "$ref": "#/components/schemas/DirectoryGroup" } }
        }
      },
      "ToolsCatalog": {
        "allOf": [
          { "$ref": "#/components/schemas/DirectoryMetadata" },
          {
            "type": "object",
            "required": ["tools"],
            "properties": { "tools": { "type": "array", "items": { "$ref": "#/components/schemas/DirectoryEntry" } } }
          }
        ]
      },
      "GamesCatalog": {
        "allOf": [
          { "$ref": "#/components/schemas/DirectoryMetadata" },
          {
            "type": "object",
            "required": ["games"],
            "properties": { "games": { "type": "array", "items": { "$ref": "#/components/schemas/DirectoryEntry" } } }
          }
        ]
      },
      "DirectoryLabel": {
        "type": "object",
        "required": ["zh-CN"],
        "properties": {
          "en": { "type": "string" },
          "zh-CN": { "type": "string" }
        }
      },
      "DirectoryGroup": {
        "type": "object",
        "required": ["id", "name", "subgroups"],
        "properties": {
          "id": { "type": "string" },
          "name": { "$ref": "#/components/schemas/DirectoryLabel" },
          "subgroups": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "name"],
              "properties": {
                "id": { "type": "string" },
                "name": { "$ref": "#/components/schemas/DirectoryLabel" }
              }
            }
          }
        }
      },
      "DirectoryEntry": {
        "type": "object",
        "required": ["id", "group", "subgroup", "updated_at", "url", "localized_urls", "name", "summary", "access"],
        "properties": {
          "id": { "type": "string" },
          "group": { "type": "string" },
          "subgroup": { "type": "string" },
          "updated_at": { "type": "string", "description": "Catalog entry update date or timestamp." },
          "url": { "type": "string", "format": "uri" },
          "localized_urls": {
            "type": "object",
            "required": ["default"],
            "properties": {
              "default": { "type": "string", "format": "uri" },
              "zh-CN": { "type": "string", "format": "uri" }
            }
          },
          "name": { "type": "string" },
          "summary": { "$ref": "#/components/schemas/DirectoryLabel" },
          "access": { "$ref": "#/components/schemas/DirectoryLabel" },
          "resources": {
            "type": "object",
            "properties": {
              "context": { "type": "string", "format": "uri" },
              "data": { "type": "string", "format": "uri" },
              "csv": { "type": "string", "format": "uri" }
            }
          }
        }
      },
      "ArticleIndexEntry": {
        "type": "object",
        "required": ["title", "subtitle", "keywords", "tags", "topics", "url", "note", "lang", "has_translation", "summary"],
        "properties": {
          "title": { "type": "string" },
          "subtitle": { "type": "string" },
          "keywords": { "type": "string" },
          "tags": { "type": "string", "description": "Space-separated tags." },
          "topics": { "type": "string", "description": "Search topic text." },
          "url": { "type": "string", "format": "uri-reference" },
          "note": { "type": "string", "format": "uri-reference", "description": "Path to the original article." },
          "lang": { "type": "string" },
          "has_translation": { "type": "boolean" },
          "summary": { "type": "boolean", "description": "Whether the entry is a summary of the original." }
        }
      },
      "GgufSizes": {
        "type": "object",
        "required": ["schema_version", "tool_id", "updated_at", "sources", "rows", "metrics", "chart"],
        "properties": {
          "schema_version": { "type": "integer", "const": 1 },
          "tool_id": { "type": "string", "const": "gguf-size-planner" },
          "updated_at": { "type": "string", "format": "date-time", "description": "Snapshot update time." },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name", "url"],
              "properties": {
                "name": { "type": "string" },
                "url": { "type": "string", "format": "uri" }
              }
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "url", "cells"],
              "properties": {
                "id": { "type": "string" },
                "url": { "type": "string", "format": "uri" },
                "cells": { "$ref": "#/components/schemas/GgufSizeCells" }
              }
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["key", "value"],
              "properties": {
                "key": { "type": "string" },
                "value": { "type": "number" }
              }
            }
          },
          "chart": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["label", "value"],
              "properties": {
                "label": { "type": "string" },
                "value": { "type": "number" }
              }
            }
          }
        }
      },
      "GgufSizeCells": {
        "type": "object",
        "required": ["repo", "variant", "kind", "first_file", "files", "largest_shard_bytes", "total_bytes", "revision"],
        "properties": {
          "repo": { "type": "string" },
          "variant": { "type": "string" },
          "kind": { "type": "string" },
          "first_file": { "type": "string" },
          "files": { "type": "integer" },
          "largest_shard_bytes": { "type": "integer" },
          "total_bytes": { "type": "integer" },
          "revision": { "type": "string" }
        }
      },
      "ProfileLabel": {
        "type": "object",
        "required": ["en", "zh"],
        "properties": { "en": { "type": "string" }, "zh": { "type": "string" } }
      },
      "ResearchProfile": {
        "type": "object",
        "required": ["schema_version", "urls", "name", "description", "university", "orcid", "research_topics", "education", "experience", "research_projects", "featured_system", "publication_counts", "publications", "patents"],
        "properties": {
          "schema_version": { "type": "integer", "const": 1 },
          "urls": {
            "type": "object",
            "required": ["en", "zh-CN"],
            "properties": {
              "en": { "type": "string", "format": "uri" },
              "zh-CN": { "type": "string", "format": "uri" }
            }
          },
          "name": { "$ref": "#/components/schemas/ProfileLabel" },
          "description": { "$ref": "#/components/schemas/ProfileLabel" },
          "university": { "$ref": "#/components/schemas/ProfileLabel" },
          "orcid": { "type": "string" },
          "research_topics": { "type": "array", "items": { "$ref": "#/components/schemas/ProfileLabel" } },
          "education": { "type": "array", "items": { "type": "object" } },
          "experience": { "type": "array", "items": { "type": "object" } },
          "research_projects": { "type": "array", "items": { "type": "object" } },
          "featured_system": {
            "type": "object",
            "required": ["title", "description"],
            "properties": {
              "title": { "$ref": "#/components/schemas/ProfileLabel" },
              "description": { "$ref": "#/components/schemas/ProfileLabel" }
            }
          },
          "publication_counts": {
            "type": "object",
            "required": ["total", "first_or_cofirst_author"],
            "properties": {
              "total": { "type": "integer" },
              "first_or_cofirst_author": { "type": "integer" }
            }
          },
          "publications": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["title", "year", "venue", "doi", "author_role"],
              "properties": {
                "title": { "type": "string" },
                "year": { "type": "integer" },
                "venue": { "type": "string" },
                "doi": { "type": ["string", "null"] },
                "author_role": { "type": ["string", "null"] }
              }
            }
          },
          "patents": { "type": "object" }
        }
      }
    }
  }
}
