Use this when you need to identify or describe a hexagram, convert between its number, name, trigram pair and line pattern, or find its derived hexagrams and palace position. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this when you have moving lines and need the changed hexagram and reading rule (use hexagram-change), or you need to cast a hexagram from a date or numbers (use meihua-yishu).
What it computes: Identifies one of the 64 hexagrams (六十四卦, liushisi gua) from its King Wen number, name, two trigrams or line digits and returns its lines, trigrams, nuclear (互卦, hugua), inverse (综卦, zonggua) and opposite (错卦, cuogua) hexagrams, its Jing Fang palace (京房八宫, Jingfang bagong) with 世/应 (shi/ying) lines, and the received judgment text (卦辞, guaci).
Inputs: king_wen_number (integer, optional); name (string, optional); upper_trigram (string, optional); lower_trigram (string, optional); lines (string, optional).
Valid input combinations: Identify the hexagram with king_wen_number, name, lines, or the complete upper_trigram + lower_trigram pair. Multiple identification methods may be supplied when they agree.
Complete JSON argument examples: {"king_wen_number":1} | {"lines":"100010"}
Outputs: number, name_cn, full_name_cn, pinyin, english, symbol, lines, lines_text, upper_trigram, lower_trigram, nuclear_hexagram, inverse_hexagram, opposite_hexagram, palace, palace_position, shi_line, ying_line, judgment_text, sequence_pair, binary_value, notes.
Formula: lower trigram = lines 1–3, upper trigram = lines 4–6; nuclear = lines 2,3,4 + 3,4,5; inverse = reversed line order; opposite = each line flipped; binary_value = Σ line_i · 2^(i−1); 应 = 世 ± 3
Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/hexagram-lookup with the same JSON input fields. Do not guess another /api/* path.
Docs: https://tttkmbb.com/yijing/hexagram-lookup.md