{
  "openapi": "3.1.0",
  "info": {
    "title": "Digital Engine public content API",
    "version": "1.0.0",
    "description": "Public, read-only API for the Traditional Chinese and English content published by Digital Engine by Darren Huang. Every item includes locale, language, translationKey, canonicalUrl, markdownUrl, and apiUrl. API version policy: version 1 is the current stable surface. Clients may send X-API-Version: 1. Backward-compatible additions remain on version 1; incompatible changes will use a new version. Deprecated operations will announce Deprecation and Sunset response headers and will be documented here before removal."
  },
  "servers": [
    {
      "url": "https://www.darrenhuang.com/"
    }
  ],
  "paths": {
    "/api/content.json": {
      "get": {
        "operationId": "listContent",
        "summary": "List all public content metadata",
        "description": "Returns article and note metadata without requiring authentication.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public content metadata.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/en/content.json": {
      "get": {
        "operationId": "listEnglishContent",
        "summary": "List English public content metadata",
        "description": "Returns English article and note metadata without requiring authentication.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "English public content metadata.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "locale",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "locale": {
                      "const": "en"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/articles.json": {
      "get": {
        "operationId": "listArticles",
        "summary": "List public articles",
        "description": "Returns metadata and Markdown links for Traditional Chinese articles.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Article collection.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "kind",
                    "locale",
                    "language",
                    "title",
                    "description",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "articles",
                        "notes"
                      ]
                    },
                    "locale": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/en/articles.json": {
      "get": {
        "operationId": "listEnglishArticles",
        "summary": "List public English articles",
        "description": "Returns metadata and Markdown links for published English article translations.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "English article collection.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "kind",
                    "locale",
                    "language",
                    "title",
                    "description",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "articles",
                        "notes"
                      ]
                    },
                    "locale": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/en/articles/{slug}.json": {
      "get": {
        "operationId": "getEnglishArticle",
        "summary": "Read one public English article",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The stable content slug published by the site.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "English article metadata and Markdown content.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ContentItem"
                    },
                    {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "English article slug was not found.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/articles/{slug}.json": {
      "get": {
        "operationId": "getArticle",
        "summary": "Read one public article",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The stable content slug published by the site.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Article metadata and Markdown content.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ContentItem"
                    },
                    {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Article slug was not found.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/notes.json": {
      "get": {
        "operationId": "listNotes",
        "summary": "List public Facebook notes",
        "description": "Returns metadata and Markdown links for published notes.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Note collection.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "kind",
                    "locale",
                    "language",
                    "title",
                    "description",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "articles",
                        "notes"
                      ]
                    },
                    "locale": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/notes/{slug}.json": {
      "get": {
        "operationId": "getNote",
        "summary": "Read one public Facebook note",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The stable content slug published by the site.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Note metadata and Markdown content.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ContentItem"
                    },
                    {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Note slug was not found.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/en/notes.json": {
      "get": {
        "operationId": "listEnglishNotes",
        "summary": "List public English saved Facebook notes",
        "description": "Returns metadata and Markdown links for published English saved-note translations.",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "English saved-note collection.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "kind",
                    "locale",
                    "language",
                    "title",
                    "description",
                    "count",
                    "items"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "articles",
                        "notes"
                      ]
                    },
                    "locale": {
                      "type": "string"
                    },
                    "language": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContentItem"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/en/notes/{slug}.json": {
      "get": {
        "operationId": "getEnglishNote",
        "summary": "Read one public English saved Facebook note",
        "parameters": [
          {
            "name": "X-API-Version",
            "in": "header",
            "required": false,
            "description": "Optional compatibility selector. Omit it to use the current stable version 1.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ],
              "default": "1"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "The stable content slug published by the site.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,159}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "English saved-note metadata and Markdown content.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ContentItem"
                    },
                    {
                      "type": "object",
                      "required": [
                        "content"
                      ],
                      "properties": {
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "English saved-note slug was not found.",
            "headers": {
              "X-API-Version": {
                "description": "The public API version used for this response.",
                "schema": {
                  "type": "string",
                  "const": "1"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcpJsonRpc",
        "summary": "Call the public read-only MCP tools",
        "description": "Accepts MCP JSON-RPC requests for initialize, tools/list, tools/call, and ping.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON-RPC request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContentItem": {
        "type": "object",
        "required": [
          "apiUrl",
          "canonicalUrl",
          "description",
          "kind",
          "language",
          "locale",
          "markdownUrl",
          "publishedAt",
          "slug",
          "title",
          "translationKey",
          "updatedAt"
        ],
        "properties": {
          "apiUrl": {
            "type": "string",
            "format": "uri"
          },
          "canonicalUrl": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "article",
              "note"
            ]
          },
          "language": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri"
          },
          "publishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "translationKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": [
                  "string",
                  "integer"
                ]
              },
              "message": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            }
          }
        }
      },
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        }
      }
    }
  }
}
