Nepali Patro API

AD/BS date conversion, festivals, holidays & panchang — full REST API + public calendar page

/api/patro.php 120 views General Updated 15 Jul 2026

Overview

The Nepali Patro API provides Bikram Sambat (BS) calendar services: AD↔BS date conversion, festivals, holidays, and panchang (tithi, nakshatra, sunrise/sunset) lookups. Backed by a verified day-count algorithm covering BS 2000–2090. As of v2.1, date responses also include ready-to-use formatted display strings in multiple Nepali and English styles, and the API can be embedded directly on any site with a single script tag.

Endpoints

GET  https://pradipsubedi1.com.np/api/patro.php?action=today
GET  https://pradipsubedi1.com.np/api/patro.php?action=convert_ad_to_bs&date=2026-06-25
GET  https://pradipsubedi1.com.np/api/patro.php?action=convert_bs_to_ad&year=2083&month=3&day=11
GET  https://pradipsubedi1.com.np/api/patro.php?action=month&year=2083&month=3
POST https://pradipsubedi1.com.np/api/patro.php

Parameters

ParameterTypeDescription
actionstring (required)today · convert_ad_to_bs · convert_bs_to_ad · month · status
datestringYYYY-MM-DD, required for convert_ad_to_bs
year, month, dayintBS date parts, required for convert_bs_to_ad and month

JavaScript Example

async function getTodayBs() {
  const res = await fetch("https://pradipsubedi1.com.np/api/patro.php?action=today");
  return (await res.json()).data;
}
getTodayBs().then(data => {
  console.log(data.formats.aaj_gate); // "आज २०८३ असार ३० गते"
});

Response — action=today

{
  "success": true,
  "data": {
    "ad_date": "2026-06-25",
    "bs_date": "2083-03-11",
    "bs_year": 2083,
    "bs_month": 3,
    "bs_month_name": "Asar",
    "bs_month_name_np": "असार",
    "bs_day": 11,
    "weekday": "Thursday",
    "formats": {
      "aaj_gate": "आज २०८३ असार ११ गते",
      "gate_only": "२०८३ असार ११ गते",
      "full_np": "११ असार २०८३",
      "full_np_long": "असार ११, २०८३",
      "weekday_np": "बिहीबार, २०८३ असार ११",
      "full_en": "11 Asar 2083",
      "short_np": "११/०३/२०८३",
      "short_en": "11/03/2083"
    }
  }
}

Display Format Styles NEW in v2.1

Every date response (today, convert_ad_to_bs, convert_bs_to_ad) now includes a formats object with 8 pre-built display strings, so you don't have to assemble Nepali date text yourself.

KeyExampleUse Case
formats.aaj_gateआज २०८३ असार ११ गतेFull sentence, e.g. a homepage "today" widget
formats.gate_only२०८३ असार ११ गतेSame style without the "आज" (today) prefix
formats.weekday_npबिहीबार, २०८३ असार ११Date with Nepali weekday name
formats.full_np११ असार २०८३Compact Nepali, day-month-year
formats.full_np_longअसार ११, २०८३Compact Nepali, month-day, year
formats.full_en11 Asar 2083English (Latin script) equivalent
formats.short_np११/०३/२०८३Numeric DD/MM/YYYY, Devanagari digits
formats.short_en11/03/2083Numeric DD/MM/YYYY, Latin digits

Embeddable Widget NEW in v2.1

Add a ready-made converter or today's-date badge to any page with one script tag — no build step, no API integration required. Works on any site: CORS is fully open on this API.

Today's date badge — a small pill showing today's BS date, in any of the 8 styles above:

<script src="https://pradipsubedi1.com.np/widget/patro-widget.js"
        data-mode="today"
        data-style="aaj_gate"
        data-theme="light"></script>

Interactive AD→BS converter — a date picker with a live-converting result, defaults to today on load:

<script src="https://pradipsubedi1.com.np/widget/patro-widget.js"
        data-mode="converter"
        data-style="full_np"
        data-theme="dark"></script>
AttributeOptionsDefault
data-modetoday · convertertoday
data-styleAny of the 8 format style keys aboveaaj_gate
data-themelight · dark · plainlight

The widget renders itself right where the script tag is placed — drop it directly into your page body wherever you want the badge or converter to appear. Multiple widgets can be used on the same page.

Note: Rate limit is 120 requests/minute per IP. CORS is open for all origins, including the embeddable widget. Full calendar view with festivals, holidays and panchang is on the public Calendar page.

Status

FeatureStatus
AD → BS Conversion✅ Available
BS → AD Conversion✅ Available
Multiple Display Format Styles✅ Available (v2.1)
Embeddable Widget✅ Available (v2.1)
Public Calendar Page✅ Available
Festivals & Holidays✅ Available (data expanding)
Panchang Data✅ Available (data expanding)
Back to Developer Hub
Copied!