An API which scrapes bible websites to get daily verse, and verses.
Note I use
bun
in these examples.npm
will also work if you don't have or want to installbun
First step is of course installing the module
bun install @cvyx/bible
import { getVerse } from 'placeholder';
import { getVerse } from 'placeholder';;
console.log(await getVerseOfTheDay());
{
"citation": "Hebrews 11:1 (NIV)",
"passage": "Now faith is confidence in what we hope for and assurance about what we do not see."
}
import { getVerse } from 'placeholder';
console.log(await getVerse('Luke', '9:55', 'NLT'))
{
"citation": "Luke 9:55 NLT",
"passage": "But Jesus turned and rebuked them.",
"footnotes": "9:55 Some manuscripts add an expanded conclusion to verse 55 and an additional sentence in verse 56: And he said, “You don’t realize what your hearts are like. 56 For the Son of Man has not come to destroy people’s lives, but to save them.”",
}
or alternatively..
import { getVerse } from 'placeholder';
getVerse('Psalms', '22:9-10', 'NIV').then(result => console.log(result));
{
"citation": "Psalms 22:9-10 NIV",
"passage": "Yet you brought me out of the womb; you made me trust in you, even at my mother’s breast. From birth I was cast on you; from my mother’s womb you have been my God.",
}
console.log(await getVerse('John', '1:1-3', "NLT", true))
{
"citation": "John 1:1-3 NLT",
"passage": [ "Prologue: Christ, the Eternal Word", " In the beginning the Word already existed.The Word was with God,and the Word was God.",
" He existed in the beginning with God.", " God created everything through him,and nothing was created except through him."
],
}
Requests return a JSON object and a status code.
Good responses will return a JSON with a citation
and a passage
.
{
"citation": "John 3:16 NLT",
"passage": "For this is how God loved the world: He gave his one and only Son, so that everyone who believes in him will not perish but have eternal life"
}
Trying to access a passage that does not exist will prompt an error message
{
"code": 400,
"message": "Could not find passage Script 9:99 NLT",
}
Checkout https://www.biblegateway.com/versions/
Before creating an issue, please ensure that it hasn't already been reported/suggested.
This project is licensed under the terms of the MIT license.