API.Bible Logo

Documentation Navigation

Sections

Overview

A Section object represents a known range of verses in the Bible, typically tied to a story. Each Section is accessible via its Section ID, a string consisting of a Book ID and a section number. Not every Bible has sections enabled. For Bibles with sections enabled, sections are sequential and should cover nearly every verse if queried in order. A few examples from the book of Genesis are:

Section TitleVerse RangeSection ID
The BeginningGenesis 1:1 - Genesis 2:3GEN.S1
Adam and EveGenesis 2:4 - Genesis 2:25GEN.S2
The FallGenesis 3:1 - Genesis 3:24GEN.S3

Section Data Structure

Below is the data structure for the Section object, which is returned by all /sections API endpoints

{
"id": "string",
"bibleId": "string",
"bookId": "string",
"chapterId": "string",
"title": "string",
"content": "string",
"verseCount": 0,
"firstVerseId": "string",
"lastVerseId": "string",
"firstVerseOrgId": "string",
"lastVerseOrgId": "string",
"copyright": "string",
"next": {
"id": "string",
"title": "string"
},
"previous": {
"id": "string",
"title": "string"
}
}

Fetching a List of Sections for a Book

GET https://rest.api.bible/v1/bibles/{bibleId}/books/{bookId}/sections

To fetch a list of sections for a book of the Bible, you must send a GET request to the above API endpoint using the appropriate Bible ID and Book ID you would like to fetch. If you are having trouble finding a specific Book ID, try fetching a list of books first.

Note: This endpoint does not return verse content, see Fetching a Single Section to query verse content

Parameters

There are no additional parameters for this endpoint.

Response

Below is the expected output structure from a successful API request:

{
"data": [
{
"id": "string",
"bibleId": "string",
"bookId": "string",
"title": "string",
"firstVerseId": "string",
"lastVerseId": "string",
"firstVerseOrgId": "string",
"lastVerseOrgId": "string"
}
]
}

Code Samples

To make a simple curl request, copy the following snippet and insert your API key, Bible ID, and Book ID:

curl --request GET \
--url https://rest.api.bible/v1/bibles/{bibleId}/books/{bookId}/sections \
--header 'api-key: YOUR_API_KEY'

For a JavaScript application, copy the following function and insert your API key, Bible ID, and Book ID:

const fetchBookSectionsList = async (bibleId, bookId) => {
const url =
"https://rest.api.bible/v1/bibles/${bibleId}/books/${bookId}/sections";
try {
const response = await fetch(url, {
headers: {
"api-key": "YOUR_API_KEY",
},
});
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
const result = await response.json();
console.log(result);
return result;
} catch (error) {
console.error(error.message);
}
};

Note: To protect your API key, it is not recommended to use your API key in a client-side JS application (i.e. React)


Fetching a List of Sections for a Chapter

GET https://rest.api.bible/v1/bibles/{bibleId}/chapters/{chapterId}/sections

To fetch a list of sections for a chapter of the Bible, you must send a GET request to the above API endpoint using the appropriate Bible ID and Chapter ID you would like to fetch. If you are having trouble finding a specific Chapter ID, try fetching a list of chapters first.

Note: This endpoint does not return verse content, see Fetching a Single Section to query verse content

Parameters

There are no additional parameters for this endpoint.

Response

Below is the expected output structure from a successful API request:

{
"data": [
{
"id": "string",
"bibleId": "string",
"bookId": "string",
"title": "string",
"firstVerseId": "string",
"lastVerseId": "string",
"firstVerseOrgId": "string",
"lastVerseOrgId": "string"
}
]
}

Code Samples

To make a simple curl request, copy the following snippet and insert your API key, Bible ID, and Chapter ID:

curl --request GET \
--url https://rest.api.bible/v1/bibles/{bibleId}/chapters/{chapterId}/sections \
--header 'api-key: YOUR_API_KEY'

For a JavaScript application, copy the following function and insert your API key, Bible ID, and Chapter ID:

const fetchChapterSectionsList = async (bibleId, chapterId) => {
const url =
"https://rest.api.bible/v1/bibles/${bibleId}/chapters/${chapterId}/sections";
try {
const response = await fetch(url, {
headers: {
"api-key": "YOUR_API_KEY",
},
});
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
const result = await response.json();
console.log(result);
return result;
} catch (error) {
console.error(error.message);
}
};

Note: To protect your API key, it is not recommended to use your API key in a client-side JS application (i.e. React)


Fetching a Single Section

GET https://rest.api.bible/v1/bibles/{bibleId}/sections/{sectionId}

To fetch information for a single chapter, you must send a GET request to the above API endpoint using the appropriate Bible ID and Section ID you would like to fetch. If you are having trouble finding a specific Section ID, try fetching a list of sections first.

In addition to information about the given chapter, this endpoint will also return all verse content included in that chapter within the content field. Verse content will be configured based on the given input parameters, see our Verse Content guide for more.

Parameters

You can use the following query parameters to alter the results of your request:

NameFormatDefaultDescription
content-typehtml | json | texthtmlDetermines the structure of returned verse content
include-notesBooleanfalseReturns footnotes in content
include-titlesBooleantrueReturns section titles in content
include-chapter-numbersBooleanfalseReturns chapter numbers in content
include-verse-numbersBooleantrueReturns verse numbers in content
include-verse-spansBooleanfalseReturns spans that wrap verse numbers and verse text in content
parallelsComma-separated list of Bible IDsReturns parallel verses from the given Bibles

Response

Below is the expected output structure from a successful API request:

{
"data": {
"id": "string",
"bibleId": "string",
"bookId": "string",
"chapterId": "string",
"title": "string",
"content": "string",
"verseCount": 0,
"firstVerseId": "string",
"lastVerseId": "string",
"firstVerseOrgId": "string",
"lastVerseOrgId": "string",
"copyright": "string",
"next": {
"id": "string",
"title": "string"
},
"previous": {
"id": "string",
"title": "string"
}
},
"meta": {
"fums": "string",
"fumsId": "string",
"fumsJsInclude": "string",
"fumsJs": "string",
"fumsNoScript": "string"
}
}

Code Samples

To make a simple curl request, copy the following snippet and insert your API key and a Section ID:

curl --request GET \
--url https://rest.api.bible/v1/bibles/{bibleId}/sections/{sectionId} \
--header 'api-key: YOUR_API_KEY'

For a JavaScript application, copy the following function and insert your API key and a Section ID:

const fetchSection = async (bibleId, chapterId) => {
const url = `https://rest.api.bible/v1/bibles/${bibleId}/sections/${sectionId}`;
try {
const response = await fetch(url, {
headers: {
"api-key": "YOUR_API_KEY",
},
});
if (!response.ok) {
throw new Error(`Response status: ${response.status}`);
}
const result = await response.json();
console.log(result);
return result;
} catch (error) {
console.error(error.message);
}
};

Note: To protect your API key, it is not recommended to use your API key in a client-side JS application (i.e. React)