hero
FAST AND SIMPLE BIBLE ACCESS

# API.Bible Typescript SDK

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
Coming Soon: React and Python SDKs
You + 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);

Copy Code Snippet

## Powered by API.Bible

Don't have an account yet? Get started today.

Join API.Bible

## Sail into simplicity with these core features

1 of 6

#### The whole API, in one place

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' },
);

Copy Code Snippet

#### Retries that don't give up

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

Copy Code Snippet

#### Cancel anything, anytime

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

Copy Code Snippet

#### Set your own patience

A global timeout (10s default) enforced with AbortController.

export const client = createBibleClient({
apiKey: process.env.API_BIBLE_API_KEY,
timeout: 5000, //Custom 5s timeout
});

Copy Code Snippet

#### Content your way

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

Copy Code Snippet

#### Bring your own fetch

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

Copy Code Snippet
Sailboat

### Let's put more wind in your sails

Type-safe

⚡︎ Light footprint

Active, ongoing suport

📖 Clear documentation

One-line install

</> Framework agnostic

(˶ᵔ ᵕ ᵔ˶) Beginner friendly

Active community

View the NPM Package

## Ready to Set Sail?

Run this in your project directory and rest easy.

npm install @americanbible/api-bible-sdk
API.Bible

101 North Independence Mall East FL8

Philadelphia, PA 19106-2155

Follow Us
FacebookInstagramLinkedInTwitterYouTube
© 2026 API.Bible. All rights reserved.