Table of Contents
Overview
A Chapter object represents a single chapter of the Bible. Each Chapter is accessible via its Chapter ID, a string consisting of a Book ID and a chapter number. A few examples are:
| Chapter | Chapter ID |
|---|---|
| Genesis 1 | GEN.1 |
| John 3 | JHN.3 |
| Revelation 22 | REV.22 |
Chapter Data Structure
Below is the data structure for the Chapter object, which is returned by all /chapters API endpoints
{"id": "string","bibleId": "string","number": "string","bookId": "string","content": "string","reference": "string","verseCount": 0,"next": {"id": "string","bookId": "string","number": "string"},"previous": {"id": "string","bookId": "string","number": "string"},"copyright": "string"}
Fetching a List of Chapters for a Book
GET https://rest.api.bible/v1/bibles/{bibleId}/books/{bookId}/chapters
To fetch a list of chapters 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.
You may also use the /books endpoint to fetch chapter data using the include-chapters query parameter. For more, see our guide on
Fetching a List of Books for a Bible.
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","number": "string","bookId": "string","reference": "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}/chapters \--header 'api-key: YOUR_API_KEY'
For a JavaScript application, copy the following function and insert your API key:
const fetchChapterList = async (bibleId, bookId) => {const url ="https://rest.api.bible/v1/bibles/${bibleId}/books/${bookId}/chapters";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 Chapter
GET https://rest.api.bible/v1/bibles/{bibleId}/chapters/{chapterId}
To fetch information for a single chapter, 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.
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","number": "string","bookId": "string","content": "string","reference": "string","verseCount": 0,"next": {"id": "string","bookId": "string","number": "string"},"previous": {"id": "string","bookId": "string","number": "string"},"copyright": "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 Chapter ID:
curl --request GET \--url https://rest.api.bible/v1/bibles/{bibleId}/chapters/{chapterId} \--header 'api-key: YOUR_API_KEY'
For a JavaScript application, copy the following function and insert your API key and a Chapter ID:
const fetchChapter = async (bibleId, chapterId) => {const url = `https://rest.api.bible/v1/bibles/${bibleId}/chapters/${chapterId}`;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)