Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ These files are available at the following paths:
- [`https://bible.helloao.org/api/available_commentaries.json`](../reference/README.md#available-commentaries)
- [`https://bible.helloao.org/api/c/{commentary}/books.json`](../reference/README.md#list-books-in-a-commentary)
- [`https://bible.helloao.org/api/c/{commentary}/{book}/{chapter}.json`](../reference/README.md#get-a-chapter-from-a-commentary)
- [`https://bible.helloao.org/api/available_datasets.json`](../reference/README.md#available-datasets)
- [`https://bible.helloao.org/api/d/{dataset}/books.json`](../reference/README.md#list-books-in-a-dataset)
- [`https://bible.helloao.org/api/d/{dataset}/{book}/{chapter}.json`](../reference/README.md#get-a-chapter-from-a-dataset)

For more information about each endpoint, see the [next page](./making-requests.md).
48 changes: 46 additions & 2 deletions docs/guide/making-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fetch(`https://bible.helloao.org/api/c/${commentary}/${book}/${chapter}.json`)
});
```

## List Profiles in a Commentary
### List Profiles in a Commentary

([reference](../reference/README.md#list-profiles-in-a-commentary))

Expand All @@ -119,7 +119,7 @@ fetch(`https://bible.helloao.org/api/c/${commentary}/profiles.json`)
});
```

## Get a Profile in a Commentary
### Get a Profile in a Commentary

([reference](../reference/README.md#get-a-profile-in-a-commentary))

Expand All @@ -134,3 +134,47 @@ fetch(`https://bible.helloao.org/api/c/${commentary}/profiles/${profile}.json`)
console.log('The Aaron tyndale commentary profile:', profile);
});
```

### Get the list of Available Datasets

([reference](../reference/README.md#available-datasets))

```ts:no-line-numbers title="fetch-datasets.js"
fetch(`https://bible.helloao.org/api/available_datasets.json`)
.then(request => request.json())
.then(availableDatasets => {
console.log('The API has the following datasets:', availableDatasets);
});
```

### Get the list of books in a dataset

([reference](../reference/README.md#list-books-in-a-dataset))

```ts:no-line-numbers title="fetch-dataset-books.js"
const dataset = 'open-cross-ref';

// Get the list of books for the open-cross-ref dataset
fetch(`https://bible.helloao.org/api/d/${dataset}/books.json`)
.then(request => request.json())
.then(books => {
console.log('The open-cross-ref dataset has the following books:', books);
});
```

### Get a Chapter from a Dataset

([reference](../reference/README.md#get-a-chapter-from-a-dataset))

```ts:no-line-numbers title="fetch-dataset-chapter.js"
const dataset = 'open-cross-ref';
const book = 'GEN';
const chapter = 1;

// Get Genesis 1 from the open-cross-ref dataset
fetch(`https://bible.helloao.org/api/d/${dataset}/${book}/${chapter}.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (open-cross-ref):', chapter);
});
```
Loading