Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

API Documentation

Sarabveer Singh edited this page Jan 19, 2020 · 6 revisions

This is Documentation for the current production API, located at api.gurbaninow.com/v2.

  1. Metadata
  2. Search
  3. Shabad
  4. Banis
  5. Hukamnama from Sri Darbar Sahib
  6. Page
  7. Line
  8. GurbaniAkhar/Unicode Converter

Metadata

The API provides endpoints to get a list of sources and writers.

Sources

URL: https://api.gurbaninow.com/v2/meta/sources

Returns a JSON list of sources, with the id and subsections for each source.

Writers

URL: https://api.gurbaninow.com/v2/meta/writers

Returns a JSON list of writers, with the id and name for each writer.

Search

URL: https://api.gurbaninow.com/v2/search/:query
Example: https://api.gurbaninow.com/v2/search/DDrgj/?source=1&searchtype=1

Variable Purpose
:query The Actual Query, whatever is typed into the Search Box.
INFO: GurbaniAkhar Keyset and Unicode can be used for searching on searchtype: 0 and 1. searchtype: 2 only supports GurbaniAkhar. URL Encoding is Recommended
source Sets which Source you want Shabads from.
Default is All Sources, Use Source ID from the Sources metadata endpoint.
searchtype Search Type
0 - First Letter Start (Gurmukhi) (DEFAULT)
1 - First Letter Anywhere (Gurmukhi)
2 - Full Word/Line (Gurmukhi)
4 - Search All Words (Gurmukhi)
6 - Search Any Words (Gurmukhi)
writer Set Writer
Default is All Writers, Use Writer ID from the Writer metadata endpoint.
raag Set Subsection
Default is All Raags, Use Source ID from the Sources metadata endpoint.
ang Ang/PageNo
Leave Empty if Not Used
1,2,3,4,.... - Specify Ang/PageNo
results Set Count of Results (DEFAULT 20, MAX 100)
In case skip is set, this will return results from the skip to skip+results results.
skip Skip Records (DEFAULT 0)
For example, if you want 20 to 30 results, set skip=20 and results=10

Shabad

URL: https://api.gurbaninow.com/v2/shabad/:id
Example: https://api.gurbaninow.com/v2/shabad/02L

Variable Purpose
:id ShabadID

Random Shabad

URL: https://api.gurbaninow.com/v2/shabad/random

Redirects to a Random Shabad

Banis

URL: https://api.gurbaninow.com/v2/banis

Returns a JSON list of banis, with the id and name for each bani.

Retrieve Bani

URL: https://api.gurbaninow.com/v2/banis/:id
Example: https://api.gurbaninow.com/v2/banis/1

Variable Purpose
:id Bani ID

Hukamnama from Sri Darbar Sahib

Today

URL: https://api.gurbaninow.com/v2/hukamnama/today

Returns Hukamnama from Sri Darbar Sahib. It fetches from SikhNet.com.

Archives

URL: https://api.gurbaninow.com/v2/hukamnama/:year/:month/:day

Example: https://api.gurbaninow.com/v2/hukamnama/2017/1/1

NOTE: Hukamnama Archives only go back up to Year 2002.

Page

URL: https://api.gurbaninow.com/v2/ang/:page

Examples: https://api.gurbaninow.com/v2/ang/917, https://api.gurbaninow.com/v2/ang/1?source=2

Variable Purpose
:page Page Number from Source.
:source Sets which Source you want Page from.
DEFAULT is 1 (Sri Guru Granth Sahib Ji)
Use Source ID from the Sources metadata endpoint.

Line

URL: https://api.gurbaninow.com/v2/line/:id
Example: https://api.gurbaninow.com/v2/line/YLSG

Variable Purpose
:id Line ID

GurbaniAkhar/Unicode Converter

URL: https://api.gurbaninow.com/v2/convert/:type/:text

NOTE: Deprecated Endpoint, use the gurmukhi-utils npm module instead.

Variable Purpose
:type unicode - GurbaniAkhar to Unicode
akhar - Unicode to GurbaniAkhar
:text Text to be Converted. URL Encoding is Recommended