Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alfonsoolavarria/florilegio/llms.txt

Use this file to discover all available pages before exploring further.

Florilegio’s study interface can display Bible chapters from a curated set of YouVersion translations alongside its primary RV1960 text. These two endpoints act as a thin proxy to the YouVersion Platform API, appending the X-YVP-App-Key header from the server-side YVP_APP_KEY environment variable so that the API key is never exposed to the browser. Both endpoints are publicly accessible and require no user authentication.
YVP_APP_KEY must be set in the application’s .env file (or as an environment variable) for the chapter endpoint to function. Without a valid app key, all requests to /api/youversion/chapter/ will fail with a 503 error from the upstream YouVersion API.

GET /api/youversion/bibles/

Returns the hardcoded list of YouVersion Bible versions supported by Florilegio. This list is defined as the YOUVERSION_BIBLES constant in views_youversion.py and does not require a database query or upstream API call.
GET /api/youversion/bibles/
Authentication: None
Rate limit: None

Response (HTTP 200)

{
  "data": [
    {"id": 103, "name": "Nueva Biblia de las Américas",      "abbreviation": "NBLA"},
    {"id": 147, "name": "Reina-Valera Antigua",               "abbreviation": "RVA"},
    {"id": 128, "name": "Nueva Versión Internacional 2025",   "abbreviation": "NVI-S"},
    {"id": 89,  "name": "La Biblia de las Américas",          "abbreviation": "LBLA"},
    {"id": 2664,"name": "Nueva Versión Internacional 2015",   "abbreviation": "NVI-S"},
    {"id": 3291,"name": "Versión Biblia Libre",               "abbreviation": "VBL"},
    {"id": 3365,"name": "Palabra de Dios para ti",            "abbreviation": "PdDpt"},
    {"id": 4212,"name": "Gloss Spanish",                      "abbreviation": "GlossSP"}
  ]
}
data
array
Array of Bible version objects. Each object contains:
  • id (integer) — The YouVersion Bible ID used as the bible_id parameter in /api/youversion/chapter/.
  • name (string) — Full display name of the Bible version.
  • abbreviation (string) — Short abbreviation used in the UI.

GET /api/youversion/chapter/

Fetches one chapter from the YouVersion Platform API and returns both a parsed verse array and cleaned HTML for rendering. The view constructs a USFM passage ID (e.g., JHN.3) from the book number using the same USFM_MAPPING table used elsewhere in the application.
GET /api/youversion/chapter/
Authentication: None
Rate limit: None (upstream YouVersion API limits apply)

Query Parameters

bible_id
integer
required
YouVersion Bible ID. Use the id values returned by /api/youversion/bibles/ (e.g., 103 for NBLA).
book
integer
required
Bible book number, 1–66. Converted internally to a USFM book code (e.g., 40MAT, 43JHN).
chapter
integer
required
Chapter number within the selected book.

Response (success — HTTP 200)

{
  "status": "success",
  "data": [
    {"versiculo": 1, "texto": "En el principio creó Dios..."},
    {"versiculo": 2, "texto": "Y la tierra estaba..."}
  ],
  "html": "<div class=\"p\" style=\"margin-bottom: 1.25rem;\">...",
  "source": "youversion",
  "reference": "Genesis 1"
}
status
string
Always "success" on a successful response.
data
array
Plain-text verse array parsed from the YouVersion HTML response. Each object has versiculo (integer) and texto (string, HTML tags stripped).
html
string
Cleaned YouVersion HTML suitable for direct injection into the DOM. The cleaning pipeline: removes outer <div> wrappers, replaces <span class="yv-vlbl"> verse number labels with <sup> elements styled with Bootstrap utility classes, and adds margin-bottom inline style to paragraph blocks.
source
string
Always "youversion". Used by the frontend to identify the origin of the chapter data.
reference
string
Human-readable reference string as returned by the YouVersion API (e.g., "Genesis 1"). May be empty if the upstream response does not include a reference field.

Error Responses

HTTP 400 — Missing parameters Returned when one or more of bible_id, book, or chapter are absent from the query string.
{
  "status": "error",
  "message": "Faltan parámetros requeridos (bible_id, book, chapter)."
}
HTTP 400 — Non-integer book value Returned when book cannot be parsed as an integer.
{"status": "error", "message": "book debe ser un número."}
HTTP 400 — Unknown book number Returned when book is a valid integer but does not correspond to a known USFM code (i.e. outside 1–66).
{"status": "error", "message": "Libro no válido: 99"}
HTTP 404 — No verses found Returned when the YouVersion API responds successfully but the HTML parser finds no recognisable verse elements.
{
  "status": "error",
  "message": "No se encontraron versículos en esta selección."
}
HTTP 503 — YouVersion API failure Returned on any upstream network error, SSL error, non-200 status from YouVersion, or malformed JSON response. The youversion_error: true flag allows the frontend to show a Bible-specific error message rather than a generic one.
{
  "status": "error",
  "message": "Hubo un problema con la información de la Biblia. Por favor, intenta más tarde.",
  "youversion_error": true
}

Build docs developers (and LLMs) love