GET /api/all-verses
Retrieve all 703 verses from the Bhagavad Gita in a single request. This endpoint is designed for client-side search functionality and caching.Request
No parameters required. This is a simple GET request.Response
Response status - always “success” for successful requests
Array of all verses, sorted by chapter and verse number
Chapter number (1-18)
Verse number within the chapter
English translation of the verse
Brief summary of the verse (max 500 characters)
Response Example
Error Responses
| Status Code | Description |
|---|---|
| 429 | Rate limit exceeded (10 requests per minute) |
| 500 | Internal server error or failed to fetch from backend |
Rate Limiting
- Backend: 10 requests per minute per IP address
- Lower rate limit due to large response size
Caching
- Frontend: Cached for 1 hour (3600 seconds)
- CDN: Public cache with s-maxage of 3600 seconds
- Backend: Data loaded once on server startup from Pinecone vector database
- Responses include Cache-Control headers for optimal performance
Code Examples
Use Cases
- Client-side search: Load all verses once and implement fast filtering
- Offline functionality: Cache verses for offline access
- Browse mode: Display complete chapter/verse listings
- Analytics: Count verses per chapter or analyze content
Performance Notes
- Response contains all 703 verses (~200-300KB payload)
- Use caching to avoid repeated requests
- Data is sorted by chapter and verse for easy navigation
- Backend loads verses from Pinecone once at startup
- Summaries are truncated to 500 characters maximum