{
  "openapi": "3.0.0",
  "info": {
    "title": "Studify Public API",
    "description": "Public endpoints for accessing university and academic program data, specifically optimized for AI agents.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://www.stud-ify.com/api",
      "description": "Production server"
    }
  ],
  "paths": {
    "/list-universities": {
      "get": {
        "summary": "List universities",
        "description": "Retrieves a paginated list of universities registered on the platform.",
        "responses": {
          "200": {
            "description": "A list of universities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": { "type": "string" },
                      "name": { "type": "string" },
                      "slug": { "type": "string" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/geo": {
      "get": {
        "summary": "Detect country",
        "description": "Returns the visitor's country code based on their IP address (Vercel native).",
        "responses": {
          "200": {
            "description": "Country detection result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "country_code": { "type": "string", "example": "TR" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/agent/markdown": {
      "get": {
        "summary": "Convert HTML to Markdown",
        "description": "Fetches a page and converts its content to clean Markdown. Used primarily by the middleware when Accept: text/markdown is detected.",
        "parameters": [
          {
            "name": "target",
            "in": "query",
            "required": true,
            "description": "The URL to convert to markdown",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown content",
            "content": {
              "text/markdown": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
