NodeJS wrapper for the Free Bible API service (https://freebibleapi.com)
Install the library with npm npm install freebibleapi
.
- Sign-up for a free API key at https://freebibleapi.com
- Create a .env file with
BIBLE_API_KEY=<your api key here>
or pass it into theBibleAPI
class constructor
Get a single translation.
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const kjvTranslation: Translation = await bibleApi.getTranslation('KJV');
Get a list of currently supported translations.
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const translations: Translation[] = await bibleApi.getTranslations();
Get a list of all books in a translation.
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const books: Book[] = await bibleApi.getBooks('KJV');
Get a specific book from the Bible for a chosen translation.
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const genesis: Book = await bibleApi.getBook('KJV', 1);
Get all chapters in a book of the Bible
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const genesisChapters: Chapter[] = await bibleApi.getChapters('KJV', 1);
Get a chapter in a book of the Bible
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const genesisChapterOne: Chapter = await bibleApi.getBookChapter('KJV', 1, 1);
Get the verses in a chapter of the Bible
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const genesisChapterOneVerses: Verse[] = await bibleApi.getVerses('KJV', 1, 1);
Get a verses in a chapter of the Bible
const { BibleAPI } = require('freebibleapi');
const bibleApi = new BibleAPI();
const genesisChapterOneVerseOne: Verse = await bibleApi.getVerse('KJV', 1, 1, 1);
If you like this package and the Free Bible API Service, please think about donating to support server costs and further development on the project.