Skip to content
James Cuénod edited this page Sep 11, 2022 · 8 revisions

Endpoint: /api/v2/text

Parameters

Parameter Description Explanation
modules A case insensitive, comma separated list of module abbreviations. "Modules" are Bible versions, including original languages and modern translations. A list of valid module abbreviations may be found at the module endpoint.
reference A comma separated list of book/chapter/verse references (including ranges). Books currently only include the Protestant canon but Parabible aspires to handle additional literature (e.g., the Apostolic Fathers). The server can parse ranges and comma separated values (e.g., "Gen 2:1–3, Exod 20:1").

Example: /api/v2/text?modules=ULT&reference=Gen2:1-3,exod20:1

Returns

Types for the /text endpoint return are:

type ParallelId = number
type WordArrayString = string
type HtmlString = string

type MatchingText = {
    parallelId: ParallelId
    moduleId: number
    rid: number
    text: WordArrayString | HtmlString
}

type TextEndpointResult = {
    matchingText: MatchingText[]
    order: ParallelId[]
}
Property Description
parallelId A non-consecutive identifier of verses that should be aligned (to solve the various versification differences)
moduleId Module identifier. Modules names/abbreviations may be mapped to module IDs by using data from the module endpoint
rid Reference ids represent book/chapter/verse in an integer. For example 1001001 is Gen 1:1
text WordArrayString or HtmlString string

To display this data, the order key must be used to sort the matchingText.

WordArray

Passing a WordArrayString into JSON.parse will produce WordOrFootnote[] result.

type WordOrFootnote = Word | Footnote

type Word = {
    wid: number,
    leader?: string,
    text: string,
    trailer?: string,
}

type Footnote = {
    fid: number,
    leader?: string,
    text: string,
    trailer?: string,
}
Property Description
wid Module specific word ID. Morphological data about words may be looked up using the word endpoint.
fid Module specific footnote ID. (TODO: Footnote endpoint API is not yet specced).
leader [Optional] String that appears before the word/footnote text and is not a part of the word/footnote (e.g. an opening brackets).
text The text of the word/footnote.
trailer [Optional] String that appears after the word/footnote text and is not a part of the word/footnote (e.g. a closing bracket or a maqqef).
Clone this wiki locally