تقديم الطلبات
للوصول إلى واجهة برمجة التطبيقات (API)، كل ما عليك فعله هو إرسال طلب HTTP GET إلى نقطة النهاية الصحيحة.
على سبيل المثال، للوصول إلى نقطة النهاية available_translations.json ، يمكنك استخدام أمر JavaScript أو cURL التالي:
::: code-tabsلغة عامية
@tab جافا سكريبت
fetch(`https://bible.helloao.org/api/available_translations.json`)
.then(request => request.json())
.then(availableTranslations => {
console.log('The API has the following translations:', availableTranslations);
});@tab cURL
curl https://bible.helloao.org/api/available_translations.json:::
ستجد أدناه قائمة بالأمثلة. للاطلاع على وثائق أكثر شمولاً، راجع الوثائق المرجعية .
أمثلة
احصل على قائمة الترجمات المتاحة
( مرجع )
GET https://bible.helloao.org/api/available_translations.json
::: code-tabsلغة عامية
@tab جافا سكريبت
fetch(`https://bible.helloao.org/api/available_translations.json`)
.then(request => request.json())
.then(availableTranslations => {
console.log('The API has the following translations:', availableTranslations);
});@tab cURL
curl https://bible.helloao.org/api/available_translations.json:::
قائمة الكتب المترجمة
( مرجع )
GET https://bible.helloao.org/api/{translation}/books.json
::: code-tabsلغة عامية
@tab جافا سكريبت
// احصل على قائمة الكتب لترجمة 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);
});@tab cURL
curl https://bible.helloao.org/api/BSB/books.json:::
احصل على فصل من ترجمة
( مرجع )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.json
::: code-tabsلغة عامية
@tab جافا سكريبت
// احصل على سفر التكوين 1 من ترجمة BSB
fetch(`https://bible.helloao.org/api/BSB/GEN/1.json`)
.then(request => request.json())
.then(chapter => {
console.log('Genesis 1 (BSB):', chapter);
});@tab cURL
curl https://bible.helloao.org/api/BSB/GEN/1.json:::
احصل على فصل مبسط من الترجمة
( مرجع )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.simple.json
استخدم هذا الخيار عندما تريد نص فصلٍ ما فقط. تحتوي كل آية على سلسلة نصية واحدة text بدلاً من قائمة محتوى منسق، لذا لن تحتاج إلى إنشاء النص بنفسك.
::: code-tabsلغة عامية
@tab جافا سكريبت
// احصل على نص سفر التكوين 1 من ترجمة BSB
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}`);
}
}
});@tab cURL
curl https://bible.helloao.org/api/BSB/GEN/1.simple.json:::
احصل على قائمة التعليقات المتاحة
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
fetch(`https://bible.helloao.org/api/available_commentaries.json`)
.then(request => request.json())
.then(availableCommentaries => {
console.log('The API has the following commentaries:', availableCommentaries);
});@tab cURL
curl https://bible.helloao.org/api/available_commentaries.json:::
قائمة الكتب في تعليق
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/c/adam-clarke/books.json:::
احصل على فصل من أحد التعليقات
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/c/adam-clarke/GEN/1.json:::
قائمة بالملفات الشخصية في تعليق
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/c/tyndale/profiles.json:::
احصل على ملف تعريف في تعليق
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/c/tyndale/profiles/aaron.json:::
احصل على قائمة مجموعات البيانات المتاحة
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
fetch(`https://bible.helloao.org/api/available_datasets.json`)
.then(request => request.json())
.then(availableDatasets => {
console.log('The API has the following datasets:', availableDatasets);
});@tab cURL
curl https://bible.helloao.org/api/available_datasets.json:::
احصل على قائمة الكتب في مجموعة البيانات
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/d/open-cross-ref/books.json:::
استخراج فصل من مجموعة بيانات
( مرجع )
::: code-tabsلغة عامية
@tab جافا سكريبت
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);
});@tab cURL
curl https://bible.helloao.org/api/d/open-cross-ref/GEN/1.json:::