{
  "openapi": "3.1.0",
  "info": {
    "title": "Alexandria Archive Public API",
    "version": "1.0.0",
    "description": "Public read-only API of the Alexandria Archive (أرشيف الإسكندرية) — a bilingual digital archive of the history of Alexandria, Egypt. No authentication required. Also available as an MCP server at /mcp.",
    "contact": {
      "url": "https://www.alexandria-archive.com/about"
    }
  },
  "servers": [
    {
      "url": "https://www.alexandria-archive.com"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchArchive",
        "summary": "Unified search across archive items, articles, community posts, events, and podcast episodes (Arabic or English).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2
            },
            "description": "Search terms in Arabic or English."
          }
        ],
        "responses": {
          "200": {
            "description": "Grouped search results with titles and site links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/articles": {
      "get": {
        "operationId": "listArticles",
        "summary": "List published articles (newest first).",
        "responses": {
          "200": {
            "description": "Array of article objects (id, title, titleAr, excerpt…). Article page URL is /article/{id}; request it with Accept: text/markdown for markdown.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/articles/{id}": {
      "get": {
        "operationId": "getArticle",
        "summary": "Fetch an article preview in Arabic and English. Sign in on the website to read the full article.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Article object.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found."
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health/status endpoint.",
        "responses": {
          "200": {
            "description": "Service healthy."
          }
        }
      }
    }
  }
}