درخواستیں کرنا
API تک رسائی حاصل کرنے کے لیے، آپ کو صرف صحیح اختتامی نقطہ پر HTTP GET درخواست کرنے کی ضرورت ہے۔
مثال کے طور پر، available_translations.json اینڈ پوائنٹ تک رسائی حاصل کرنے کے لیے، آپ درج ذیل JavaScript یا cURL کمانڈ استعمال کر سکتے ہیں:
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.jsonذیل میں آپ کو مثالوں کی فہرست مل سکتی ہے۔ مزید مکمل دستاویزات کے لیے، حوالہ دستاویزات دیکھیں۔
مثالیں
دستیاب تراجم کی فہرست حاصل کریں۔
( حوالہ )
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.jsonترجمہ میں کتابوں کی فہرست بنائیں
( حوالہ )
GET https://bible.helloao.org/api/{translation}/books.json
// بی ایس بی ترجمہ کے لیے کتابوں کی فہرست حاصل کریں۔
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.jsonترجمہ سے ایک باب حاصل کریں۔
( حوالہ )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.json
// 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 https://bible.helloao.org/api/BSB/GEN/1.jsonترجمہ سے ایک آسان باب حاصل کریں۔
( حوالہ )
GET https://bible.helloao.org/api/{translation}/{book}/{chapter}.simple.json
جب آپ صرف ایک باب کا متن چاہتے ہو تو اسے استعمال کریں۔ ہر آیت میں فارمیٹ شدہ مواد کی فہرست کے بجائے ایک واحد text سٹرنگ ہوتا ہے، لہذا آپ کو خود سے متن بنانے کی ضرورت نہیں ہے۔
// 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 https://bible.helloao.org/api/BSB/GEN/1.simple.jsonدستیاب تبصروں کی فہرست حاصل کریں۔
( حوالہ )
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.jsonایک تفسیر میں کتابوں کی فہرست بنائیں
( حوالہ )
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 https://bible.helloao.org/api/c/adam-clarke/books.jsonتفسیر سے ایک باب حاصل کریں۔
( حوالہ )
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 https://bible.helloao.org/api/c/adam-clarke/GEN/1.jsonکمنٹری میں پروفائلز کی فہرست بنائیں
( حوالہ )
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 https://bible.helloao.org/api/c/tyndale/profiles.jsonکمنٹری میں پروفائل حاصل کریں۔
( حوالہ )
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 https://bible.helloao.org/api/c/tyndale/profiles/aaron.jsonدستیاب ڈیٹا سیٹس کی فہرست حاصل کریں۔
( حوالہ )
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.jsonڈیٹا سیٹ میں کتابوں کی فہرست حاصل کریں۔
( حوالہ )
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 https://bible.helloao.org/api/d/open-cross-ref/books.jsonڈیٹا سیٹ سے ایک باب حاصل کریں۔
( حوالہ )
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 https://bible.helloao.org/api/d/open-cross-ref/GEN/1.json