🚀 Quick Start in 30 Seconds

API access is available for paid plans and 14-day free trials. All new developers get an automatic 14-day full access trial (10,000 requests, no credit card required):

BASH / CURL
# 1. Generate an instant 14-day trial key (or get one below)
curl -s "https://khc.loemheng.com/api/v1/trial?email=your_email@example.com" | jq .

# 2. Query today's Khmer lunar date & holidays using your API key
curl -s -H "x-api-key: YOUR_API_KEY" "https://khc.loemheng.com/api/v1/today" | jq .

# 3. Convert any Gregorian date (e.g. 2026-10-24) to Khmer lunar details
curl -s -H "x-api-key: YOUR_API_KEY" "https://khc.loemheng.com/api/v1/date?date=2026-10-24&lang=en" | jq .

💰 Pricing & Plans (Cambodia Market)

Affordable, transparent pricing tailored specifically for developers, digital agencies, and businesses in Cambodia. Billed in USD with direct support for Bakong KHQR and ABA Bank.

14-Day Free Trial

ការសាកល្បងឥតគិតថ្លៃ ១៤ ថ្ងៃ
$ 0 / 14 days
ឥតគិតថ្លៃ • No Credit Card
  • ✓ 10,000 total API requests
  • ✓ 60 requests / minute rate limit
  • ✓ All 6 REST endpoints & MCP
  • ✓ 4 languages (KM, EN, VI, ZH)
  • ✓ Instant self-service generation
Start 14-Day Trial

Starter / Developer

គម្រោងអ្នកអភិវឌ្ឍន៍ទូទៅ
$ 6 / month
~24,000 ៛ / ខែ • ($59/ឆ្នាំ)
  • ✓ 50,000 requests / month
  • ✓ 120 requests / min rate limit
  • ✓ 1 Production API Key
  • ✓ Lunar conversions & holy days
  • ✓ Email developer support
  • ✓ Scan QR or ABA Bank Transfer

Enterprise / Banking

គម្រោងស្ថាប័នធំ និងធនាគារ
$ 49 / month
~200,000 ៛ / ខែ • ($490/ឆ្នាំ)
  • ✓ 5,000,000+ requests / month
  • ✓ 1,000 requests / min rate limit
  • ✓ Unlimited Production API Keys
  • ✓ 99.99% Uptime SLA Agreement
  • ✓ Official Cambodian VAT/Tax Invoice
  • ✓ Custom lunar rule/event additions
  • ✓ Dedicated engineer on Telegram

🇰🇭 Accepted Payment Methods: Scan QR & Bank Transfer

We accept direct mobile QR code scan and bank account transfers using the provided bank number. To receive your API key, transfer the plan fee and upload your transaction receipt slip below. Admin receives an alert to check and verify your payment before issuing the key.

📱
Scan ABA Bank QR Code
Scan QR with ABA Mobile or local banking app
🏦
ABA Bank Account Transfer
Account: 000 123 456 (Name: HENG LOEM)
🔍
Check Verification Status
Check if your submitted transaction was approved

🎁 Generate Your Instant 14-Day Free Trial Key

Get immediate access to test and integrate the API. No credit card required. Key is active for 14 days with 10,000 requests:

⚡ Interactive API Console ("Try It Out")

Test live queries against the Khmer Hybrid Calendar REST API directly inside your browser and inspect real JSON responses in real-time.

Pre-filled with trial demo key khc_trial_demo (14 days active).
Request: GET /api/v1/today
// Click "Send Request" above to view live API output...

🔒 Authentication & Rate Limits

The Khmer Hybrid Calendar REST API is available for paid plans and 14-day free trial accounts. Provide your API key using the standard HTTP header x-api-key, Bearer token, or query parameter.

HTTP HEADER SPECIFICATION
# Recommended: Pass via custom header
x-api-key: khc_trial_your_key_here

# Alternative: Standard Authorization Bearer
Authorization: Bearer khc_trial_your_key_here

# Alternative: Query Parameter
https://khc.loemheng.com/api/v1/today?api_key=khc_trial_your_key_here
Plan Tier Rate Limit Monthly Quota Cambodia Price Best For
14-Day Free Trial 60 req / min 10,000 requests $0 (Free) Evaluation, integration testing, POC
Starter Plan 120 req / min 50,000 requests / mo $6.00 / mo (~24,000 ៛) Freelancers, Telegram bots, personal sites
Business Plan 300 req / min 500,000 requests / mo $19.00 / mo (~78,000 ៛) Digital agencies, SaaS, HR & payroll platforms
Enterprise Plan 1,000 req / min 5,000,000+ requests / mo $49.00 / mo (~200,000 ៛) Commercial banks, MFIs, telecom, government ERPs

Response Headers

Every response returns authentication, plan, and rate limit telemetry:

Header Example Value Description
X-API-Plan trial | starter | business The active subscription tier associated with the API key.
X-Trial-Days-Remaining 14 Days remaining before the 14-day free trial expires.
X-RateLimit-Limit 120 Maximum allowed requests per 60-second window for your plan tier.
X-RateLimit-Remaining 119 Remaining requests available in the current 60-second window.
X-RateLimit-Reset 1730000000 Unix epoch timestamp when the rate limit quota resets.
GET / POST /api/v1/trial

Instantly issues a new 14-day free trial API key with 10,000 request quota. No credit card or pre-approval required.

Query Parameters

Parameter Type Default Description
email string (email) developer@khc.local Your developer contact email for trial issuance.

Sample Request

BASH / CURL
curl -s "https://khc.loemheng.com/api/v1/trial?email=developer@phnompenh.dev" | jq .

Sample Response (201 Created)

JSON RESPONSE (201)
{
  "success": true,
  "message": "Your 14-day free trial API key has been created successfully.",
  "api_key": "khc_trial_19283f_8a3d7b92...",
  "plan": "14-Day Free Trial",
  "trial_days_remaining": 14,
  "quota_requests": 10000,
  "rate_limit_per_minute": 60,
  "expires_at": "2026-11-07T10:30:00.000Z",
  "pricing_cambodia": {
    "starter": "$6/month (~24,000 KHR) - 50,000 req/mo",
    "business": "$19/month (~78,000 KHR) - 500,000 req/mo",
    "enterprise": "$49/month (~200,000 KHR) - 5,000,000+ req/mo",
    "accepted_payments": ["Bakong KHQR (ABA, Wing, ACLEDA, Canadia)", "ABA Bank Transfer", "Visa / Mastercard"]
  }
}
GET /api/v1/today

Returns today's Gregorian solar date and Khmer lunar calendar data calculated for the requested timezone, including Buddhist holy day status, moon phase, and public holidays.

Query Parameters

Parameter Type Default Description
timezone string Asia/Phnom_Penh IANA Timezone identifier (e.g., Asia/Phnom_Penh, America/New_York, UTC).
lang string km Language for names: km (Khmer), en (English), vi (Vietnamese), zh (Chinese).

Sample Response

JSON (200 OK)
{
  "success": true,
  "data": {
    "timezone": "Asia/Phnom_Penh",
    "gregorian_date": "2026-10-24",
    "year": 2026,
    "month": 10,
    "day": 24,
    "day_of_week": 6,
    "weekday": "ថ្ងៃសៅរ៍",
    "khmer_date": "ថ្ងៃសៅរ៍ ១៤កើត ខែអស្សុជ ឆ្នាំមមែ ឆស័ក ព.ស. ២៥៧០",
    "lunar_date": "១៤កើត ខែអស្សុជ",
    "khmer_details": {
      "lunar_day": 14,
      "lunar_day_khmer": "១៤",
      "is_waxing": true,
      "phase_type": "waxing",
      "lunar_phase_text": "១៤កើត",
      "lunar_month_name": "អស្សុជ",
      "lunar_month_index": 10,
      "is_full_month": false,
      "be_year": 2570,
      "be_year_khmer": "២៥៧០",
      "animal_year": "មមែ",
      "sak": "ឆស័ក"
    },
    "moon": {
      "emoji": "🌔",
      "phase_key": "waxing-gibbous",
      "name": "ព្រះច័ន្ទជិតពេញ (Waxing Gibbous)"
    },
    "buddhist_day": {
      "is_holy_day": true,
      "is_uposatha": false,
      "is_kaor": true,
      "name": "ថ្ងៃកោរ"
    },
    "is_official_holiday": false,
    "official_holidays": [],
    "events": []
  },
  "meta": {
    "timestamp": "2026-10-24T02:30:00.000Z",
    "language": "khmer"
  }
}
GET /api/v1/date?date=YYYY-MM-DD

Converts any solar Gregorian date from year 1800 to 2200 into complete Khmer lunar calendar information.

Query Parameters

Parameter Type Required Description
date string Yes Gregorian date formatted as YYYY-MM-DD (e.g., 2026-04-14).
lang string No Language: km | en | vi | zh (default: km).
GET /api/v1/lunar-to-solar

Reverse conversion: calculates the exact solar Gregorian date from a Khmer lunar day, moon phase, lunar month index, and Buddhist Era year.

Query Parameters

Parameter Type Required Description
day integer Yes Lunar day number between 1 and 15.
phase string Yes waxing (កើត) or waning (រោច).
month integer Yes Khmer lunar month index: 0=Migasir, 1=Boss, ..., 4=Cheit, 5=Pisakh, ..., 11=Kadeuk.
be_year integer Yes Buddhist Era year (ព.ស.) between 2300 and 2800 (e.g. 2570).
GET /api/v1/month?year=YYYY&month=M

Generates an array of every day in the requested Gregorian month with complete Khmer lunar calculations, moon phases, and holidays.

GET /api/v1/holidays?year=YYYY

Lists Cambodian public holidays and observances for a given year. Ideal for HR payroll and attendance systems to automatically determine official paid non-working holidays.

Query Parameters

Parameter Type Default Description
year integer Current year Gregorian year (e.g., 2026).
type string all all | national (បុណ្យជាតិ) | lunar (ចន្ទគតិ) | international
official_only boolean false If true, filters only official government paid public holidays.
GET /api/v1/buddhist-days?year=YYYY

Lists all Uposatha (ថ្ងៃសីល: 8th waxing, 15th waxing, 8th waning, and 14th/15th waning) and Kaor (ថ្ងៃកោរ) days for the entire year.

GET /api/v1/openapi.json

Provides the complete machine-readable OpenAPI 3.1 specification for importing into Postman, Insomnia, Swagger UI, or auto-generating client SDKs.

View OpenAPI JSON ↗

📅 Additional Feeds & Tools

1. Multi-Language iCal Feeds (.ics & JSON)

Subscribe in Google Calendar, Apple Calendar, or Microsoft Outlook, or fetch structured JSON with ?format=json:

2. Share Card & OG Image Generator

Dynamically renders a high-resolution PNG day card with custom royal monarch themes:

URL PATTERN
GET https://khc.loemheng.com/api/card?date=2026-10-24&theme=teal&template=modern

3. Zero-Dependency Embeddable Widget

An ultra-lightweight (<30ms, zero-dependency) iframe widget suitable for embedding into news portals and websites:

HTML IFRAME
<iframe src="https://khc.loemheng.com/embed" width="340" height="420" frameborder="0" style="border-radius:12px; border:1px solid #e2e8f0;"></iframe>

4. Model Context Protocol (MCP) for AI Assistants

Integrate Khmer lunar calendar calculations into AI agents, Claude Desktop, Cursor, or Gemini CLI via our standard MCP endpoint:

MCP SERVER URL
POST https://khc.loemheng.com/mcp
GET  https://khc.loemheng.com/mcp (Tools catalog)

💻 Code Snippets (6 Languages)

Copy-paste integration code ready for production use:

JAVASCRIPT (FETCH)
// Modern async/await with native fetch and API key
async function getKhmerCalendarToday() {
  const apiKey = 'YOUR_API_KEY_OR_TRIAL_KEY'; // e.g. khc_trial_... or khc_live_...
  const response = await fetch('https://khc.loemheng.com/api/v1/today?timezone=Asia/Phnom_Penh', {
    headers: {
      'x-api-key': apiKey,
    },
  });
  if (!response.ok) throw new Error(`API Error: ${response.status}`);
  const result = await response.json();
  
  console.log('Today:', result.data.khmer_date);
  console.log('Is Holy Day (ថ្ងៃសីល/ថ្ងៃកោរ):', result.data.buddhist_day.is_holy_day);
  console.log('Moon Phase:', result.data.moon.emoji, result.data.moon.name);
  return result.data;
}

getKhmerCalendarToday();

💼 Real-World Integration Use Cases

1. HR & Payroll Leave Management

Integrate GET /api/v1/holidays?official_only=true to automatically calculate paid non-working days for staff payroll in accordance with official Ministry of Labour Prakas.

2. E-Commerce & Delivery Logistics

Schedule order deliveries and warehouse operations around major multi-day Cambodian holiday closures, including Khmer New Year (មហាសង្រ្កាន្ត), Pchum Ben (ភ្ជុំបិណ្ឌ), and the Water Festival (បុណ្យអុំទូក).

3. Buddhist Observance & Temple Notifications

Use GET /api/v1/buddhist-days in combination with Telegram/SMS bots to broadcast automated vegetarian and Uposatha (ថ្ងៃសីល) reminders every week.

4. Media & News Portals

Embed the lightweight iframe widget or query GET /api/v1/today in news headers to display traditional Cambodian dates alongside modern Gregorian dates.