SpecialDays Sri Lanka API Documentation
The authoritative, enterprise-grade statutory gazette API for the Republic of Sri Lanka. Built for high-velocity e-commerce checkouts, banking settlement synchronization, automated DOMEX/Prompt courier buffers, and real-time astronomical Full Moon Poya lunar tracking.
Edge Anycast Speed
Persistent in-memory cache guarantees sub-millisecond responses globally.
Neon Serverless Ready
PostgreSQL with Drizzle ORM and automatic SSL schema provisioning.
300 RPM Live Quota
Standardized live developer keys with zero rate-limit surprises.
Live API Explorer & Latency Benchmarker
Execute live requests against our production edge routes right from this page.
null
Quick Start
Test our public API with zero authentication. Query whether today is an official Sri Lankan statutory holiday in a single cURL command:
curl -s "https://slapi.vercel.app/api/v1/today"Base URL & Environments
| Environment | Base URL | Performance SLA |
|---|---|---|
| Production (Global Edge) | https://slapi.vercel.app | < 1.5ms Edge Anycast |
| Local Development | http://localhost:3000 | Node.js / Next.js Runtime |
Multi-Database Auto-Connector Engine
The platform features a zero-configuration Universal Database Auto-Connector with automatic health checks and failover. It auto-detects and connects to your cloud database in priority order, with graceful fallback to Embedded PostgreSQL (PGlite 16) ensuring 100% uptime:
NEON_DATABASE_URL or DATABASE_URL (*.neon.tech)
SUPABASE_DATABASE_URL (*.supabase.co)
POSTGRES_URL / POSTGRES_PRISMA_URL
Real Postgres 16 running directly in Node.js
Automated Multi-Database Diagnostics
npm run db:testScans all registered environment variables, tests TLS handshakes, verifies the 10 relational tables, and ensures all 27 statutory holidays of 2026 are seeded.
Authentication & API Keys
All production API keys use the standardized prefix slk_live_. No test keys or ClickSnap legacy keys exist. Keys are hashed using SHA-256 at rest.
API Endpoint Reference
Full parameter specifications, schemas, error formats, and multi-language snippets for each production route.
Evaluates whether today (or a specific date) is a statutory holiday, lunar Poya, or CBSL clearing pause.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| date | string | No | Colombo Current Date | Target date in YYYY-MM-DD ISO format. |
| lang | string | No | all | Locale translation: 'en', 'si', 'ta', or 'all'. |
Integration Code Examples
curl -X GET "https://slapi.vercel.app/api/v1/today?date=2026-05-30&lang=all"
{
"success": true,
"active": true,
"data": {
"id": "vesak-full-moon-poya-day",
"slug": "vesak-full-moon-poya-day",
"date": "2026-05-30",
"country": "LK",
"timezone": "Asia/Colombo",
"title": {
"en": "Vesak Full Moon Poya Day",
"si": "වෙසක් පුර පසළොස්වක පෝය දිනය",
"ta": "வைகாசி விசாக பௌர்ணமி தினம்"
},
"greeting": {
"en": "Blessed Vesak to All!",
"si": "සැමට ප්රීතිමත් වෙසක් මංගල්යයක් වේවා!",
"ta": "அனைவருக்கும் இனிய விசாக தின நல்வாழ்த்துகள்!"
},
"category": "poya",
"is_public_holiday": true,
"is_bank_holiday": true,
"is_mercantile_holiday": true,
"cbsl_clearing_paused": true,
"shipping_buffer_days": 1
},
"query_date": "2026-05-30",
"timezone": "Asia/Colombo"
}Fetches the full calendar of gazetted Sri Lanka holidays for 2026, filterable by legal scope.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| filter | string | No | none | Statutory scope: 'public', 'bank', 'mercantile', or 'poya'. |
Integration Code Examples
curl -X GET "https://slapi.vercel.app/api/v1/holidays?filter=bank"
{
"success": true,
"total_statutory_holidays": 27,
"jurisdiction": "Sri Lanka",
"timezone": "Asia/Colombo (+05:30)",
"holidays": [
{
"id": "duruthu-full-moon-poya-day",
"slug": "duruthu-full-moon-poya-day",
"date": "2026-01-02",
"eventType": "poya",
"isPublicHoliday": true,
"isBankHoliday": true,
"isMercantileHoliday": false
}
]
}Query days by year, month, holiday flags, and cultural category.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| year | number | No | 2026 | Calendar year (e.g. 2026). |
| month | number | No | all | Month index 1 to 12. |
| type | string | No | all | Event category ('poya', 'national', 'religious'). |
| bank | boolean | No | none | Filter by bank holiday. |
Integration Code Examples
curl -X GET "https://slapi.vercel.app/api/v1/days?year=2026&month=5&bank=true"
{
"success": true,
"count": 2,
"data": [
{
"slug": "may-day",
"date": "2026-05-01",
"is_public_holiday": true,
"is_bank_holiday": true,
"is_mercantile_holiday": true
}
]
}Returns live system status, current Colombo time (+05:30), Neon database connectivity, and edge node health.
Integration Code Examples
curl -X GET "https://slapi.vercel.app/api/v1/health"
{
"status": "healthy",
"service": "SpecialDays Sri Lanka Statutory & Cultural Engine",
"version": "2.0.0",
"jurisdiction": "LK",
"timezone": "Asia/Colombo",
"offset": "+05:30",
"current_colombo_date": "2026-11-03",
"current_colombo_time": "05:40:00",
"database": {
"status": "CONNECTED",
"engine": "Neon Serverless PostgreSQL Ready"
},
"uptime_pct": 99.99
}Generates a new production API key (slk_live_...) with 300 requests/minute capacity.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Developer account email address. | |
| label | string | No | Production Key | Descriptive label for the API key. |
Integration Code Examples
curl -X POST "https://slapi.vercel.app/api/v1/keys" \
-H "Content-Type: application/json" \
-d '{"email": "developer@company.lk", "label": "Shopify Storefront"}'{
"success": true,
"message": "API Key created successfully.",
"api_key": "slk_live_a8f902bc45de712398ab01cd56ef9876",
"data": {
"id": "e93f4128-4b72-4b8c-b019-3c819a584091",
"key_masked": "slk_live_a8f9...9876",
"label": "Shopify Storefront",
"status": "active",
"rate_limit_rpm": 300
}
}Dispatches a 6-digit one-time code to developer email via Resend transactional email.
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| string | Yes | - | Developer email address. |
Integration Code Examples
curl -X POST "https://slapi.vercel.app/api/v1/auth/otp/send" \
-H "Content-Type: application/json" \
-d '{"email": "developer@company.lk"}'{
"success": true,
"message": "6-digit verification code sent to developer@company.lk via Resend",
"expiresAt": "2026-11-03T06:05:00.000Z"
}Error Codes & Diagnostics
All error responses follow an enterprise JSON envelope with deterministic machine-readable codes:
| Error Code | Status | Root Cause | Resolution |
|---|---|---|---|
| RATE_LIMIT_EXCEEDED | 429 | Exceeded 300 RPM quota | Wait 60s or use cached responses |
| AUTH_REQUIRED | 401 | Developer session missing | Login via /auth/otp/send |
| INVALID_EMAIL | 400 | Malformed developer email | Provide valid RFC 5322 email |
| NOT_FOUND | 404 | Event slug or key UUID missing | Check slug against /holidays |
Data Models & Gazette Schemas
GazetteHoliday Record (TypeScript)
interface GazetteHoliday {
id: string; // e.g. "vesak-full-moon-poya-day"
slug: string; // Canonical URI identifier
date: string; // ISO "2026-05-30"
countryCode: "LK"; // Sri Lanka
timezone: "Asia/Colombo"; // UTC+05:30
isPublicHoliday: boolean; // Gazette Act No. 29 Section 2
isBankHoliday: boolean; // CBSL interbank clearing pause
isMercantileHoliday: boolean; // Commercial employment holiday
cbsl_clearing_paused?: boolean; // Real-time clearance halt
shipping_buffer_days?: number; // 1-day checkout buffer
translations: {
en: { title: string; greeting: string; description: string; };
si: { title: string; greeting: string; description: string; };
ta: { title: string; greeting: string; description: string; };
};
}Versioning & Changelog
- Added native Neon Serverless PostgreSQL support via
@neondatabase/serverlessand Drizzle ORM. - Integrated interactive documentation portal with live latency benchmarking and multi-language snippets.
- Standardized domain strictly on
https://slapi.vercel.app. - Enhanced dashboard live preview with Storefront.lk courier dispatch timeline.
- Released comprehensive OpenAPI 3.1 specification and Postman collection.