Bhagavad Gita API

Books / OAuth Advanced HTTPS CORS
Varies by plan (check documentation)

Overview

This Bhagavad Gita API from bhagavadgita.io provides OAuth-authenticated access to all chapters and verses with English commentary and multiple translations. It suits apps needing reliable, well-maintained scripture data.

💡

Beginner Tip

OAuth here uses a client credentials flow — send your client_id and client_secret to the token endpoint first, then pass the returned access_token as 'Authorization: Bearer TOKEN' on all subsequent requests. Tokens expire, so build in a refresh.

Available Data

repository name and description
star and fork counts
contributor data
issues and pull requests
commit history
Use case: Integrate bhagavad gita text data into web and mobile applications

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from Bhagavad Gita",
    "description": "Bhagavad Gita text",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

access_token Bearer token to include in all API request Authorization headers
token_type Always Bearer; indicates how to format the Authorization header
expires_in Seconds until the token expires; typically 3600 for one hour
chapter_number Chapter index 1-18 returned in verse and chapter responses
verse_number Verse index within the chapter
text Sanskrit text or English translation of the requested verse

Implementation Example

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://bhagavadgita.io/api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Access token missing, malformed, or expired
Re-request a token via POST to the /auth/token endpoint with your client_id and client_secret, then retry with the new token
400 Bad Request on token endpoint Sending credentials as query params instead of request body
Send client_id and client_secret as application/x-www-form-urlencoded body fields, not URL parameters
404 Chapter not found Chapter number is outside the valid 1-18 range
The Bhagavad Gita has exactly 18 chapters; verify your chapter number variable before constructing the URL

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 2/20
🔒 Security 15/15
🛠 Developer XP 8/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS YES
Category Books
Difficulty Advanced
Verified: 2026-04-07

Similar APIs

View All →