free-use-bible-api 0.4.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 AO Lab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 AO Lab
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,269 +1,288 @@
1
- # Free Use Bible API
2
-
3
- TypeScript and JavaScript client for the public Free Use Bible API:
4
-
5
- - `https://bible.helloao.org`
6
-
7
- ## Installation
8
-
9
- ```bash
10
- npm install free-use-bible-api
11
- ```
12
-
13
- ```bash
14
- pnpm add free-use-bible-api
15
- ```
16
-
17
- ```bash
18
- yarn add free-use-bible-api
19
- ```
20
-
21
- ## Quick Start
22
-
23
- ```ts
24
- import { FreeUseBibleApi } from 'free-use-bible-api';
25
-
26
- const api = new FreeUseBibleApi();
27
-
28
- const available = await api.getAvailableTranslations();
29
- console.log('Total translations:', available.translations.length);
30
-
31
- const books = await api.getTranslationBooks('BSB');
32
- console.log('Books in BSB:', books.books.length);
33
-
34
- const chapter = await api.getTranslationBookChapter('BSB', 'GEN', 1);
35
- console.log('Verses in Genesis 1:', chapter.numberOfVerses);
36
- ```
37
-
38
- ## Client Options
39
-
40
- You can customize the client with `FreeUseBibleApiOptions`:
41
-
42
- ```ts
43
- import { FreeUseBibleApi } from 'free-use-bible-api';
44
-
45
- const api = new FreeUseBibleApi({
46
- endpoint: 'https://bible.helloao.org/',
47
- useCache: true,
48
- });
49
- ```
50
-
51
- - `endpoint`: Base API endpoint.
52
- - `useCache`: Enables in-memory response caching (default: `true`).
53
-
54
- ## API Methods
55
-
56
- ### Translations
57
-
58
- - `getAvailableTranslations(endpoint?)`
59
- - `getTranslationBooks(translation, endpoint?)`
60
- - `getTranslationBookChapter(translation, book, chapter, endpoint?)`
61
- - `getTranslationBookChapterWords(translation, book, chapter, endpoint?)`
62
- - `getCompleteTranslation(translation, endpoint?)`
63
- - `getSimpleTranslationBookChapter(translation, book, chapter, endpoint?)`
64
- - `getSimpleTranslationBookChapterWords(translation, book, chapter, endpoint?)`
65
- - `getSimpleCompleteTranslation(translation, endpoint?)`
66
-
67
- `getCompleteTranslation()` and `getSimpleCompleteTranslation()` disable per-request cache internally because payloads are typically large.
68
-
69
- ### Commentaries
70
-
71
- - `getAvailableCommentaries(endpoint?)`
72
- - `getCommentaryBooks(commentary, endpoint?)`
73
- - `getCommentaryBookChapter(commentary, book, chapter, endpoint?)`
74
- - `getSimpleCommentaryBookChapter(commentary, book, chapter, endpoint?)`
75
-
76
- ### Datasets
77
-
78
- - `getAvailableDatasets(endpoint?)`
79
- - `getDatasetBooks(dataset, endpoint?)`
80
- - `getDatasetBookChapter(dataset, book, chapter, endpoint?)` - returns cross references for cross reference datasets, or the people, places, and events that appear in the chapter for entity datasets (such as `theographic`)
81
- - `getDatasetPeople(dataset, endpoint?)`
82
- - `getDatasetPerson(dataset, person, endpoint?)`
83
- - `getDatasetPlaces(dataset, endpoint?)`
84
- - `getDatasetPlace(dataset, place, endpoint?)`
85
- - `getDatasetEvents(dataset, endpoint?)`
86
- - `getDatasetEvent(dataset, event, endpoint?)`
87
- - `getDatasetPeopleGroups(dataset, endpoint?)`
88
- - `getDatasetPeopleGroup(dataset, group, endpoint?)`
89
-
90
- ### Chapter Navigation Helpers
91
-
92
- - `getNextChapter(chapter, endpoint?)`
93
- - `getPreviousChapter(chapter, endpoint?)`
94
-
95
- ### Chapter & Verse Helpers
96
-
97
- - `getVerseText(verse)`
98
- - `getChapterVerseText(chapter)`
99
-
100
- These helpers work with translation, commentary, and dataset chapter responses, as well as simplified translation and commentary chapter responses.
101
-
102
- ### Word Annotations
103
-
104
- Some translations include word-level annotations (Strong's numbers and related source data) for their chapters.
105
-
106
- - `getChapterWords(chapter, endpoint?)` - gets the annotations for a chapter you already loaded, or `null` if it doesn't have any.
107
- - `getWordText(verse, word)` - gets the text that a single annotation applies to.
108
- - `getVerseWords(verse, words)` - gets the annotations for a verse, each paired with the text it applies to.
109
-
110
- Each annotation is anchored to a range of characters in a single item of a verse's `content` array: `contentIndex` is the index of the item, and `start`/`end` are character offsets into that item's text (`end` is exclusive). Anchoring per content item keeps the offsets correct for verses whose content is split into multiple items, such as poem lines and the words of Jesus.
111
-
112
- `getWordText()` and `getVerseWords()` resolve those offsets for you, so you don't have to walk the content array yourself.
113
-
114
- ### Simplified Chapters
115
-
116
- Every translation and commentary chapter can also be fetched in a simplified format, where each verse's content is a single string instead of a list of formatted content. Footnotes, inline headings, the Words of Jesus, and poetry are represented as offset ranges into that string instead of being split across multiple content items.
117
-
118
- - `getSimpleTranslationBookChapter(translation, book, chapter, endpoint?)`
119
- - `getSimpleCommentaryBookChapter(commentary, book, chapter, endpoint?)`
120
- - `getSimpleCompleteTranslation(translation, endpoint?)`
121
- - `getSimpleChapter(chapter, endpoint?)` - follows a chapter's `simpleChapterApiLink`, or `null` if simplified chapters aren't available for it.
122
- - `getSimpleTranslationBookChapterWords(translation, book, chapter, endpoint?)` / `getSimpleChapterWords(chapter, endpoint?)` - the same as the regular word annotations, but with offsets into the simplified verse text instead of a verse's content array.
123
- - `getSimpleWordText(verse, word)` / `getSimpleVerseWords(verse, words)` - the same as `getWordText()`/`getVerseWords()`, but for simplified verses and annotations.
124
- - `getSimpleChapterVerseText(chapter, options?)` - the same as `getChapterVerseText()`, but for a simplified chapter.
125
-
126
- `getNextChapter()` and `getPreviousChapter()` also accept simplified chapters, returning the next/previous simplified chapter.
127
-
128
- Datasets don't have a simplified format.
129
-
130
- ## Examples
131
-
132
- ### Get a complete translation
133
-
134
- ```ts
135
- const complete = await api.getCompleteTranslation('BSB');
136
- console.log(complete.translation.id);
137
- console.log(complete.books.length);
138
- ```
139
-
140
- ### Read a commentary chapter
141
-
142
- ```ts
143
- const comm = await api.getCommentaryBookChapter('matthew_henry', 'GEN', 1);
144
- console.log(comm.book.name);
145
- ```
146
-
147
- ### Read a dataset chapter
148
-
149
- ```ts
150
- const dataChapter = await api.getDatasetBookChapter(
151
- 'cross_references',
152
- 'JHN',
153
- 3
154
- );
155
- console.log(dataChapter.book.name);
156
- ```
157
-
158
- ### Navigate to next/previous chapter
159
-
160
- ```ts
161
- const current = await api.getTranslationBookChapter('BSB', 'GEN', 1);
162
-
163
- const next = await api.getNextChapter(current);
164
- const previous = await api.getPreviousChapter(current);
165
-
166
- console.log(next?.chapter.number);
167
- console.log(previous?.chapter.number);
168
- ```
169
-
170
- ### Read the Strong's numbers for a chapter
171
-
172
- ```ts
173
- const chapter = await api.getTranslationBookChapter('engwebp', 'JHN', 1);
174
- const words = await api.getChapterWords(chapter);
175
-
176
- if (!words) {
177
- // This translation has no word-level annotations for the chapter.
178
- return;
179
- }
180
-
181
- for (const content of chapter.chapter.content) {
182
- if (content.type !== 'verse') {
183
- continue;
184
- }
185
-
186
- for (const word of api.getVerseWords(content, words)) {
187
- console.log(word.text, word.strongs);
188
- }
189
- }
190
-
191
- // In [ 'G1722' ]
192
- // the [ 'G1722' ]
193
- // beginning [ 'G0746' ]
194
- // ...
195
- ```
196
-
197
- ### Read a simplified chapter
198
-
199
- ```ts
200
- const chapter = await api.getSimpleTranslationBookChapter('BSB', 'JHN', 1);
201
-
202
- for (const content of chapter.chapter.content) {
203
- if (content.type !== 'verse') {
204
- continue;
205
- }
206
- console.log(content.number, content.text);
207
- }
208
- ```
209
-
210
- ## Direct HTTP Endpoints
211
-
212
- ### Translation endpoints
213
-
214
- - `GET /api/available_translations.json`
215
- - `GET /api/{translation}/books.json`
216
- - `GET /api/{translation}/{book}/{chapter}.json`
217
- - `GET /api/{translation}/{book}/{chapter}.words.json`
218
- - `GET /api/{translation}/complete.json`
219
- - `GET /api/{translation}/{book}/{chapter}.simple.json`
220
- - `GET /api/{translation}/{book}/{chapter}.words.simple.json`
221
- - `GET /api/{translation}/complete.simple.json`
222
-
223
- ### Commentary endpoints
224
-
225
- - `GET /api/available_commentaries.json`
226
- - `GET /api/c/{commentary}/books.json`
227
- - `GET /api/c/{commentary}/{book}/{chapter}.json`
228
- - `GET /api/c/{commentary}/{book}/{chapter}.simple.json`
229
-
230
- ### Dataset endpoints
231
-
232
- - `GET /api/available_datasets.json`
233
- - `GET /api/d/{dataset}/books.json`
234
- - `GET /api/d/{dataset}/{book}/{chapter}.json`
235
- - `GET /api/d/{dataset}/people.json`
236
- - `GET /api/d/{dataset}/people/{person}.json`
237
- - `GET /api/d/{dataset}/places.json`
238
- - `GET /api/d/{dataset}/places/{place}.json`
239
- - `GET /api/d/{dataset}/events.json`
240
- - `GET /api/d/{dataset}/events/{event}.json`
241
- - `GET /api/d/{dataset}/groups.json`
242
- - `GET /api/d/{dataset}/groups/{group}.json`
243
-
244
- Example requests:
245
-
246
- ```bash
247
- curl https://bible.helloao.org/api/available_translations.json
248
- curl https://bible.helloao.org/api/BSB/books.json
249
- curl https://bible.helloao.org/api/BSB/GEN/1.json
250
- curl https://bible.helloao.org/api/available_commentaries.json
251
- curl https://bible.helloao.org/api/available_datasets.json
252
- ```
253
-
254
- ## Error Handling
255
-
256
- Methods throw on non-2xx responses.
257
-
258
- A 404 response usually means one of the path values is invalid, for example:
259
-
260
- - translation
261
- - commentary
262
- - dataset
263
- - book
264
- - chapter
265
-
266
- ## Notes
267
-
268
- - Uses the global `fetch` API.
269
- - For Node.js, use a runtime that provides `fetch` (Node 18+ recommended) or polyfill it.
1
+ # Free Use Bible API
2
+
3
+ <!-- #region docs -->
4
+
5
+ TypeScript and JavaScript client for the public Free Use Bible API:
6
+
7
+ - `https://bible.helloao.org`
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install free-use-bible-api
13
+ ```
14
+
15
+ ```bash
16
+ pnpm add free-use-bible-api
17
+ ```
18
+
19
+ ```bash
20
+ yarn add free-use-bible-api
21
+ ```
22
+
23
+ ## Quick Start
24
+
25
+ ```ts
26
+ import { FreeUseBibleApi } from 'free-use-bible-api';
27
+
28
+ const api = new FreeUseBibleApi();
29
+
30
+ const available = await api.getAvailableTranslations();
31
+ console.log('Total translations:', available.translations.length);
32
+
33
+ const books = await api.getTranslationBooks('BSB');
34
+ console.log('Books in BSB:', books.books.length);
35
+
36
+ const chapter = await api.getTranslationBookChapter('BSB', 'GEN', 1);
37
+ console.log('Verses in Genesis 1:', chapter.numberOfVerses);
38
+ ```
39
+
40
+ CommonJS is also supported:
41
+
42
+ ```js
43
+ const { FreeUseBibleApi } = require('free-use-bible-api');
44
+
45
+ const api = new FreeUseBibleApi();
46
+ ```
47
+
48
+ ## Client Options
49
+
50
+ You can customize the client with `FreeUseBibleApiOptions`:
51
+
52
+ ```ts
53
+ import { FreeUseBibleApi } from 'free-use-bible-api';
54
+
55
+ const api = new FreeUseBibleApi({
56
+ endpoint: 'https://bible.helloao.org/',
57
+ useCache: true,
58
+ });
59
+ ```
60
+
61
+ - `endpoint`: Base API endpoint.
62
+ - `useCache`: Enables in-memory response caching (default: `true`).
63
+
64
+ ## API Methods
65
+
66
+ ### Translations
67
+
68
+ - `getAvailableTranslations(endpoint?)`
69
+ - `getTranslationBooks(translation, endpoint?)`
70
+ - `getTranslationBookChapter(translation, book, chapter, endpoint?)`
71
+ - `getTranslationBookChapterAudioTimings(translation, book, chapter, reader, endpoint?)`
72
+ - `getTranslationBookChapterWords(translation, book, chapter, endpoint?)`
73
+ - `getCompleteTranslation(translation, endpoint?)`
74
+ - `getSimpleTranslationBookChapter(translation, book, chapter, endpoint?)`
75
+ - `getSimpleTranslationBookChapterWords(translation, book, chapter, endpoint?)`
76
+ - `getSimpleCompleteTranslation(translation, endpoint?)`
77
+
78
+ `getCompleteTranslation()` and `getSimpleCompleteTranslation()` disable per-request cache internally because payloads are typically large.
79
+
80
+ Only some chapters have audio timings. The keys of a chapter's `thisChapterAudioTimings` property identify the readers available to pass to `getTranslationBookChapterAudioTimings()`.
81
+
82
+ The client provides callable methods for all 24 public API operations.
83
+
84
+ ### Commentaries
85
+
86
+ - `getAvailableCommentaries(endpoint?)`
87
+ - `getCommentaryBooks(commentary, endpoint?)`
88
+ - `getCommentaryBookChapter(commentary, book, chapter, endpoint?)`
89
+ - `getSimpleCommentaryBookChapter(commentary, book, chapter, endpoint?)`
90
+
91
+ ### Datasets
92
+
93
+ - `getAvailableDatasets(endpoint?)`
94
+ - `getDatasetBooks(dataset, endpoint?)`
95
+ - `getDatasetBookChapter(dataset, book, chapter, endpoint?)` - returns cross references for cross reference datasets, or the people, places, and events that appear in the chapter for entity datasets (such as `theographic`)
96
+ - `getDatasetPeople(dataset, endpoint?)`
97
+ - `getDatasetPerson(dataset, person, endpoint?)`
98
+ - `getDatasetPlaces(dataset, endpoint?)`
99
+ - `getDatasetPlace(dataset, place, endpoint?)`
100
+ - `getDatasetEvents(dataset, endpoint?)`
101
+ - `getDatasetEvent(dataset, event, endpoint?)`
102
+ - `getDatasetPeopleGroups(dataset, endpoint?)`
103
+ - `getDatasetPeopleGroup(dataset, group, endpoint?)`
104
+
105
+ ### Chapter Navigation Helpers
106
+
107
+ - `getNextChapter(chapter, endpoint?)`
108
+ - `getPreviousChapter(chapter, endpoint?)`
109
+
110
+ ### Chapter & Verse Helpers
111
+
112
+ - `getVerseText(verse)`
113
+ - `getChapterVerseText(chapter)`
114
+
115
+ These helpers work with translation, commentary, and dataset chapter responses, as well as simplified translation and commentary chapter responses.
116
+
117
+ ### Word Annotations
118
+
119
+ Some translations include word-level annotations (Strong's numbers and related source data) for their chapters.
120
+
121
+ - `getChapterWords(chapter, endpoint?)` - gets the annotations for a chapter you already loaded, or `null` if it doesn't have any.
122
+ - `getWordText(verse, word)` - gets the text that a single annotation applies to.
123
+ - `getVerseWords(verse, words)` - gets the annotations for a verse, each paired with the text it applies to.
124
+
125
+ Each annotation is anchored to a range of characters in a single item of a verse's `content` array: `contentIndex` is the index of the item, and `start`/`end` are character offsets into that item's text (`end` is exclusive). Anchoring per content item keeps the offsets correct for verses whose content is split into multiple items, such as poem lines and the words of Jesus.
126
+
127
+ `getWordText()` and `getVerseWords()` resolve those offsets for you, so you don't have to walk the content array yourself.
128
+
129
+ ### Simplified Chapters
130
+
131
+ Every translation and commentary chapter can also be fetched in a simplified format, where each verse's content is a single string instead of a list of formatted content. Footnotes, inline headings, the Words of Jesus, and poetry are represented as offset ranges into that string instead of being split across multiple content items.
132
+
133
+ - `getSimpleTranslationBookChapter(translation, book, chapter, endpoint?)`
134
+ - `getSimpleCommentaryBookChapter(commentary, book, chapter, endpoint?)`
135
+ - `getSimpleCompleteTranslation(translation, endpoint?)`
136
+ - `getSimpleChapter(chapter, endpoint?)` - follows a chapter's `simpleChapterApiLink`, or `null` if simplified chapters aren't available for it.
137
+ - `getSimpleTranslationBookChapterWords(translation, book, chapter, endpoint?)` / `getSimpleChapterWords(chapter, endpoint?)` - the same as the regular word annotations, but with offsets into the simplified verse text instead of a verse's content array.
138
+ - `getSimpleWordText(verse, word)` / `getSimpleVerseWords(verse, words)` - the same as `getWordText()`/`getVerseWords()`, but for simplified verses and annotations.
139
+ - `getSimpleChapterVerseText(chapter, options?)` - the same as `getChapterVerseText()`, but for a simplified chapter.
140
+
141
+ `getNextChapter()` and `getPreviousChapter()` also accept simplified chapters, returning the next/previous simplified chapter.
142
+
143
+ Datasets don't have a simplified format.
144
+
145
+ ## Examples
146
+
147
+ ### Get a complete translation
148
+
149
+ ```ts
150
+ const complete = await api.getCompleteTranslation('BSB');
151
+ console.log(complete.translation.id);
152
+ console.log(complete.books.length);
153
+ ```
154
+
155
+ ### Read a commentary chapter
156
+
157
+ ```ts
158
+ const comm = await api.getCommentaryBookChapter('matthew_henry', 'GEN', 1);
159
+ console.log(comm.book.name);
160
+ ```
161
+
162
+ ### Read a dataset chapter
163
+
164
+ ```ts
165
+ const dataChapter = await api.getDatasetBookChapter(
166
+ 'cross_references',
167
+ 'JHN',
168
+ 3
169
+ );
170
+ console.log(dataChapter.book.name);
171
+ ```
172
+
173
+ ### Navigate to next/previous chapter
174
+
175
+ ```ts
176
+ const current = await api.getTranslationBookChapter('BSB', 'GEN', 1);
177
+
178
+ const next = await api.getNextChapter(current);
179
+ const previous = await api.getPreviousChapter(current);
180
+
181
+ console.log(next?.chapter.number);
182
+ console.log(previous?.chapter.number);
183
+ ```
184
+
185
+ ### Read the Strong's numbers for a chapter
186
+
187
+ ```ts
188
+ const chapter = await api.getTranslationBookChapter('engwebp', 'JHN', 1);
189
+ const words = await api.getChapterWords(chapter);
190
+
191
+ if (!words) {
192
+ // This translation has no word-level annotations for the chapter.
193
+ return;
194
+ }
195
+
196
+ for (const content of chapter.chapter.content) {
197
+ if (content.type !== 'verse') {
198
+ continue;
199
+ }
200
+
201
+ for (const word of api.getVerseWords(content, words)) {
202
+ console.log(word.text, word.strongs);
203
+ }
204
+ }
205
+
206
+ // In [ 'G1722' ]
207
+ // the [ 'G1722' ]
208
+ // beginning [ 'G0746' ]
209
+ // ...
210
+ ```
211
+
212
+ ### Read a simplified chapter
213
+
214
+ ```ts
215
+ const chapter = await api.getSimpleTranslationBookChapter('BSB', 'JHN', 1);
216
+
217
+ for (const content of chapter.chapter.content) {
218
+ if (content.type !== 'verse') {
219
+ continue;
220
+ }
221
+ console.log(content.number, content.text);
222
+ }
223
+ ```
224
+
225
+ ## Direct HTTP Endpoints
226
+
227
+ ### Translation endpoints
228
+
229
+ - `GET /api/available_translations.json`
230
+ - `GET /api/{translation}/books.json`
231
+ - `GET /api/{translation}/{book}/{chapter}.json`
232
+ - `GET /api/{translation}/{book}/{chapter}.{reader}.audioTimings.json`
233
+ - `GET /api/{translation}/{book}/{chapter}.words.json`
234
+ - `GET /api/{translation}/complete.json`
235
+ - `GET /api/{translation}/{book}/{chapter}.simple.json`
236
+ - `GET /api/{translation}/{book}/{chapter}.words.simple.json`
237
+ - `GET /api/{translation}/complete.simple.json`
238
+
239
+ ### Commentary endpoints
240
+
241
+ - `GET /api/available_commentaries.json`
242
+ - `GET /api/c/{commentary}/books.json`
243
+ - `GET /api/c/{commentary}/{book}/{chapter}.json`
244
+ - `GET /api/c/{commentary}/{book}/{chapter}.simple.json`
245
+
246
+ ### Dataset endpoints
247
+
248
+ - `GET /api/available_datasets.json`
249
+ - `GET /api/d/{dataset}/books.json`
250
+ - `GET /api/d/{dataset}/{book}/{chapter}.json`
251
+ - `GET /api/d/{dataset}/people.json`
252
+ - `GET /api/d/{dataset}/people/{person}.json`
253
+ - `GET /api/d/{dataset}/places.json`
254
+ - `GET /api/d/{dataset}/places/{place}.json`
255
+ - `GET /api/d/{dataset}/events.json`
256
+ - `GET /api/d/{dataset}/events/{event}.json`
257
+ - `GET /api/d/{dataset}/groups.json`
258
+ - `GET /api/d/{dataset}/groups/{group}.json`
259
+
260
+ Example requests:
261
+
262
+ ```bash
263
+ curl https://bible.helloao.org/api/available_translations.json
264
+ curl https://bible.helloao.org/api/BSB/books.json
265
+ curl https://bible.helloao.org/api/BSB/GEN/1.json
266
+ curl https://bible.helloao.org/api/available_commentaries.json
267
+ curl https://bible.helloao.org/api/available_datasets.json
268
+ ```
269
+
270
+ ## Error Handling
271
+
272
+ Methods throw on non-2xx responses.
273
+
274
+ A 404 response usually means one of the path values is invalid, for example:
275
+
276
+ - translation
277
+ - commentary
278
+ - dataset
279
+ - book
280
+ - chapter
281
+
282
+ ## Notes
283
+
284
+ - Uses the global `fetch` API.
285
+ - For Node.js, use a runtime that provides `fetch` (Node 18+ recommended) or polyfill it.
286
+
287
+ <!-- #endregion docs -->
288
+