Frontend and REST API for
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Bhagavad Gita

Build Status Python

Frontend and REST API for

Backend - Flask

Frontend - Material Design

Database - PostgreSQL, ElasticSearch


The Bhagavad Gita Application Programming Interface (API) allows a web or mobile developer to use the Bhagavad Gita text in their web or mobile application(s). It follows some of the Best Practices for designing a REST API.

Current version

The current version of the API is v1. We encourage you to explicitly use this version in the url.


All API access is over HTTPS, and accessed from All data is sent and received as JSON.


HTTP requests to the BHAGAVAD GITA API are protected with OAUTH2 authentication. To be able to use the API, you need to be a registered user. After signing in, you can register your applications from your Account Dashboard after which you will be issued a Client ID and Client Secret specific to an application that can be used to programatically get the access_token(valid for 300sec).

How to get an access token? Make a POST request to /auth/oauth/token with these parameters sent in Headers -

  1. Client ID - Obtained from Account Dashboard after registering an app.
  2. Client Secret - Obtained from Account Dashboard after registering an app.
  3. Grant Type - Use client credentials.
  4. Scope - Use verse if you just want to access the verses, chapter if you just want to access the chapters and verse chapter if you want access to both.

Example -

curl -X POST "" -H "accept: application/json" -H "content-type: application/x-www-form-urlencoded" -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=client_credentials&scope=verse%20chapter"

Then, you can use the received access_token to access any of the endpoints. You can send the access_token as a header or as a query parameter.

Examples -

  1. Query Parameter

curl -X GET "" -H "accept: application/json"

  1. Header

curl -X GET \ \ -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'


We have 2 types of documenatations available for this API, both based on the Open API specification.

  1. Swagger UI
  2. ReDoc

Developing Locally

  1. Fork this repository and clone the forked repository.
  2. Create and activate a Python 3 virtualenv.
  3. Use pip install -r requirements.txt to install the requirements.
  4. foreman start -f local to start the server.
  5. API can be accessed at and frontend can be accessed at


Bug reports and pull requests are welcome on GitHub at This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

To submit a pull request -

  1. Fork/clone the repository.
  2. Develop.
  3. Create a new branch from the master branch.
  4. Open a pull request on Github describing what was fixed or added.