{
  "openapi": "3.1.0",
  "info": {
    "title": "Wikexa Knowledge API",
    "version": "1.0.0",
    "description": "Structured Wikipedia + Wikidata for AI agents. Free, no auth. Wikipedia text CC BY-SA 4.0; Wikidata CC0."
  },
  "servers": [
    {
      "url": "https://wikexa.com"
    }
  ],
  "paths": {
    "/v1/lookup": {
      "get": {
        "summary": "Entity facts + short summary",
        "operationId": "lookup",
        "parameters": [
          {
            "name": "entity",
            "in": "query",
            "required": true,
            "description": "Entity name, title, alias, or Wikidata Q-id",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured knowledge record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/v1/article": {
      "get": {
        "summary": "Full article as structured JSON",
        "operationId": "article",
        "parameters": [
          {
            "name": "title",
            "in": "query",
            "required": true,
            "description": "Article title, alias, or Q-id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sections",
            "in": "query",
            "required": false,
            "description": "Comma-separated section names to include",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "max_chars",
            "in": "query",
            "required": false,
            "description": "Cap on total section text",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured knowledge record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/v1/search": {
      "get": {
        "summary": "Fuzzy entity search",
        "operationId": "search",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Free-text query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results 1-50",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured knowledge record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/v1/recent": {
      "get": {
        "summary": "Recently changed articles",
        "operationId": "recent",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Filter on title or comment",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "description": "Look-back window 1-168",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max changes 1-100",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Structured knowledge record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/v1/stats": {
      "get": {
        "summary": "Service status and coverage",
        "operationId": "stats",
        "responses": {
          "200": {
            "description": "Structured knowledge record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "MCP JSON-RPC endpoint",
        "operationId": "mcp",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  }
}