freebibleapi
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Bible API

NodeJS wrapper for the Free Bible API service (https://freebibleapi.com)

Installation

Install the library with npm npm install freebibleapi.

Authentication

  1. Sign-up for a free API key at https://freebibleapi.com
  2. Create a .env file with BIBLE_API_KEY=<your api key here> or pass it into the BibleAPI class constructor

Usage

getTranslation

Get a single translation.

const { BibleAPI } = require('freebibleapi');

const bibleApi = new BibleAPI();

const kjvTranslation: Translation = await bibleApi.getTranslation('KJV');

getTranslations

Get a list of currently supported translations.

const { BibleAPI } = require('freebibleapi');

const bibleApi = new BibleAPI();

const translations: Translation[] = await bibleApi.getTranslations();

getBooks

Get a list of all books in a translation.

const { BibleAPI } = require('freebibleapi');

const bibleApi = new BibleAPI();

const books: Book[] = await bibleApi.getBooks('KJV');

getBook

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);

getChapters

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);

getChapter

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);

getVerses

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);

getVerse

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);

Donate

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.

Donate Here

Readme

Keywords

Package Sidebar

Install

npm i freebibleapi

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

25.8 kB

Total Files

36

Last publish

Collaborators

  • jakecyr