Skip to content

BibleService Examples

Paceaux edited this page Jul 7, 2021 · 1 revision

Getting Bibles

Before getting verses, chapters, or passages, you need a bibleId. The only way to know that is to look at all of the Bibles, first.

Get all Bibles

async function doThings() {
  const bibles = await service.getBibles();

}

Get Bibles with options

async function doThings() {
  const bibles = await service.getBibles({
    language: 'eng'
  });

}

Get One Bible

Once you've found a bibleId, you can get some information on it.

async function doThings() {
  const bible = await service.getBible('06125adad2d5898a-01');

}

Getting Books

About bookId:

A bookId is typically the first 3-letters of the name of a book.

e.g.

  • Exodus => EXO
  • Mark => MAR

Get all books from a Bible (no options)

  • Request Options
  • Response (an array)
  • A Single parameter can be passed, an object, containing id for bibleId with additional options. Here, all that's passed is the bibleId as a string.
async function doThings() {
  const books = await service.getBooks('06125adad2d5898a-01');

}

Get all books from a Bible (with options)

  • Request Options
  • Response (an array)
  • A Single parameter can be passed, an object, containing id for bibleId with additional options. includeChapters is an option that's passed in.
async function doThings() {
  const books = await service.getBooks({ 
    id: '06125adad2d5898a-01'
    includeChapters: true,
    });

}

Getting Chapters

About chapterId:

  1. Take the three-letter abbrevation ( EXO)
  2. Add a .
  3. Then add the number

e.g.

  • Exodus 1 => EXO.1
  • Mark 8 => MAR.8

Get all chapters from a book

  • Request Options
  • Response (an array)
  • A Single parameter can be passed, an object, containing id for bibleId and bookId with additional options.
async function doThings() {
  const exodusChapters = await service.getChaptersFromBook('c315fa9f71d4af3a-01', 'EXO');
}

Get one chapter

  • Request Options
  • Response
  • A Single parameter can be passed, an object, containing id for bibleId and chapterId with additional options.
async function doThings(){
  const chapter = service.getChapter('c315fa9f71d4af3a-01', 'EXO.1');
}

Getting Verses

About verseId:

  1. Take the chapterId ( EXO.1)
  2. Add a .
  3. Then add the number

e.g.

  • Exodus 1:1 => EXO.1.1
  • Mark 8:8 => MAR.8.8

Get all verses from a chapter

Note that this will not give you the content of the verses. It may be useful, however, in getting verseIds

async function doThings(){
  const chapter = service.getVersesFromChapter('c315fa9f71d4af3a-01', 'EXO.1');
}

Get one verse

  • Request Options
  • Response
  • A Single parameter can be passed, an object, containing id for bibleId and verseId with additional options.

Note that This only returns one verse, for multiples you want a passage.

async function doThings(){
  const chapter = service.getVerse('c315fa9f71d4af3a-01', 'EXO.1.1');
}

Get Range of verses

Note: This is an alias for getPassage()

async function doThings(){
  const chapter = service.getPassage('c315fa9f71d4af3a-01', 'EXO.1.1-EXO.1.20');
}

Getting Passages

About verseId:

  1. Take the verseId ( EXO.1.1)
  2. Add a -
  3. Then add the verseId for the last verse

e.g.

  • Exodus 1:1-20 => EXO.1.1-EXO.1.20
  • Mark 8:8-14 => MAR.8.8-MAR.8.14

Get one passage

  • Request Options
  • Response
  • A Single parameter can be passed, an object, containing id for bibleId and passageId with additional options.
async function doThings(){
  const chapter = service.getPassage('c315fa9f71d4af3a-01', 'EXO.1.1-EXO.1.20');
}