{
  "openapi": "3.0.3",
  "info": {
    "title": "Gita Scroller API",
    "version": "1.0.0",
    "description": "Bhagavad Gita: daily verses, plans, search and verse lookup",
    "contact": {
      "email": "hello@askmizan.com"
    }
  },
  "servers": [
    {
      "url": "https://scripturescroller.pages.dev/gita/v1"
    }
  ],
  "paths": {
    "/today": {
      "get": {
        "operationId": "getToday",
        "summary": "Today's reading, line by line (same as the app shows today)",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Optional day as YYYY-MM-DD. Defaults to today (UTC)."
          }
        ],
        "responses": {
          "200": {
            "description": "The reading"
          }
        }
      }
    },
    "/readings": {
      "get": {
        "operationId": "listReadings",
        "summary": "All curated daily readings and plans",
        "responses": {
          "200": {
            "description": "List"
          }
        }
      }
    },
    "/readings/{id}": {
      "get": {
        "operationId": "getReading",
        "summary": "One reading or plan, line by line",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The reading"
          },
          "404": {
            "description": "Unknown id"
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchReadings",
        "summary": "Search the curated readings",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching lines"
          }
        }
      }
    },
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Service status",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/verse/{chapter}/{verse}": {
      "get": {
        "operationId": "getVerse",
        "summary": "A verse or range (e.g. 47-51) in Sanskrit with transliteration",
        "parameters": [
          {
            "name": "chapter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 18
            }
          },
          {
            "name": "verse",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "47-51"
          }
        ],
        "responses": {
          "200": {
            "description": "Verses"
          }
        }
      }
    },
    "/chapter/{chapter}": {
      "get": {
        "operationId": "getChapter",
        "summary": "A whole chapter in Sanskrit with transliteration",
        "parameters": [
          {
            "name": "chapter",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 18
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verses"
          }
        }
      }
    }
  }
}