Anfragen stellen
Um auf die API zuzugreifen, müssen Sie lediglich eine HTTP-GET-Anfrage an den entsprechenden Endpunkt senden.
Um beispielsweise auf den Endpunkt available_translations.json zuzugreifen, können Sie den folgenden JavaScript- oder cURL-Befehl verwenden:
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 https://bible.helloao.org/api/available_translations.jsonNachfolgend finden Sie eine Liste mit Beispielen. Eine ausführlichere Dokumentation finden Sie in der Referenzdokumentation .
Beispiele
Liste der verfügbaren Übersetzungen abrufen
( Referenz )
GET https://bible.helloao.org/api/available_translations.json
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 https://bible.helloao.org/api/available_translations.jsonListe der Bücher in einer Übersetzung
( Referenz )
GET https://bible.helloao.org/api/{translation}/books.json
// Holen Sie sich die Liste der Bücher für die BSB-Übersetzung
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 https://bible.helloao.org/api/BSB/books.jsonHolen Sie sich ein Kapitel aus einer Übersetzung
( Referenz )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.json
// Holen Sie sich Genesis 1 aus der BSB-Übersetzung.
fetch(`https://bible.helloao.org/api/BSB/GEN/1.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (BSB):', chapter);
});curl https://bible.helloao.org/api/BSB/GEN/1.jsonHolen Sie sich ein vereinfachtes Kapitel aus einer Übersetzung
( Referenz )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.simple.json
Verwenden Sie diese Funktion, wenn Sie nur den Text eines Kapitels benötigen. Jeder Vers enthält eine einzelne text anstelle einer Liste formatierten Inhalts, sodass Sie den Text nicht selbst erstellen müssen.
// Den Text von Genesis 1 finden Sie in der BSB-Übersetzung.
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 https://bible.helloao.org/api/BSB/GEN/1.simple.jsonListe der verfügbaren Kommentare anzeigen
( Referenz )
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 https://bible.helloao.org/api/available_commentaries.jsonBücher in einem Kommentar auflisten
( Referenz )
const commentary = 'adam-clarke';
// Hier finden Sie die Bücherliste für den Adam-Clarke-Kommentar.
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 https://bible.helloao.org/api/c/adam-clarke/books.jsonLesen Sie ein Kapitel aus einem Kommentar
( Referenz )
const commentary = 'adam-clarke';
const book = 'GEN';
const chapter = 1;
// Holen Sie sich Genesis 1 aus dem Adam-Clarke-Kommentar
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 https://bible.helloao.org/api/c/adam-clarke/GEN/1.jsonListenprofile in einem Kommentar
( Referenz )
const commentary = 'tyndale';
// Hier finden Sie die Liste der Profile für den Tyndale-Kommentator.
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 https://bible.helloao.org/api/c/tyndale/profiles.jsonErhalten Sie ein Profil in einem Kommentar
( Referenz )
const commentary = 'tyndale';
const profile = 'aaron';
// Holen Sie sich das Aaron-Profil aus dem Tyndale-Kommentar.
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 https://bible.helloao.org/api/c/tyndale/profiles/aaron.jsonListe der verfügbaren Datensätze abrufen
( Referenz )
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 https://bible.helloao.org/api/available_datasets.jsonDie Liste der Bücher in einem Datensatz abrufen
( Referenz )
const dataset = 'open-cross-ref';
// Rufen Sie die Liste der Bücher für den Open-Cross-Ref-Datensatz ab.
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 https://bible.helloao.org/api/d/open-cross-ref/books.jsonEin Kapitel aus einem Datensatz abrufen
( Referenz )
const dataset = 'open-cross-ref';
const book = 'GEN';
const chapter = 1;
// Genesis 1 aus dem Open-Cross-Ref-Datensatz abrufen
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 https://bible.helloao.org/api/d/open-cross-ref/GEN/1.json