{
  "openapi": "3.1.0",
  "info": {
    "title": "Agrodigi Public API",
    "description": "API specifications and machine-readable resources for Agrodigi - B2B Agriculture & Seafood Supply Aggregator in North Sumatra, Indonesia.",
    "version": "1.0.0",
    "contact": {
      "name": "Agrodigi Sales & Support",
      "url": "https://agrodigi.com",
      "whatsapp": "+62895326248414"
    }
  },
  "servers": [
    {
      "url": "https://agrodigi.com",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/blog": {
      "get": {
        "summary": "Get Blog Posts",
        "description": "Retrieve public blog posts and educational agricultural articles.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": { "type": "string" },
            "description": "Search term for blog posts"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": { "type": "string" },
            "description": "Filter by category slug"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 1 },
            "description": "Page number"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer", "default": 10 },
            "description": "Items per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "posts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": { "type": "string" },
                          "title": { "type": "string" },
                          "slug": { "type": "string" },
                          "excerpt": { "type": "string" },
                          "publishedAt": { "type": "string", "format": "date-time" }
                        }
                      }
                    },
                    "total": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/api-catalog": {
      "get": {
        "summary": "RFC 9727 API Catalog",
        "description": "Machine-readable linkset catalog of available APIs and documents.",
        "responses": {
          "200": {
            "description": "API Catalog in linkset JSON format",
            "content": {
              "application/linkset+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "linkset": { "type": "array" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "LLMs Context File",
        "description": "Structured markdown file containing business context, pricing, categories, and guidelines for LLMs.",
        "responses": {
          "200": {
            "description": "Text context file",
            "content": {
              "text/plain": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "summary": "XML Sitemap",
        "description": "Full index of pages and blog posts for crawlers and search agents.",
        "responses": {
          "200": {
            "description": "XML Sitemap content",
            "content": {
              "application/xml": {
                "schema": { "type": "string" }
              }
            }
          }
        }
      }
    }
  }
}
