Gapja (Sexagenary Cycle) API
by KunStudio · free to evaluate · no API key on origin

Gapja (Sexagenary Cycle) API

The gapja (간지) is the 60-term sexagenary cycle that names each year, month and day with a Heavenly Stem and Earthly Branch (e.g. 병오년 / 丙午年). It is the raw material of Korean four-pillars fortune-telling (사주/saju). This endpoint computes all three pillars from a single solar date.

Building a saju / fortune app means turning a birth date into its four pillars. The first step is the gapja: the stem-branch pair for the year, month and day. Getting this right requires correct lunar conversion and the traditional pillar conventions — this API handles both and returns the result in Hangul and Hanja.

Endpoints

GET /v1/gapja?date=2026-02-17 간지 (sexagenary) year/month/day pillars for a solar date, in Hangul + Hanja, with the lunar date.

Example request & response

curl "https://korea-calendar-api.kunstudio.workers.dev/v1/gapja?date=2026-02-17"
{
  "solar": "2026-02-17",
  "gapja": { "year": "병오년", "month": "경인월", "day": "임술일" },
  "gapja_chinese": { "year": "丙午年", "month": "庚寅月", "day": "壬戌日" },
  "lunar": { "year": 2026, "month": 1, "day": 1, "leap_month": false }
}

No API key is needed on the origin to try this — it is rate-limited for fair evaluation. See the OpenAPI spec for the full schema.

Good to know

Related

Building a Korean fortune (사주/saju) app? Pair this with the KunStudio Saju API for a full four-pillars reading over REST.