This documentation is called to provide an available API for creating a functioning client.
Firstly, to fetch Bible text, you need to get a list of available translations and an object with their books. The translations list contain nodes, which have the next properties:
short_name
field is an id of the translation in database. Use it for forming a url.
full_name
field is a full name of its translation.
The books object (or list) contains books, which contain nodes, which have the next properties:
bookid
field is an id of the book in database.
chronorder
field is a number of the book in chronological order (just a smoll feature).
name
field is a name of this book.
chapters
field is a number of chapters of this book.
Then, using that data, you can form a url for fetching a chapter of certain translation and book. The url constructor is the next:
https://bolls.life/get-text/<slug:translation>/<int:book>/<int:chapter>/
Where <slug:translation>
is a translation abbreviation like YLT
or
UBIO
or SYNOD
, and where <int:book>
and<int:chapter>
is just a number of a book and a number of a chapter. For example by the
next
url you will got an eight chapter of Song of Solomon book:
https://bolls.life/get-text/YLT/22/8/
The result of this request will be a list of verses of that chapter, where every verse will has some several fields.
pk
field is an id of the verse in database.
verse
field is a number of the verse in its chapter.
text
field contains a text of this verse.
NOTE! To fetch a single verse or a few verses of one or more translations use Compare versions API
To find verses by a slug or a string you need to form a url in the next manner:
https://bolls.life/<slug:translation>/<str:piece>/
Where <slug:translation>
is a translation in which you want to find something. The
<str:piece>
is a piece of text which can be a slug or a string which you look for. It is`not
case sensitive, and it can be anything on any language: .../WLC/שָּׁמַ֖יִם וְאֵ֥ת/
, .../LXX/ὁ
θεὸς τὸν/
, .../UBIO/Небо та землю/
, .../CUV/淵 面 黑 暗/
. For example the next url
will returm a list of verses, where "Haggi" word is found:
https://bolls.life/search/YLT/haggi/
The result of this request will be a list of ALL found verses in the given translation, where every verse will has some several fields:
pk
field is an id of the verse in database.
translation
field is a translation in which was the search.
book
field is a book of the verse.
chapter
field is a chapter of the book.
verse
field is a number of the verse in the chapter.
text
field contains a text of this verse.
You can get full translation just quering in hte next manner:
https://bolls.life/static/translations/<slug:translation>.json
The result of it will be an array of all verses, that belongs to the given translation. For example you can try the next link:
https://bolls.life/static/translations/YLT.json
The structure of nodes in this array will be like in the nodes of search query
You can make a request for peculiar verses in peculiar translations. For example if you wanna see some exact
verse or verses in different translation to compare them you can use this api. The request should POST, and you
should pass in the body an object with some fields. The request url -=>
https://bolls.life/get-paralel-verses/
translations
field should be an array of codes of translations like:
JSON.stringify(["YLT", "HOM", "WLCC"])
.
verses
field should be an array of numbers of verses to compare like:
JSON.stringify([1, 2, 3, 6, 45])
(order does mean).
chapter
field should be a chapter of the books.
book
field should be a book of the verses.
Imba example.
window.fetch("/get-paralel-verses/", { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ // Here are list of translations for comparison translations: ['YLT', 'WEB', KJV], // It may be a single verse there [3], or any number of verses, // and if they exist they will be returned verses: [3, 4, 5], book: 43, // an id of the book chapter: 1, // number of chapter }), }) .then(do |response| response.json()) .then(do |resdata| translations_with_verses = resdata console.log console.log )
The result of this request will be an array of translations where every translation is an array of requested verses, where every verse has this fields. Here is the example of the result:
[ [ { "pk": 1145257, "translation": "WLCC", "book": 18, "chapter": 2, "verse": 1, "text": "ויהי היום ויבאו בני האלהים להתיצב על־יהוה ויבוא גם־השטן בתכם להתיצב על־יהוה׃" }, { "pk": 1145258, "translation": "WLCC", "book": 18, "chapter": 2, "verse": 2, "text": "ויאמר יהוה אל־השטן אי מזה תבא ויען השטן את־יהוה ויאמר משט בארץ ומהתהלך בה׃" }, { "pk": 1145259, "translation": "WLCC", "book": 18, "chapter": 2, "verse": 3, "text": "ויאמר יהוה אל־השטן השמת לבך אל־עבדי איוב כי אין כמהו בארץ איש תם וישר ירא אלהים וסר מרע ועדנו מחזיק בתמתו ותסיתני בו לבלעו חנם׃" } ], [ { "pk": 36107, "translation": "YLT", "book": 18, "chapter": 2, "verse": 1, "text": "And the day is, that sons of God come in to station themselves by Jehovah, and there doth come also the Adversary in their midst to station himself by Jehovah." }, { "pk": 36108, "translation": "YLT", "book": 18, "chapter": 2, "verse": 2, "text": "And Jehovah saith unto the Adversary, 'Whence camest thou?' And the Adversary answereth Jehovah and saith, 'From going to and fro in the land, and from walking up and down in it.'" }, { "pk": 36109, "translation": "YLT", "book": 18, "chapter": 2, "verse": 3, "text": "And Jehovah saith unto the Adversary, 'Hast thou set thy heart unto My servant Job because there is none like him in the land, a man perfect and upright, fearing God and turning aside from evil? and still he is keeping hold on his integrity, and thou dost move Me against him to swallow him up for nought!'" } ] ]
You may need this a lot. To fetch a single verse of a few verses of a single translation you should use the compare API as I mantion it above. Just pass the translation code as array with single item, chapter number, book code and array with verse / verses and you will get it.
Imba example.
window.fetch("/get-paralel-verses/", { method: "POST", cache: "no-cache", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ // Here show what translation should it be. You may add there a few translations translations: ['YLT'], // It may be a single verse there [3], or any number of verses, // and if they exist they will be returned verses: [3, 4, 5], book: 43, // an id of the book chapter: 1, // number of chapter }), }) .then(do |response| response.json()) .then(do |resdata| translations_with_verses = resdata console.log console.log )
Here is example of the response. YLT translation, Job (18) 2:6
[ [ { "pk": 36112, "translation": "YLT", "book": 18, "chapter": 2, "verse": 6, "text": "And Jehovah saith unto the Adversary, 'Lo, he [is] in thy hand; only his life take care of.'" } ] ]
As you see it is the same as Compare translation API. More detailes about the fields of this request see the Compare translation API.
</br>
or <i></i>
. Or display the text
as HTML or clean up the text.