अनुरोध करना
एपीआई तक पहुंचने के लिए, आपको बस सही एंडपॉइंट पर एक HTTP GET अनुरोध करना होगा।
उदाहरण के लिए, available_translations.json एंडपॉइंट तक पहुंचने के लिए, आप निम्नलिखित जावास्क्रिप्ट या 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
// उत्पत्ति 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 स्ट्रिंग होती है, इसलिए आपको पाठ स्वयं बनाने की आवश्यकता नहीं है।
// उत्पत्ति अध्याय 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