Free Use Bible API
指南
参考
SDK
GitHub
捐赠
  • English
  • Afrikaans
  • አማርኛ
  • العربية
  • বাংলা
  • Deutsch
  • Español
  • Français
  • Hausa
  • हिन्दी
  • Bahasa Indonesia
  • Italiano
  • 日本語
  • Português
  • Русский
  • Kiswahili
  • اردو
  • 简体中文
  • isiZulu
指南
参考
SDK
GitHub
捐赠
  • English
  • Afrikaans
  • አማርኛ
  • العربية
  • বাংলা
  • Deutsch
  • Español
  • Français
  • Hausa
  • हिन्दी
  • Bahasa Indonesia
  • Italiano
  • 日本語
  • Português
  • Русский
  • Kiswahili
  • اردو
  • 简体中文
  • isiZulu
  • 指南

    • 介绍
    • 入门
    • 提出请求
    • 下载
    • 圣经授权的圣经模式

提出请求

要访问 API,您只需向正确的端点发出 HTTP GET 请求即可。

例如,要访问端点available_translations.json ,可以使用以下 JavaScript 或 cURL 命令:

JavaScript
fetch(`https://bible.helloao.org/api/available_translations.json`)
    .then(request => request.json())
    .then(availableTranslations => {
        console.log('The API has the following translations:', availableTranslations);
    });
cURL
curl https://bible.helloao.org/api/available_translations.json

下面列出了一些示例。如需更完整的文档,请参阅参考文档。

示例

获取可用译文列表

(参考)

GET https://bible.helloao.org/api/available_translations.json

JavaScript
fetch(`https://bible.helloao.org/api/available_translations.json`)
    .then(request => request.json())
    .then(availableTranslations => {
        console.log('The API has the following translations:', availableTranslations);
    });
cURL
curl https://bible.helloao.org/api/available_translations.json

列出翻译书籍

(参考)

GET https://bible.helloao.org/api/{translation}/books.json

JavaScript
// 获取 BSB 翻译所需的书籍列表
fetch(`https://bible.helloao.org/api/BSB/books.json`)
    .then(request => request.json())
    .then(books => {
        console.log('The BSB has the following books:', books);
    });
cURL
curl https://bible.helloao.org/api/BSB/books.json

从翻译中获取章节

(参考)

GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.json

JavaScript
// 从 BSB 译本中获取创世记 1 章
fetch(`https://bible.helloao.org/api/BSB/GEN/1.json`)
    .then(request => request.json())
    .then(chapter => {
        console.log('Genesis 1 (BSB):', chapter);
    });
cURL
curl https://bible.helloao.org/api/BSB/GEN/1.json

从翻译中获取简体章节

(参考)

GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.simple.json

如果您只需要章节文本,请使用此功能。每节经文都包含一个单独的text字符串,而不是格式化的内容列表,因此您无需自己构建文本。

JavaScript
// 请从BSB译本中获取创世记1章的文本。
fetch(`https://bible.helloao.org/api/BSB/GEN/1.simple.json`)
    .then(request => request.json())
    .then(chapter => {
        for (let content of chapter.chapter.content) {
            if (content.type === 'verse') {
                console.log(`${content.number}. ${content.text}`);
            }
        }
    });
cURL
curl https://bible.helloao.org/api/BSB/GEN/1.simple.json

获取可用评论列表

(参考)

JavaScript
fetch-commentaries.js
fetch(`https://bible.helloao.org/api/available_commentaries.json`)
    .then(request => request.json())
    .then(availableCommentaries => {
        console.log('The API has the following commentaries:', availableCommentaries);
    });
cURL
curl https://bible.helloao.org/api/available_commentaries.json

评论中的书目列表

(参考)

JavaScript
fetch-commentary-books.js
const commentary = 'adam-clarke';

// 获取亚当·克拉克评论的书籍清单
fetch(`https://bible.helloao.org/api/c/${commentary}/books.json`)
    .then(request => request.json())
    .then(books => {
        console.log('The adam-clarke commentary has the following books:', books);
    });
cURL
curl https://bible.helloao.org/api/c/adam-clarke/books.json

从评论中获取章节

(参考)

JavaScript
fetch-commentary-chapter.js
const commentary = 'adam-clarke';
const book = 'GEN';
const chapter = 1;

// 从亚当·克拉克注释中获取《创世记》第1章
fetch(`https://bible.helloao.org/api/c/${commentary}/${book}/${chapter}.json`)
    .then(request => request.json())
    .then(chapter => {
        console.log('Genesis 1 (adam-clarke):', chapter);
    });
cURL
curl https://bible.helloao.org/api/c/adam-clarke/GEN/1.json

评论中的人物简介列表

(参考)

JavaScript
fetch-commentary-profiles.js
const commentary = 'tyndale';

// 获取廷代尔评论的个人资料列表
fetch(`https://bible.helloao.org/api/c/${commentary}/profiles.json`)
    .then(request => request.json())
    .then(profiles => {
        console.log('The tyndale commentary has the following profiles:', profiles);
    });
cURL
curl https://bible.helloao.org/api/c/tyndale/profiles.json

在评论中获得个人简介

(参考)

JavaScript
fetch-commentary-profile.js
const commentary = 'tyndale';
const profile = 'aaron';

// 从廷代尔评论中获取亚伦的个人资料
fetch(`https://bible.helloao.org/api/c/${commentary}/profiles/${profile}.json`)
    .then(request => request.json())
    .then(profile => {
        console.log('The Aaron tyndale commentary profile:', profile);
    });
cURL
curl https://bible.helloao.org/api/c/tyndale/profiles/aaron.json

获取可用数据集列表

(参考)

JavaScript
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);
    });
cURL
curl https://bible.helloao.org/api/available_datasets.json

获取数据集中的书籍列表

(参考)

JavaScript
fetch-dataset-books.js
const dataset = 'open-cross-ref';

// 获取开放交叉引用数据集的书籍列表
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);
    });
cURL
curl https://bible.helloao.org/api/d/open-cross-ref/books.json

从数据集中获取章节

(参考)

JavaScript
fetch-dataset-chapter.js
const dataset = 'open-cross-ref';
const book = 'GEN';
const chapter = 1;

// 从开放交叉引用数据集获取创世记1章
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);
    });
cURL
curl https://bible.helloao.org/api/d/open-cross-ref/GEN/1.json
Prev
入门
Next
下载