গাইড · মন্ত্ৰ
দৈনিক মন্ত্ৰ বা বিশেষ শ্লোক যোগ কৰক
বাছনি কৰা মন্ত্ৰ এটা আনক আৰু তাৰ মূল সংস্কৃত পাঠ আৰু লিপ্যন্তৰ দেখুৱাওক।
এই ৰিকুৱেষ্টটো ছেণ্ডবক্সত চেষ্টা কৰক1 চলি থকা এটা ৰিকুৱেষ্ট কৰক
curl "$MANTRILO_API_URL/v1/mantras/annapurna-aham-vaishvanaro-bhuthva" \
-H "Authorization: Bearer $MANTRILO_API_KEY"{
"data": {
"id": "annapurna-aham-vaishvanaro-bhuthva",
"title": "Aham Vaishvanaro Bhuthva",
"deity": {
"id": "annapurna",
"name": "Lord Annapurna"
},
"category": "Annapurna Stotras",
"source": "Sanatana Shastras",
"description": "Aham Vaishvanaro Bhutva means \"I, having become the universal fire,\" and in Bhagavad Gita 15.14 Krishna says he lives in every body and digests its food. United with the prana and apana breaths, this inner fire cooks the four kinds of food: chewed, swallowed, licked and sucked. Families often say it before a meal to treat eating as an offering.",
"verseCount": 1,
"audio": {
"href": "/v1/mantras/annapurna-aham-vaishvanaro-bhuthva/audio"
},
"verses": [
{
"number": 1,
"title": "Aham Vaishvanaro Bhuthva – Verse 1",
"sanskrit": "अहं वैश्वानरो भूत्वा प्राणिनां देहमाश्रितः\nप्राणापान समायुक्तः पचाम्यन्नं चतुर्विधम्",
"transliteration": "ahaṃ vaiśvānaro bhūtvā prāṇināṃ dehamāśritaḥ\nprāṇāpāna samāyuktaḥ pacāmyannaṃ caturvidham",
"translation": null,
"wordMeanings": []
}
]
},
"sandbox": true
}2 আপোনাৰ ছাৰ্ভাৰৰ পৰা কল কৰক
keyটো আপোনাৰ বেকএণ্ডত ৰাখক আৰু আপোনাৰ এপলৈ কেৱল সমলখিনিহে ঘূৰাই পঠিয়াওক। এই Node.js ছাৰ্ভাৰে এটা ৰুট মুকলি কৰে, যিটো আপোনাৰ এপে কল কৰিব পাৰে।
// server.mjs · Node.js 22+
import { createServer } from 'node:http';
const apiKey = process.env.MANTRILO_API_KEY;
if (!apiKey) throw new Error('Set MANTRILO_API_KEY on your server.');
const base = process.env.MANTRILO_API_URL ?? "https://api.mantrilo.com";
async function mantrilo(path, input) {
const response = await fetch(base + path, {
method: input ? 'POST' : 'GET',
headers: {
Authorization: 'Bearer ' + apiKey,
...(input ? { 'Content-Type': 'application/json' } : {}),
},
...(input ? { body: JSON.stringify(input) } : {}),
signal: AbortSignal.timeout(20000),
redirect: 'error',
});
const result = await response.json();
if (!response.ok) throw Object.assign(new Error('Mantrilo request failed'), {
status: response.status, requestId: result.requestId,
});
return result;
}
async function load(incoming) {
return mantrilo("/v1/mantras/annapurna-aham-vaishvanaro-bhuthva");
}
createServer(async (req, res) => {
const incoming = new URL(req.url, 'http://localhost');
res.setHeader('Content-Type', 'application/json');
if (req.method !== 'GET' || incoming.pathname !== '/api/mantrilo-guide') {
res.writeHead(404).end(JSON.stringify({ error: 'Not found' }));
return;
}
try {
const result = await load(incoming);
res.end(JSON.stringify(result));
} catch (error) {
res.writeHead(error.status ?? 502).end(JSON.stringify({
error: 'Could not load this content',
requestId: error.requestId,
}));
}
}).listen(3000, '127.0.0.1');const featured = { title: data.title, verse: data.verses?.[0] };3 ইনপুট আৰু পেজিনেচন
কেটেলগৰ স্থায়ী id ব্যৱহাৰ কৰক। বিশেষ মন্ত্ৰৰ ID আপোনাৰ এপতে বাছনি বা নিৰ্ধাৰণ কৰক। APIয়ে বাছনি কৰা এণ্ট্ৰিটো যোগান ধৰে।
data.title আৰু verses এৰে দেখুৱাওক। sanskrit আৰু transliteration থাকিলে দেখুৱাওক। translation ফিল্ডটো বৰ্তমান null।
4 কোটা
প্ৰতিটো সফল বিৱৰণ আনোঁতে এটা ৰিকুৱেষ্ট খৰচ হয়। আপোনাৰ বেকএণ্ড কেচত আগৰে পৰা থকা এণ্ট্ৰি পুনৰ ব্যৱহাৰ কৰিলে অতিৰিক্ত ৰিকুৱেষ্ট খৰচ নহয়।
ৰিকুৱেষ্টবোৰে MANTRILO_API_URLৰ পৰা base URL পঢ়ে। ছাৰ্ভাৰৰ উদাহৰণটোৱে বিকল্প হিচাপে https://api.mantrilo.com ব্যৱহাৰ কৰে।
