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
| Parameter | Type | Description |
|---|---|---|
action | string (required) | today · convert_ad_to_bs · convert_bs_to_ad · month · status |
date | string | YYYY-MM-DD, required for convert_ad_to_bs |
year, month, day | int | BS 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.
| Key | Example | Use 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_en | 11 Asar 2083 | English (Latin script) equivalent |
formats.short_np | ११/०३/२०८३ | Numeric DD/MM/YYYY, Devanagari digits |
formats.short_en | 11/03/2083 | Numeric 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>
| Attribute | Options | Default |
|---|---|---|
data-mode | today · converter | today |
data-style | Any of the 8 format style keys above | aaj_gate |
data-theme | light · dark · plain | light |
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
| Feature | Status |
|---|---|
| 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) |