
Create your dream app faster and simpler with our Typescript SDK: type-safe access to your API.Bible account’s Bibles, books, chapters, verses, passages, audio content, and search.
npm install @americanbible/api-bible-sdk// > Get started in 20 lines \(^O^)/
// > Pour coffee, change the world (• ◡•)
const { createBibleClient } = require('@americanbible/api-bible-sdk');
const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
});
// List all available Bibles
const { data: bibles } = await client.bibles.list();
console.log(bibles.map((b) => `${b.id} — ${b.name}`));
// Get a specific chapter (KJV Genesis 1)
const { data: chapter } = await client.chapters.get(
'de4e12af7f28f599-02', // Bible ID
'GEN.1', // Chapter ID
{ contentType: 'text', includeVerseNumbers: true },
);
console.log(chapter.content);
const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
});
//List available Bibles
const { data: bibles } = await client.bibles.list();
//List books for a Bible
const { data: books } = await client.books.list('de4e12af7f28f599-02');
//List chapters for a book
const { data: chapters } = await client.chapters.list(
'de4e12af7f28f599-02',
'GEN',
);
//List Verses for a chapter
const { data: verses } = await client.verses.list(
'de4e12af7f28f599-02',
'GEN.1',
);
//Fetch a passage from a Bible
const { data: passage } = await client.passages.get(
'de4e12af7f28f599-02',
'GEN.1.1-GEN.2.1',
);
//Search a Bible
const { data: searchResults } = await client.search.search(
'de4e12af7f28f599-02',
{ query: 'Aaron' },
);
Bibles, books, chapters, verses, passages, sections, audioBibles, and search, all covered.
Backs off with full jitter on 429/5xx, transport failures, and timeouts, honoring Retry-After.
Pass an optional AbortSignal to any method.
A global timeout (10s default) enforced with AbortController.
Pull passages back as html, json, or plain text.
Swap in a custom implementation for tests or edge runtimes.
1 of 6
Bibles, books, chapters, verses, passages, sections, audioBibles, and search, all covered.
const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
});
//List available Bibles
const { data: bibles } = await client.bibles.list();
//List books for a Bible
const { data: books } = await client.books.list('de4e12af7f28f599-02');
//List chapters for a book
const { data: chapters } = await client.chapters.list(
'de4e12af7f28f599-02',
'GEN',
);
//List Verses for a chapter
const { data: verses } = await client.verses.list(
'de4e12af7f28f599-02',
'GEN.1',
);
//Fetch a passage from a Bible
const { data: passage } = await client.passages.get(
'de4e12af7f28f599-02',
'GEN.1.1-GEN.2.1',
);
//Search a Bible
const { data: searchResults } = await client.search.search(
'de4e12af7f28f599-02',
{ query: 'Aaron' },
);
Backs off with full jitter on 429/5xx, transport failures, and timeouts, honoring Retry-After.
const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
retry: {
maxAttempts: 5, //Max 5 attempts
baseDelayMs: 1000, //Initial backoff delay of 1s
maxDelayMs: 60_000, //Maximum backoff delay of 60s
},
});
Pass an optional AbortSignal to any method.
export const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
});
//Create new AbortController
const controller = new AbortController();
//Set AbortController to cancel after 5 seconds
setTimeout(() => controller.abort(), 5000);
try {
const { data: chapters } = await client.chapters.get(
'de4e12af7f28f599-02',
'GEN.1',
{ contentType: 'text' },
controller.signal, //Pass abort controller alongside request
);
} catch (err) {
//Handle error thrown by AbortController
if (err instanceof DOMException && err.name === 'AbortError') {
console.log('Request cancelled');
}
}
A global timeout (10s default) enforced with AbortController.
export const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
timeout: 5000, //Custom 5s timeout
});
Pull passages back as html, json, or plain text.
export const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
});
//Fetch JSON verse content
const { data: jsonContent } = await client.verses.get(
'de4e12af7f28f599-02',
'GEN.1.1',
{ contentType: 'json' },
);
console.log(jsonContent.content);
//Fetch HTML verse content
const { data: htmlContent } = await client.verses.get(
'de4e12af7f28f599-02',
'GEN.1.1',
{ contentType: 'html' },
);
console.log(htmlContent.content);
//Fetch plaintext verse content
const { data: textContent } = await client.verses.get(
'de4e12af7f28f599-02',
'GEN.1.1',
{ contentType: 'text' },
);
console.log(textContent.content);
Swap in a custom implementation for tests or edge runtimes.
export const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
//Configure custom fetch implementation
fetch: async (url, init) => {
console.log('→', url);
return globalThis.fetch(url, init);
},
});

✔ Type-safe
⚡︎ Light footprint
ⓘ Active, ongoing suport
📖 Clear documentation
⛯ One-line install
</> Framework agnostic
(˶ᵔ ᵕ ᵔ˶) Beginner friendly
♡ Active community
Run this in your project directory and rest easy.
npm install @americanbible/api-bible-sdk
101 North Independence Mall East FL8
Philadelphia, PA 19106-2155