{
 "openapi": "3.1.0",
 "info": {
  "title": "WikiAIbot API",
  "version": "1.0.0",
  "description": "Search and read Wikipedia in any language for AI agents. No key. Independent service, not affiliated with, endorsed or sponsored by the Wikimedia Foundation. Wikipedia is a trademark of the Wikimedia Foundation. Text comes from Wikipedia under CC BY-SA 4.0: cite the page url you get with every answer."
 },
 "servers": [
  {
   "url": "https://wikiaibot.com"
  }
 ],
 "paths": {
  "/api/search": {
   "get": {
    "operationId": "wikiSearch",
    "summary": "Search Wikipedia",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "What to look for"
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "default": "en"
      },
      "description": "Wikipedia language code"
     },
     {
      "name": "results",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 10,
       "default": 5
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Matching pages with titles, descriptions, excerpts and urls"
     }
    }
   }
  },
  "/api/summary": {
   "get": {
    "operationId": "wikiSummary",
    "summary": "Lead summary of one page",
    "parameters": [
     {
      "name": "title",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "default": "en"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Summary, description, last edit, url"
     },
     "404": {
      "description": "No such page"
     }
    }
   }
  },
  "/api/article": {
   "get": {
    "operationId": "wikiArticle",
    "summary": "Full plain-text article, paged",
    "parameters": [
     {
      "name": "title",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "lang",
      "in": "query",
      "schema": {
       "type": "string",
       "default": "en"
      }
     },
     {
      "name": "start",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 0,
       "default": 0
      }
     },
     {
      "name": "max_chars",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 500,
       "maximum": 20000,
       "default": 8000
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Text page, totalChars, nextStart when there is more"
     },
     "404": {
      "description": "No such page"
     }
    }
   }
  }
 }
}