{
  "openapi": "3.1.0",
  "info": {
    "title": "satotaiki.com reading API",
    "version": "1.0.0",
    "description": "Read Taiki Sato's digital garden. These static GET endpoints require no authentication. Search and AI input use are allowed. AI training use is not allowed. Documentation: https://satotaiki.com/developers. MCP: https://satotaiki.com/mcp."
  },
  "servers": [
    {
      "url": "https://satotaiki.com"
    }
  ],
  "paths": {
    "/command-palette-index.json": {
      "get": {
        "operationId": "listPages",
        "summary": "List public and personal pages with snippets and their exact paths",
        "description": "Includes imported articles with sourceUrl. Excludes unlisted and private pages. Personal and imported pages are noindex in HTML.",
        "responses": {
          "200": {
            "description": "Listed pages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "title",
                      "path",
                      "snippet"
                    ],
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string",
                        "description": "Origin-relative page path. Reuse this value when constructing page or export URLs. Reserved title characters use the site's ~ escaping."
                      },
                      "snippet": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          }
        }
      }
    },
    "/export/1hop/{title}.txt": {
      "get": {
        "operationId": "readPageWithDirectContext",
        "summary": "Read a page with its outgoing links and backlinks",
        "parameters": [
          {
            "$ref": "#/components/parameters/TitlePath"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ContextExport"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          }
        }
      }
    },
    "/export/2hop/{title}.txt": {
      "get": {
        "operationId": "readPageWithWiderContext",
        "summary": "Read a page with related pages up to two links away",
        "parameters": [
          {
            "$ref": "#/components/parameters/TitlePath"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/ContextExport"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "405": {
            "$ref": "#/components/responses/MethodNotAllowed"
          }
        }
      }
    },
    "/index.md": {
      "get": {
        "operationId": "readMarkdownHome",
        "summary": "Read the site index as Markdown",
        "responses": {
          "200": {
            "description": "Listed pages and developer resources",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/{title}.md": {
      "get": {
        "operationId": "readMarkdownPage",
        "summary": "Read a listed article as Markdown",
        "parameters": [
          {
            "$ref": "#/components/parameters/TitlePath"
          }
        ],
        "responses": {
          "200": {
            "description": "Single-page Markdown with a canonical Link response header",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "TitlePath": {
        "name": "title",
        "in": "path",
        "required": true,
        "description": "Use the path returned by listPages without its leading slash. Preserve ~ escapes. For example, the title A/B uses A~2FB. Do not encode the human title independently.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "ContextExport": {
        "description": "Plain text with Page blocks, source Markdown, and wiki links. Includes only public and personal pages. Unlisted and private pages are excluded, including intermediate related-page traversal. This is not Markdown content negotiation.",
        "content": {
          "text/plain": {
            "schema": {
              "type": "string"
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource is not available. Unlisted and private resources use the same not-found response.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "This resource supports GET and HEAD.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          },
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "hint",
          "documentation"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri-reference"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string",
            "format": "uri-reference"
          },
          "code": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
