@midvash/bible-data
v0.1.1
Published
TypeScript SDK for bible-data — fetch verses, chapters, and books from 33 public-domain Bible versions in 23 languages.
Maintainers
Readme
@midvash/bible-data
TypeScript / JavaScript SDK for the bible-data dataset.
Fetch verses, chapters, and books from 33 public-domain Bible versions across 23 languages — KJV, ASV, WEB, Almeida 1819, Luther 1912, Segond 1910, Vulgate, Westminster Leningrad Codex, Textus Receptus, and more.
Powered by midvash.com — free Bible reader and study platform.
Install
npm install @midvash/bible-dataRequires Node 18+ (uses fetch). Works in browsers and edge runtimes too.
Usage
import { getVerse, getChapter, getBook, getBible } from '@midvash/bible-data';
// John 3:16 in the KJV
const verse = await getVerse('kjv', 'John', 3, 16);
console.log(verse.text);
// "For God so loved the world, that he gave his only begotten Son..."
// All of John 3 in the WEB
const chapter = await getChapter('web', 'John', 3);
console.log(`${chapter.verses.length} verses`);
// The whole book of Genesis in Latin (Vulgate)
const genesis = await getBook('vulg', 'Gen');
// The full ASV as one object (~5MB)
const bible = await getBible('asv');API
getVerse(slug, osisBook, chapter, verse)
Returns a single { number, text } verse.
getChapter(slug, osisBook, chapter)
Returns { chapter, verses: [...] }.
getBook(slug, osisBook)
Returns the whole book with all chapters.
getBible(slug)
Returns the entire Bible as one large object. Use sparingly — fetch books or chapters when possible.
getVersionMetadata(slug)
Returns metadata: license, year, stats, source URL, attribution.
configure({ baseUrl, fetch })
Override the data host or supply a custom fetch (e.g. for caching, retries, or testing).
import { configure } from '@midvash/bible-data';
// Pin to a specific release for reproducibility
configure({
baseUrl: 'https://raw.githubusercontent.com/midvash/bible-data/v1.0.0',
});Constants
ALL_VERSION_SLUGS— every available version slugVERSIONS_BY_LANGUAGE— grouped by language codeKNOWN_LANGUAGES—['ar', 'cs', 'da', ...]BOOK_IDS— OSIS book code → 1-66 numeric id
Book identifiers
Book parameters use OSIS codes:
Gen Exod Lev Num Deut Josh Judg Ruth
1Sam 2Sam 1Kgs 2Kgs 1Chr 2Chr Ezra Neh
Esth Job Ps Prov Eccl Song Isa Jer
Lam Ezek Dan Hos Joel Amos Obad Jonah
Mic Nah Hab Zeph Hag Zech Mal
Matt Mark Luke John Acts Rom 1Cor 2Cor
Gal Eph Phil Col 1Thess 2Thess 1Tim 2Tim
Titus Phlm Heb Jas 1Pet 2Pet 1John 2John
3John Jude RevAvailable versions
| Lang | Versions |
|------|----------|
| en | kjv, asv, web, geneva1599, dra |
| pt | almeida-livre |
| de | luth1912, elb1905 |
| fr | lsg, darby-fr, martin1744 |
| it | diodati, riveduta |
| nl | dutch1917 |
| ru | synodal |
| uk | kp |
| pl | bg |
| cs | bkr |
| hu | kar |
| ro | vdc |
| da | dansk1931 |
| sv | sv1917 |
| nb | nb1930 |
| eo | lsb |
| zh | cuv, cuvs |
| ar | svd |
| vi | vi1934 |
| he | wlc, aleppo |
| gr | tr |
| la | vulg, clem |
Full licensing details: bible-data/SOURCES.md.
License
MIT — see LICENSE.
The Bible text data fetched by this library follows each version's own free-redistribution license (declared in its metadata.json). All texts in the bible-data dataset are public domain or under a free-redistribution license.
Related
- bible-data — the underlying dataset
- bible-cross-references — curated thematic cross-references
- Midvash — online Bible reader powered by this stack
