NaturaOS

Tài liệu API

Cùng một engine, hai cách gọi: REST (/api/v1/*) và MCP (/mcp). Mỗi op dưới đây có tham số, ví dụ copy-chạy-được, và response thật. Envelope luôn là { ok, data, meta } hoặc { ok:false, error }.

Thay <key> bằng key của bạn. Tên miền trong ví dụ là tên miền thật.

Lịch

Âm lịch Việt Nam theo thuật toán Hồ Ngọc Đức: đổi ngày, xem ngày, tiết khí, giờ hoàng đạo.

Xem ngày: âm lịch, can chi ngày/tháng/năm, giờ đầu ngày, tiết khí, giờ hoàng đạo.

calendar.dayInfo · 1 lượt/lần gọi

Full almanac day view: lunar date, day/month/year stem-branch (can chi), first hour of the day, solar term, auspicious hours. ⚠️ Two conventions coexist here on purpose: canChi follows the LUNAR calendar (year turns at Tết, month at lunar day 1), while almanac.dayOfficer/dutyGod follow the SOLAR TERM (the twelve day officers are term-based). Both are declared in meta.conventions. canChi is therefore NOT a bazi (bát tự) chart — see ganzhi.calendarPillars for the same caveat. Input: 'date' (YYYY-MM-DD) OR day+month+year, never both.

REST
GET /api/v1/calendar/day · POST /api/v1/calendar/day
MCP tool
calendar_dayInfo

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
day integer Solar day (1-31). FORM B — needs all of day+month+year; or omit the whole set and use 'date'.
month integer Solar month (1-12). With day+year (form B).
year integer Solar year (1-9999). With day+month (form B).
date string Solar date as ISO 'YYYY-MM-DD' (e.g. 2026-07-01). FORM A for entering a date — use this field OR the numeric day+month+year set, never both (sending both → 400).
tz number = 7 Timezone (UTC offset). Default 7 = Vietnam (UTC+7).
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/calendar/day?date=2026-09-06"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/calendar/day" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"date":"2026-09-06"}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/calendar/day", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "date": "2026-09-06"
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "solar": {
      "day": 6,
      "month": 9,
      "year": 2026,
      "weekday": {
        "vi": "Chủ nhật",
        "en": "Sunday"
      }
    },
    "lunar": {
      "day": 25,
      "month": 7,
      "year": 2026,
      "leap": false
    },
    "canChi": {
      "day": {
        "code": "Gui-Wei",
        "stem": "Gui",
        "branch": "Wei",
        "label": {
          "vi": "Quý Mùi"
        }
      },
      "month": {
        "code": "Bing-Shen",
        "stem": "Bing",
        "branch": "Shen",
        "label": {
          "vi": "Bính Thân"
        }
      },
      "year": {
        "code": "Bing-Wu",
        "stem": "Bing",
        "branch": "Wu",
        "label": {
          "vi": "Bính Ngọ"
        }
      }
    },
    "firstHour": {
      "code": "Ren-Zi",
      "stem": "Ren",
      "branch": "Zi",
      "label": {
        "vi": "Nhâm Tý"
      }
    },
    "solarTerm": {
      "vi": "Xử thử"
    },
    "auspiciousHours": [
      {
        "code": "Yin",
        "label": {
          "vi": "Dần",
          "pinyin": "Yín",
          "zh": "寅"
        },
        "range": "3-5",
        "startHour": 3,
        "endHour": 5
      },
      {
        "code": "Mao",
        "label": {
          "vi": "Mão",
          "pinyin": "Mǎo",
          "zh": "卯"
        },
        "range": "5-7",
        "startHour": 5,
        "endHour": 7
      },
      {
        "code": "Si",
        "label": {
          "vi": "Tỵ",
          "pinyin": "Sì",
          "zh": "巳"
        },
        "range": "9-11",
        "startHour": 9,
        "endHour": 11
      },
      {
        "code": "Shen",
        "label": {
          "vi": "Thân",
          "pinyin": "Shēn",
          "zh": "申"
        },
        "range": "15-17",
        "startHour": 15,
        "endHour": 17
      },
      {
        "code": "Xu",
        "label": {
          "vi": "Tuất",
          "pinyin": "Xū",
          "zh": "戌"
        },
        "range": "19-21",
        "startHour": 19,
        "endHour": 21
      },
      {
        "code": "Hai",
        "label": {
          "vi": "Hợi",
          "pinyin": "Hài",
          "zh": "亥"
        },
        "range": "21-23",
        "startHour": 21,
        "endHour": 23
      }
    ],
    "almanac": {
      "nayin": {
        "code": "YangLiuMu",
        "element": "wood",
        "label": {
          "vi": "Dương Liễu Mộc",
          "zh": "楊柳木",
          "pinyin": "Yáng Liǔ Mù"
        }
      },
      "dayOfficer": {
        "code": "Bi",
        "label": {
          "vi": "Bế",
          "zh": "閉",
          "pinyin": "Bì"
        }
      },
      "dutyGod": {
        "code": "YuTang",
        "type": "hoang",
        "auspicious": true,
        "label": {
          "vi": "Ngọc Đường",
          "zh": "玉堂",
          "pinyin": "Yù Táng"
        }
      }
    },
    "jd": 2461290
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "calendar@0.1.1",
    "conventions": {
      "pillarBasis": "lunar_calendar",
      "yearBoundary": "lunar_new_year",
      "monthBoundary": "lunar_first",
      "almanacBasis": "solar_term",
      "ziHourBoundary": "midnight",
      "calendarEngine": "ho_ngoc_duc"
    }
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.

Đổi ngày dương sang ngày âm lịch Việt Nam.

calendar.convertSolarToLunar · 1 lượt/lần gọi

Convert a solar (Gregorian) date to the Vietnamese lunar date (âm lịch, Hồ Ngọc Đức algorithm). Input: 'date' (YYYY-MM-DD) OR day+month+year, never both.

REST
GET /api/v1/calendar/lunar-date · POST /api/v1/calendar/lunar-date
MCP tool
calendar_convertSolarToLunar

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
day integer Solar day (1-31). FORM B — needs all of day+month+year; or omit the whole set and use 'date'.
month integer Solar month (1-12). With day+year (form B).
year integer Solar year (1-9999). With day+month (form B).
date string Solar date as ISO 'YYYY-MM-DD' (e.g. 2026-07-01). FORM A for entering a date — use this field OR the numeric day+month+year set, never both (sending both → 400).
tz number = 7 Timezone (UTC offset). Default 7 = Vietnam (UTC+7).
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/calendar/lunar-date?date=2026-09-06"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/calendar/lunar-date" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"date":"2026-09-06"}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/calendar/lunar-date", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "date": "2026-09-06"
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "solar": {
      "day": 6,
      "month": 9,
      "year": 2026
    },
    "lunar": {
      "day": 25,
      "month": 7,
      "year": 2026,
      "leap": false
    },
    "jd": 2461290
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "calendar@0.1.1",
    "conventions": {
      "calendarEngine": "ho_ngoc_duc"
    }
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.

Can chi

Can chi năm / tháng / ngày / giờ theo lịch (năm đổi ở Tết). Không phải bát tự — xem lưu ý trong từng op.

Can chi năm/tháng/ngày/giờ theo lịch (năm đổi ở Tết) — không phải bát tự.

ganzhi.calendarPillars · 1 lượt/lần gọi

Stems and branches (can chi) for a datetime on the CALENDAR basis: the year turns at Tết, the month at lunar day 1. This is the can chi a Vietnamese almanac prints, for viewing and choosing days. ⚠️ NOT a bazi (bát tự / tứ trụ) chart: bazi turns the year at Lập xuân and the month at the solar term, so between those boundaries the two disagree. Do not cast a bazi with this op. Every convention that decides the answer — including the zi-hour boundary — is declared in meta.conventions. Input: 'datetime' (YYYY-MM-DD HH:mm) OR year+month+day+hour, never both.

REST
GET /api/v1/ganzhi/calendar-pillars · POST /api/v1/ganzhi/calendar-pillars
MCP tool
ganzhi_calendarPillars

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
year integer Solar year. FORM B — needs all of year+month+day+hour; or omit the whole set and use 'datetime'.
month integer Solar month (1-12). With year+day+hour (form B).
day integer Solar day (1-31). With year+month+hour (form B).
hour integer Hour (0-23) — decides the hour pillar. With year+month+day (form B).
datetime string Solar datetime as ISO 'YYYY-MM-DD HH:mm[:ss]' (e.g. '2026-07-01 10:30'). FORM A for entering a moment — use this field OR the numeric year+month+day+hour set, never both.
tz number = 7 Timezone (UTC offset). Default 7 = Vietnam (UTC+7).
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/ganzhi/calendar-pillars?datetime=2026-09-06+10%3A30"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/ganzhi/calendar-pillars" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"datetime":"2026-09-06 10:30"}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/ganzhi/calendar-pillars", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "datetime": "2026-09-06 10:30"
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "lunar": {
      "day": 25,
      "month": 7,
      "year": 2026,
      "leap": false
    },
    "pillars": {
      "year": {
        "code": "Bing-Wu",
        "stem": "Bing",
        "branch": "Wu",
        "label": {
          "vi": "Bính Ngọ"
        }
      },
      "month": {
        "code": "Bing-Shen",
        "stem": "Bing",
        "branch": "Shen",
        "label": {
          "vi": "Bính Thân"
        }
      },
      "day": {
        "code": "Gui-Wei",
        "stem": "Gui",
        "branch": "Wei",
        "label": {
          "vi": "Quý Mùi"
        }
      },
      "hour": {
        "code": "Ding-Si",
        "stem": "Ding",
        "branch": "Si",
        "label": {
          "vi": "Đinh Tỵ"
        }
      }
    }
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "ganzhi@0.1.1",
    "conventions": {
      "pillarBasis": "lunar_calendar",
      "yearBoundary": "lunar_new_year",
      "monthBoundary": "lunar_first",
      "ziHourBoundary": "midnight",
      "calendarEngine": "ho_ngoc_duc"
    }
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.

Ngũ hành

Quan hệ sinh / khắc giữa năm hành. Không phụ thuộc lịch, trường phái hay thời điểm.

Quan hệ sinh/khắc ngũ hành của một hành, và giữa hai hành.

wuxing.relations · 1 lượt/lần gọi

Five-element (ngũ hành) generating/controlling lookup. Given one element, returns its full row of the two cycles — what it generates (我生), is generated by (生我), controls (我克), is controlled by (克我). Given a second element via 'target', also names their directed relation. Universal relations — no school variance, no calendar, no time input. Element codes match the element/nayin fields other ops emit: wood, fire, earth, metal, water.

REST
GET /api/v1/wuxing/relations · POST /api/v1/wuxing/relations
MCP tool
wuxing_relations

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
element 'wood' | 'fire' | 'earth' | 'metal' | 'water' Element, by machine code: wood=Mộc, fire=Hỏa, earth=Thổ, metal=Kim, water=Thủy — the same codes calendar.dayInfo and ganzhi.calendarPillars emit in their element/nayin fields.
target 'wood' | 'fire' | 'earth' | 'metal' | 'water' Second element (optional). When present the response adds a 'withTarget' block: the DIRECTED relation from 'element' toward 'target' (generates / generated by / controls / controlled by / same).
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/wuxing/relations?element=wood&target=fire"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/wuxing/relations" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"element":"wood","target":"fire"}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/wuxing/relations", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "element": "wood",
    "target": "fire"
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "element": {
      "code": "wood",
      "label": {
        "vi": "Mộc",
        "zh": "木",
        "pinyin": "mù",
        "en": "Wood"
      }
    },
    "cycle": {
      "generates": {
        "code": "fire",
        "label": {
          "vi": "Hỏa",
          "zh": "火",
          "pinyin": "huǒ",
          "en": "Fire"
        }
      },
      "generatedBy": {
        "code": "water",
        "label": {
          "vi": "Thủy",
          "zh": "水",
          "pinyin": "shuǐ",
          "en": "Water"
        }
      },
      "controls": {
        "code": "earth",
        "label": {
          "vi": "Thổ",
          "zh": "土",
          "pinyin": "tǔ",
          "en": "Earth"
        }
      },
      "controlledBy": {
        "code": "metal",
        "label": {
          "vi": "Kim",
          "zh": "金",
          "pinyin": "jīn",
          "en": "Metal"
        }
      }
    },
    "withTarget": {
      "target": {
        "code": "fire",
        "label": {
          "vi": "Hỏa",
          "zh": "火",
          "pinyin": "huǒ",
          "en": "Fire"
        }
      },
      "relation": {
        "code": "generates",
        "label": {
          "vi": "ta sinh",
          "zh": "我生",
          "pinyin": "wǒ shēng",
          "en": "generates"
        }
      }
    }
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "wuxing@0.1.0"
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.

Kinh dịch

Gieo quẻ theo số hoặc theo thời điểm, và tra cứu cấu trúc, kinh văn, luận quẻ của 64 quẻ.

Gieo quẻ kinh dịch theo số Thượng–Hạ–Động hoặc theo thời điểm.

iching.cast · 1 lượt/lần gọi

Cast an I Ching (kinh dịch) hexagram by the Upper–Lower–Moving number method or by time. method=numbers → upper/lower/moving; method=time → datetime OR year+month+day+hour. Deliberately thin: for the full scripture and commentary of the hexagram just cast, follow up with iching.hexagram using query=<kingWen> and include=canonicalText,interpretation.

REST
GET /api/v1/iching/cast · POST /api/v1/iching/cast
MCP tool
iching_cast

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
method 'numbers' | 'time' Casting method. 'numbers' = by the Upper–Lower–Moving numbers → fill upper/lower/moving. 'time' = by datetime → fill datetime OR year+month+day+hour.
upper integer [method=numbers · REQUIRED] Upper number → upper (outer) trigram; taken mod 8 (0 → 8).
lower integer [method=numbers · REQUIRED] Lower number → lower (inner) trigram; taken mod 8.
moving integer [method=numbers · optional] Moving number → moving line; taken mod 6. Omitted → (upper+lower) mod 6.
year integer [method=time] Solar year. Needs all of year+month+day+hour, or use 'datetime'.
month integer [method=time] Month (1-12). With year+day+hour.
day integer [method=time] Day (1-31). With year+month+hour.
hour integer [method=time] Hour (0-23). With year+month+day.
datetime string Solar datetime as ISO 'YYYY-MM-DD HH:mm[:ss]' (e.g. '2026-07-01 10:30'). FORM A for entering a moment — use this field OR the numeric year+month+day+hour set, never both.
tz number = 7 Timezone (UTC offset). Default 7 = Vietnam (UTC+7).
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/iching/cast?method=numbers&upper=7&lower=3&moving=5"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/iching/cast" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"method":"numbers","upper":7,"lower":3,"moving":5}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/iching/cast", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "method": "numbers",
    "upper": 7,
    "lower": 3,
    "moving": 5
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "primary": {
      "code": "hex.22",
      "kingWen": 22,
      "glyph": "䷕",
      "binary": "101001",
      "name": {
        "vi": "Sơn Hỏa Bí",
        "zh": "山火賁",
        "en": "Adornment",
        "pinyin": "bì"
      },
      "judgment": {
        "zh": "亨。小利有攸往。",
        "vi": "Hanh thông. Hơi lợi có sự đi.",
        "en": "Pî indicates that there should be free course (in what it denotes). There will be little advantage (however) if it be allowed to advance (and take the lead)."
      }
    },
    "mutual": {
      "code": "hex.40",
      "kingWen": 40,
      "glyph": "䷧",
      "binary": "010100",
      "name": {
        "vi": "Lôi Thủy Giải",
        "zh": "雷水解",
        "en": "Release",
        "pinyin": "xiè"
      },
      "judgment": {
        "zh": "利西南,无所往,其來復吉。有攸往,夙吉。",
        "vi": "Lợi ở phía tây nam. Không có chỗ nào đi, thì trở về là tốt. Có sự đi, thì đi sớm là tốt.",
        "en": "In (the state indicated by) Kieh advantage will be found in the south-west. If no (further) operations be called for, there will be good fortune in coming back (to the old conditions). If some operations be called for, there will be good fortune in the early conducting of them."
      }
    },
    "changed": {
      "code": "hex.37",
      "kingWen": 37,
      "glyph": "䷤",
      "binary": "101011",
      "name": {
        "vi": "Phong Hỏa Gia Nhân",
        "zh": "風火家人",
        "en": "The Family",
        "pinyin": "jiā rén"
      },
      "judgment": {
        "zh": "利女貞。",
        "vi": "Lợi cho người con gái giữ chính bền.",
        "en": "For (the realisation of what is taught in) Aia Zan, (or for the regulation of the family), what is most advantageous is that the wife be firm and correct."
      }
    },
    "movingLine": {
      "position": 5,
      "primary": {
        "zh": "賁於丘園,束帛戔戔,吝,終吉。",
        "vi": "Làm vẻ ở vườn trên gò, bó lụa ít ỏi, đáng tiếc, nhưng cuối cùng thì tốt.",
        "en": "The fifth line, divided, shows its subject adorned by (the occupants of) the heights and gardens. He bears his roll of silk, small and slight. He may appear stingy; but there will be good fortune in the end."
      },
      "mutual": {
        "zh": "君子維有解,吉;有孚于小人。",
        "vi": "Quân tử chỉ có việc cởi bỏ, tốt; và có lòng thành đối với tiểu nhân.",
        "en": "The fifth line, divided, shows (its subject), the superior man (=the ruler), executing his function of removing (whatever is injurious to the idea of the hexagram), in which case there will be good fortune, and confidence in him will be shown even by the small men."
      },
      "changed": {
        "zh": "王假有家,勿恤。吉。",
        "vi": "Nhà vua đến với nhà; chớ lo, tốt.",
        "en": "The fifth line, undivided, shows the influence of the king extending to his family. There need be no anxiety; there will be good fortune."
      }
    },
    "numbers": {
      "upper": 7,
      "lower": 3,
      "moving": 5
    }
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "iching@0.1.1",
    "conventions": {
      "bitOrder": "bottom_up",
      "ziHourBoundary": "midnight"
    },
    "sources": [
      {
        "id": "zhouyi-zh-wikisource",
        "rightsStatus": "public_domain",
        "appliesTo": [
          "primary.judgment",
          "mutual.judgment",
          "changed.judgment",
          "movingLine.primary",
          "movingLine.mutual",
          "movingLine.changed"
        ],
        "note": "周易 nguyên văn, nhập từ zh.wikisource; revid ghim trong iching.hexagram.canonicalText.source."
      },
      {
        "id": "naturaos-vi-translation",
        "rightsStatus": "permissive",
        "appliesTo": [
          "primary.judgment",
          "mutual.judgment",
          "changed.judgment",
          "movingLine.primary",
          "movingLine.mutual",
          "movingLine.changed"
        ],
        "note": "Bản dịch tiếng Việt do naturaos thực hiện, dịch thẳng từ nguyên văn."
      },
      {
        "id": "legge-1882",
        "rightsStatus": "public_domain",
        "appliesTo": [
          "primary.judgment",
          "mutual.judgment",
          "changed.judgment",
          "movingLine.primary",
          "movingLine.mutual",
          "movingLine.changed"
        ],
        "note": "Bản dịch tiếng Anh James Legge 1882 (Sacred Books of the East XVI), public domain. Số hoá: en.wikisource (quẻ 1–31, ghim revid) + archive.org mlbd.sacredbooksofeas0000fmax.vol.16 (32–64); sha256 corpus ghi trong canonical-text.ts."
      }
    ]
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.

Tra một quẻ kinh dịch: hai quái, sáu hào, quan hệ, kinh văn và luận quẻ.

iching.hexagram · 3 lượt/lần gọi

Look up an I Ching (kinh dịch) hexagram WITHOUT casting — no datetime, no moving line. Returns structural facts: the two trigrams with their virtue (卦德), image and element, the six lines with their classical relations (correctness, centrality, correspondence, adjacency, three powers), and optionally the relation graph (opposite, inverse, nuclear, dual-image, tidal hexagrams). Text rides on include: 'canonicalText' = the 周易 scripture (zh + vi; Text layer also en/Legge 1882), 'interpretation' = naturaos's own editorial commentary (vi only). query = King Wen number, 6-bit binary, 'hex.NN', or the full Vietnamese name.

REST
GET /api/v1/iching/hexagram · POST /api/v1/iching/hexagram
MCP tool
iching_hexagram

Tham số

GET nhận tham số trên query string, POST nhận cùng tham số trong JSON body. Mảng qua GET viết cách nhau bằng dấu phẩy.

Tham sốKiểuBắt buộcMô tả
query integer | string Hexagram to look up. Five forms, resolved in this order: (1) integer 1-64 → King Wen number; (2) 6-character 0/1 string → binary read bottom-up, e.g. '100000' = Địa Lôi Phục; (3) 1-2 digit string → also a King Wen number, e.g. '24' (GET passes everything as a string; no zero padding — '024' fails because form 2 takes precedence); (4) 'hex.NN' → hexagram code, exactly 2 digits, lowercase, e.g. 'hex.24' (not 'hex.1'); (5) anything else → the full Vietnamese name, e.g. 'Địa Lôi Phục' (Vietnamese only; short forms like 'Phục' do NOT resolve). Names that collide once diacritics are stripped → an error listing the candidates.
view 'compact' | 'standard' | 'full' = "standard" Detail level: compact = identity + the two trigrams; standard (default) = plus a six-line summary; full = plus the complete line-position relations (correspondence, adjacency, three powers, roles).
include 'relations' | 'canonicalText' | 'interpretation'[] = [] Optional blocks, orthogonal to view. 'relations' = the relation graph (opposite, inverse, nuclear, dual-image, tidal hexagrams). 'canonicalText' = scripture: judgment, judgment commentary, great image, line texts and small images, with Vietnamese translation. 'interpretation' = naturaos's own editorial commentary — NOT scripture. Over GET: ?include=relations,canonicalText,interpretation.
lang 'vi' | 'en' | 'zh' | 'all' = "vi" Language of the labels in the response. vi (default) · en · zh (with pinyin) · all (every available language). A label missing the requested language falls back to vi; meta.language.available reports which languages this response actually carries. Error messages are unaffected.
format 'json' | 'text-tree' = "json" Output format: json (default) or text-tree (an indented outline, easy for a person or an LLM to read).

Ví dụ

curl · GET
curl -H "Authorization: Bearer <key>" \
  "https://naturaos.mza.vn/api/v1/iching/hexagram?query=24&view=compact"
curl · POST
curl -X POST "https://naturaos.mza.vn/api/v1/iching/hexagram" \
  -H "Authorization: Bearer <key>" \
  -H "content-type: application/json" \
  -d '{"query":24,"view":"compact"}'
JavaScript · fetch
const res = await fetch("https://naturaos.mza.vn/api/v1/iching/hexagram", {
  method: "POST",
  headers: { authorization: "Bearer <key>", "content-type": "application/json" },
  body: JSON.stringify({
    "query": 24,
    "view": "compact"
  }),
});
const { ok, data, meta } = await res.json();

Response

Kết quả thật của engine cho đúng input ở trên — sinh lúc dựng trang, không phải mẫu dán tay.

200 · application/json
{
  "ok": true,
  "data": {
    "id": {
      "kingWen": 24,
      "code": "hex.24",
      "glyph": "䷗",
      "binary": "100000"
    },
    "name": {
      "vi": "Địa Lôi Phục",
      "zh": "地雷復",
      "en": "Return",
      "pinyin": "fù"
    },
    "trigrams": {
      "lower": {
        "code": "Zhen",
        "binary": "100",
        "glyph": "☳",
        "name": {
          "vi": "Chấn",
          "pinyin": "Zhèn",
          "zh": "震",
          "en": "Thunder"
        },
        "attribute": {
          "code": "movement",
          "label": {
            "vi": "động",
            "zh": "動",
            "en": "moving"
          }
        },
        "image": {
          "code": "thunder",
          "label": {
            "vi": "lôi",
            "zh": "雷",
            "en": "thunder"
          }
        },
        "phase": "wood",
        "familyRole": {
          "code": "eldest_son",
          "label": {
            "vi": "trưởng nam",
            "zh": "長男",
            "en": "eldest son"
          }
        },
        "fuxiSequenceNumber": 4,
        "earlierHeaven": {
          "direction": "NE"
        },
        "laterHeaven": {
          "number": 3,
          "direction": "E"
        }
      },
      "upper": {
        "code": "Kun",
        "binary": "000",
        "glyph": "☷",
        "name": {
          "vi": "Khôn",
          "pinyin": "Kūn",
          "zh": "坤",
          "en": "Earth"
        },
        "attribute": {
          "code": "yielding",
          "label": {
            "vi": "thuận",
            "zh": "順",
            "en": "docile"
          }
        },
        "image": {
          "code": "ground",
          "label": {
            "vi": "địa",
            "zh": "地",
            "en": "ground"
          }
        },
        "phase": "earth",
        "familyRole": {
          "code": "mother",
          "label": {
            "vi": "mẫu",
            "zh": "母",
            "en": "mother"
          }
        },
        "fuxiSequenceNumber": 8,
        "earlierHeaven": {
          "direction": "N"
        },
        "laterHeaven": {
          "number": 2,
          "direction": "SW"
        }
      }
    },
    "combinedAttribute": {
      "vi": "động mà thuận",
      "zh": "動而順",
      "en": "moving yet docile"
    }
  },
  "meta": {
    "disclaimer": "Kết quả mang tính chất tham khảo học thuật và chiêm nghiệm triết học tự nhiên. Không nên tin tưởng tuyệt đối 100%, người dùng hãy tự mình quan sát, chiêm nghiệm và kiểm chứng qua thực tế đời sống.",
    "motto": "Nhân pháp Địa • Địa pháp Thiên • Thiên pháp Đạo • Đạo pháp Tự Nhiên",
    "engine": "iching@0.1.1",
    "conventions": {
      "bitOrder": "bottom_up",
      "hexagramOrder": "king_wen"
    }
  }
}

Minh triết tự nhiên chỉ là gợi ý — quyết định và kết quả nằm ở hành động thực tế của chính bạn.