Scripture-grounded AI answers for your applications.
https://shruti-production.up.railway.app/api/v1Currently indexed scriptures. Use the slug when making requests.
| Name | Slug | Tradition | Verses |
|---|---|---|---|
| Bhagavad Gita | bhagavad-gita | Hinduism | 701 |
| Quran | quran | Islam | 6,236 |
| Bible (KJV) | bible-kjv | Christianity | 31,100 |
| Valmiki Ramayana | valmiki-ramayana | Hinduism | 23,402 |
| Book of Mormon | book-of-mormon | Christianity (LDS) | 6,604 |
| Hanuman Chalisa | hanuman-chalisa | Hinduism | 42 |
| Guru Granth Sahib | guru-granth-sahib | Sikhism | 60,403 |
| Dhammapada | dhammapada | Buddhism | 423 |
| Tao Te Ching | tao-te-ching | Taoism | 253 |
More scriptures are being added. Use GET /api/v1/ask for the live, up-to-date list. | |||
/api/v1/askReturns all available books with their IDs and slugs.
curl https://shruti-production.up.railway.app/api/v1/ask{
"success": true,
"books": [
{
"id": "4dec3f68-...",
"name": "Bhagavad Gita",
"slug": "bhagavad-gita",
"tradition": "Hinduism",
"language": "Sanskrit/English",
"description": null
},
...
]
}/api/v1/askAsk a question grounded in one or more scriptures. Returns a short answer, detailed explanation, and verse citations.
| Field | Type | Required | Description |
|---|---|---|---|
question | string | Yes | The question to ask (max 2000 chars) |
books | string[] | Yes* | Array of book slugs, e.g. ["bhagavad-gita", "quran"] |
book_ids | string[] | Yes* | Alternative: array of book UUIDs. Use books or book_ids. |
language | string | No | Output language code (default: en). Supports: hi, ar, sa, pa, ur, bn, ta, te, es, fr, de, pt, id, ms, tr |
* Provide either books (slugs) or book_ids (UUIDs). At least one is required.
curl -X POST https://shruti-production.up.railway.app/api/v1/ask \
-H "Content-Type: application/json" \
-d '{
"question": "What does Krishna say about duty?",
"books": ["bhagavad-gita"]
}'curl -X POST https://shruti-production.up.railway.app/api/v1/ask \
-H "Content-Type: application/json" \
-d '{
"question": "What is the meaning of life?",
"books": ["bhagavad-gita", "quran", "bible-kjv"],
"language": "en"
}'curl -X POST https://shruti-production.up.railway.app/api/v1/ask \
-H "Content-Type: application/json" \
-d '{
"question": "कर्म क्या है?",
"books": ["bhagavad-gita"],
"language": "hi"
}'{
"success": true,
"short_answer": "Krishna teaches that duty (dharma) must be performed without attachment to results. Focus on the action itself, not its fruits.",
"detailed_answer": "In the Bhagavad Gita, Lord Krishna extensively discusses the concept of duty...[Source: Bhagavad Gita 2:47]...[Source: Bhagavad Gita 3:19]...",
"full_answer": "**Short Answer:** Krishna teaches that...
**Detailed Explanation:** In the Bhagavad Gita...",
"citations": [
{
"book": "Bhagavad Gita",
"chapter": "2",
"verse": "47",
"text": "You have a right to perform your prescribed duty, but you are not entitled to the fruits of action..."
},
{
"book": "Bhagavad Gita",
"chapter": "3",
"verse": "19",
"text": "Therefore, without being attached to the fruits of activities..."
}
],
"query_id": "a1b2c3d4-...",
"language": "en"
}| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request succeeded |
short_answer | string | 1-3 sentence concise answer — ideal for chat UIs, WhatsApp, notifications |
detailed_answer | string | Fuller explanation with verse references — use for "Read more" or detail views |
full_answer | string | Raw complete answer (includes both short + detailed with markdown formatting) |
citations | array | Verse references with book, chapter, verse, and excerpt text |
query_id | string | Unique ID for this query (for tracking) |
language | string | Output language used |
| Status | Meaning |
|---|---|
400 | Missing or invalid fields (question, books) |
404 | Book slug not found — check available slugs via GET |
500 | Internal server error |
{
"success": false,
"error": "Books not found: ramayan",
"available_books": "Use GET /api/v1/ask to list available books"
}const response = await fetch(
"https://shruti-production.up.railway.app/api/v1/ask",
{
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
question: "How should I deal with anger?",
books: ["bhagavad-gita", "quran"],
language: "en",
}),
}
);
const data = await response.json();
console.log(data.short_answer); // Quick answer
console.log(data.citations); // Verse referencesimport requests
response = requests.post(
"https://shruti-production.up.railway.app/api/v1/ask",
json={
"question": "How should I deal with anger?",
"books": ["bhagavad-gita", "quran"],
"language": "en",
},
)
data = response.json()
print(data["short_answer"])
print(data["citations"])Shruti provides AI-generated responses grounded in selected texts. Interpretations may vary by tradition, translation, and commentary.