Table of Contents
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 Title | Verse Range | Section ID |
|---|---|---|
| The Beginning | Genesis 1:1 - Genesis 2:3 | GEN.S1 |
| Adam and Eve | Genesis 2:4 - Genesis 2:25 | GEN.S2 |
| The Fall | Genesis 3:1 - Genesis 3:24 | GEN.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:
| Name | Format | Default | Description |
|---|---|---|---|
content-type | html | json | text | html | Determines the structure of returned verse content |
include-notes | Boolean | false | Returns footnotes in content |
include-titles | Boolean | true | Returns section titles in content |
include-chapter-numbers | Boolean | false | Returns chapter numbers in content |
include-verse-numbers | Boolean | true | Returns verse numbers in content |
include-verse-spans | Boolean | false | Returns spans that wrap verse numbers and verse text in content |
parallels | Comma-separated list of Bible IDs | Returns 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)