{"openapi":"3.0.0","info":{"title":"Lectio API — Revised Common Lectionary, Daily Office, and Catholic Lectionary","version":"1.0.0","description":"Lectio API is a Revised Common Lectionary API, liturgical calendar API, Book of Common Prayer Daily Office API, and Catholic lectionary API. Use GET /api/v1/readings/today for today's readings and GET /api/v1/calendar/current for the current RCL year.","contact":{"name":"API Support","url":"https://github.com/asachs01/lectio-api","email":"api@lectio-api.org"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://lectio-api.org","description":"Production server"},{"url":"https://lectio-api-o6ed3.ondigitalocean.app","description":"DigitalOcean App"},{"url":"http://localhost:3000","description":"Development server"}],"components":{"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string","description":"Error message"},"statusCode":{"type":"integer","description":"HTTP status code"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the error"},"details":{"type":"object","description":"Additional error details (development mode only)"}}}}},"HealthCheck":{"type":"object","properties":{"status":{"type":"string","enum":["healthy","unhealthy"],"description":"Health status of the API"},"timestamp":{"type":"string","format":"date-time","description":"Timestamp of the health check"},"uptime":{"type":"number","description":"Server uptime in seconds"},"environment":{"type":"string","description":"Current environment"},"version":{"type":"string","description":"API version"}}},"LectionaryTradition":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the tradition"},"name":{"type":"string","description":"Name of the lectionary tradition"},"abbreviation":{"type":"string","description":"Common abbreviation for the tradition"},"description":{"type":"string","description":"Description of the tradition"},"startDate":{"type":"string","format":"date","description":"Start date of the tradition calendar"},"endDate":{"type":"string","format":"date","description":"End date of the tradition calendar"}}},"LiturgicalSeason":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the season"},"name":{"type":"string","description":"Name of the liturgical season"},"color":{"type":"string","description":"Liturgical color for the season"},"startDate":{"type":"string","format":"date","description":"Start date of the season"},"endDate":{"type":"string","format":"date","description":"End date of the season"},"traditionId":{"type":"string","description":"ID of the associated tradition"}}},"DailyReading":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the reading"},"date":{"type":"string","format":"date","description":"Date of the reading"},"traditionId":{"type":"string","description":"ID of the associated tradition"},"seasonId":{"type":"string","description":"ID of the associated season"},"readings":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["first","psalm","second","gospel"],"description":"Type of reading"},"citation":{"type":"string","description":"Scripture citation"},"text":{"type":"string","description":"Full text of the reading"}}}}}}}},"tags":[{"name":"Health","description":"Health check and monitoring endpoints for API status"},{"name":"Traditions","description":"Manage and query different lectionary traditions (RCL, Catholic, Episcopal, etc.)"},{"name":"Readings","description":"Retrieve daily scripture readings based on liturgical calendar"},{"name":"Calendar","description":"Access liturgical calendar information including seasons and special days"},{"name":"Search","description":"Search and query scripture passages and liturgical content"}],"paths":{"/api/v1/calendar/current":{"get":{"operationId":"getCurrentCalendar","summary":"Get current liturgical calendar information","description":"Retrieves the current liturgical season, year, and upcoming special days for today's date","tags":["Calendar"],"parameters":[{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}},{"in":"query","name":"tz","description":"IANA time zone used to decide \"today\" (defaults to LECTIO_TIMEZONE or America/New_York)","schema":{"type":"string","example":"America/New_York"}}],"responses":{"200":{"description":"Current liturgical calendar information","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"currentSeason":{"$ref":"#/components/schemas/LiturgicalSeason"},"currentYear":{"type":"integer"},"today":{"type":"string","format":"date"},"upcomingSpecialDays":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"date":{"type":"string","format":"date"},"daysUntil":{"type":"integer"}}}}}}}}}}},"400":{"description":"Invalid tz parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendar/{year}":{"get":{"operationId":"getCalendarByYear","summary":"Get liturgical calendar for a specific year","description":"Retrieves complete liturgical calendar information including all seasons and special days for the specified year","tags":["Calendar"],"parameters":[{"in":"path","name":"year","required":true,"description":"Liturgical year","schema":{"type":"integer"}},{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}}],"responses":{"200":{"description":"Liturgical calendar for the specified year","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"year":{"type":"integer"},"tradition":{"type":"string"},"seasons":{"type":"array","items":{"$ref":"#/components/schemas/LiturgicalSeason"}},"specialDays":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"date":{"type":"string","format":"date"},"type":{"type":"string"}}}}}}}}}}},"400":{"description":"Invalid year","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Calendar not found for the specified year","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/calendar/{year}/seasons":{"get":{"operationId":"getSeasonsByYear","summary":"Get liturgical seasons for a specific year","description":"Retrieves all liturgical seasons (Advent, Christmas, Lent, Easter, etc.) for the specified liturgical year","tags":["Calendar"],"parameters":[{"in":"path","name":"year","required":true,"description":"Liturgical year","schema":{"type":"integer"}},{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}}],"responses":{"200":{"description":"List of liturgical seasons for the year","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LiturgicalSeason"}},"total":{"type":"integer"}}}}}},"400":{"description":"Invalid year","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/readings":{"get":{"operationId":"getReadingsByDate","summary":"Get readings for a specific date","description":"Retrieves all scripture readings (First, Psalm, Second, Gospel) for a specific date according to the specified lectionary tradition","tags":["Readings"],"parameters":[{"in":"query","name":"date","required":true,"description":"Date in YYYY-MM-DD format","schema":{"type":"string","format":"date"}},{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}}],"responses":{"200":{"description":"Daily readings for the specified date","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DailyReading"}}}}}},"400":{"description":"Invalid date format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No readings found for the specified date","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/readings/today":{"get":{"operationId":"getTodaysReadings","summary":"Get today's readings","description":"Retrieves all scripture readings for the current date, including both:\n- **Lectionary readings** (Sunday/special day readings from RCL or other traditions)\n- **Daily Office readings** (morning and evening prayer readings for every day)\n\nOn Sundays, both lectionary and daily office readings are typically available.\nOn weekdays, only daily office readings are available for most traditions.\n","tags":["Readings"],"parameters":[{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}},{"in":"query","name":"tz","description":"IANA time zone used to decide \"today\" (defaults to LECTIO_TIMEZONE or America/New_York)","schema":{"type":"string","example":"America/New_York"}}],"responses":{"200":{"description":"Today's readings (lectionary and/or daily office)","content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","format":"date","description":"Today's date in YYYY-MM-DD format"},"dayOfWeek":{"type":"string","description":"Day of the week (e.g., \"Sunday\", \"Monday\")"},"timeZone":{"type":"string","description":"IANA time zone used to determine today's date"},"tradition":{"type":"string","description":"The lectionary tradition ID"},"lectionary":{"type":"object","description":"Sunday/special day readings (if available)","properties":{"type":{"type":"string","enum":["sunday","special"]},"readings":{"type":"array","items":{"$ref":"#/components/schemas/Reading"}},"seasonId":{"type":"string"}}},"dailyOffice":{"type":"object","description":"Daily office readings for morning and evening prayer","properties":{"morning":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Reading"}},"evening":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/Reading"}}}},"data":{"$ref":"#/components/schemas/DailyReading","description":"Backwards-compatible field (lectionary readings if available, otherwise daily office)"},"timestamp":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Invalid tz parameter","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No readings found for today","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/readings/range":{"get":{"operationId":"getReadingsByDateRange","summary":"Get readings for a date range","description":"Retrieves all scripture readings within a specified date range with pagination support","tags":["Readings"],"parameters":[{"in":"query","name":"start","required":true,"description":"Start date in YYYY-MM-DD format","schema":{"type":"string","format":"date"}},{"in":"query","name":"end","required":true,"description":"End date in YYYY-MM-DD format","schema":{"type":"string","format":"date"}},{"in":"query","name":"tradition","description":"Lectionary tradition ID","schema":{"type":"string","default":"rcl"}},{"in":"query","name":"page","description":"Page number for pagination","schema":{"type":"integer","default":1}},{"in":"query","name":"limit","description":"Number of results per page","schema":{"type":"integer","default":10,"maximum":100}}],"responses":{"200":{"description":"List of readings for the date range","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DailyReading"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}}}}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/readings/daily-office":{"get":{"operationId":"getDailyOfficeReadings","summary":"Get Daily Office readings","description":"Retrieves morning and evening prayer readings for a specific date from the\nBook of Common Prayer (BCP) Daily Office Lectionary.\n\nThis is a two-year cycle of readings used by Episcopal/Anglican churches\nfor weekday Morning and Evening Prayer services.\n\n**Note:** This is the traditional Episcopal/Anglican weekday lectionary,\nNOT the RCL (Revised Common Lectionary) which only has Sunday readings.\n","tags":["Readings"],"parameters":[{"in":"query","name":"date","required":true,"description":"Date in YYYY-MM-DD format","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Daily Office readings for the specified date","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","example":"bcp-daily-2025-12-08"},"date":{"type":"string","format":"date"},"traditionId":{"type":"string","example":"bcp-daily-office"},"readings":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"citation":{"type":"string"},"office":{"type":"string","enum":["morning","evening"]}}}}}},"timestamp":{"type":"string","format":"date-time"}}}}}},"400":{"description":"Invalid date format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No Daily Office readings found for the specified date","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/traditions":{"get":{"operationId":"getAllTraditions","summary":"Get all lectionary traditions","description":"Retrieves a list of all available lectionary traditions.\n\n**Available Traditions:**\n\n| ID | Name | Description |\n|----|------|-------------|\n| `rcl` | Revised Common Lectionary | Three-year Sunday lectionary used by most Protestant denominations |\n| `bcp` | BCP Daily Office Lectionary | Two-year weekday lectionary from the Book of Common Prayer |\n| `episcopal` | Episcopal Church Lectionary | Composite tradition: RCL for Sundays, BCP Daily Office for weekdays |\n| `rc` | Roman Catholic Lectionary | Three-year Sunday lectionary based on the Order of Readings for Mass |\n\n**Note:** The `episcopal` tradition is a virtual/composite tradition that combines\nRCL readings for Sunday worship with BCP Daily Office readings for weekday\nMorning and Evening Prayer.\n","tags":["Traditions"],"responses":{"200":{"description":"List of all available lectionary traditions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LectionaryTradition"}},"total":{"type":"integer","description":"Total number of traditions"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/traditions/{id}":{"get":{"operationId":"getTraditionById","summary":"Get a specific lectionary tradition","description":"Retrieves detailed information about a specific lectionary tradition by its ID or abbreviation.\n\n**Valid IDs:**\n- `rcl` or `RCL` - Revised Common Lectionary\n- `bcp` or `BCP` - BCP Daily Office Lectionary\n- `episcopal` or `ECUSA` - Episcopal Church Lectionary (composite)\n- `rc` or `RC` - Roman Catholic Lectionary\n\nIDs are case-insensitive.\n","tags":["Traditions"],"parameters":[{"in":"path","name":"id","required":true,"description":"Tradition ID or abbreviation (e.g., \"rcl\", \"bcp\", \"episcopal\")","schema":{"type":"string","example":"rcl"}}],"responses":{"200":{"description":"Tradition details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LectionaryTradition"}}}}}},"404":{"description":"Tradition not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/traditions/{id}/seasons":{"get":{"operationId":"getTraditionSeasons","summary":"Get liturgical seasons for a tradition","description":"Retrieves all liturgical seasons (Advent, Christmas, Epiphany, Lent, Easter, Pentecost) for a specific tradition and optional year","tags":["Traditions"],"parameters":[{"in":"path","name":"id","required":true,"description":"Tradition ID","schema":{"type":"string"}},{"in":"query","name":"year","description":"Liturgical year","schema":{"type":"integer"}}],"responses":{"200":{"description":"List of liturgical seasons","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LiturgicalSeason"}},"total":{"type":"integer"}}}}}},"404":{"description":"Tradition not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}