I Ching Hexagram API
Lookup hexagram by line pattern
Find an I-Ching hexagram by its binary line pattern. Provide 6 digits (0 or 1) representing broken (yin) and solid (yang) lines from bottom to top. Use this for custom divination interfaces where users input their own line configurations, or to find hexagrams matching specific trigram combinations. Example: "111111" returns Hexagram 1 (The Creative), "000000" returns Hexagram 2 (The Receptive).
Request
GET /api/v2/iching/hexagrams/lookup
Parameters
| Parameter | Type | Description |
|---|---|---|
| langquery | string enum | Response language (ISO 639-1). Supported: en, tr, de, es, hi, pt, fr, ru. Defaults to en. Languages without translations yet return English. Default en. |
| lines*query | string | Six-digit binary pattern (0=yin/broken, 1=yang/solid) from bottom to top. |
Response
Structured JSON with documented fields, verified against NASA JPL Horizons across 828 gold-standard tests. Not hallucinated text.
{
"number": 1,
"symbol": "䷀",
"chinese": "乾",
"english": "The Creative",
"pinyin": "Qián",
"binary": "111111",
"upperTrigram": "Heaven",
"lowerTrigram": "Heaven",
"judgment": "Pure creative force is available and it runs from origin to completion without obstruction, so the situation rewards initiative that stays correct and does not slacken. Success here is built by sustained effort held to a straight line, not by a single burst.",
"image": "Heaven above heaven: the same motion repeated without pause and without fatigue. Renew your own strength on your own schedule rather than waiting to be driven by circumstances.",
"interpretation": {
"general": "This hexagram represents the primal power of creation and the energy of pure initiative.",
"love": "A time of strong attraction and passionate connection. Take the initiative in expressing your feelings.",
"career": "Exceptional opportunities for advancement and recognition. Your creative ideas are at their peak.",
"decision": "The time is right for bold action. Trust your instincts and move forward with confidence.",
"advice": "Be like the heavens: consistent, powerful, and untiring. Make yourself strong through steady effort."
},
"changingLines": [
{
"position": 1,
"text": "The dragon is still hidden below the surface, so it does not act."
}
]
}Response fields
| Field | Type | Description |
|---|---|---|
| number* | number | Hexagram number in the traditional King Wen sequence (1-64), the standard ordering used in I-Ching divination for over 3,000 years. |
| symbol* | string | Unicode hexagram symbol (U+4DC0 block) representing all six lines. Use for visual display in I-Ching apps and divination interfaces. |
| chinese* | string | Original Chinese character name of the hexagram in traditional script. |
| english* | string | English translation of the hexagram name, conveying the core concept and life situation it represents. |
| pinyin* | string | Pinyin romanization of the Chinese name with tone marks for correct pronunciation. |
| binary* | string | Binary line pattern (6 digits, bottom to top). 1 = yang (solid line), 0 = yin (broken line). Lines 1-3 form the lower trigram, lines 4-6 form the upper trigram. |
| upperTrigram* | string | Upper trigram (lines 4-6). One of 8 trigrams: Heaven, Earth, Thunder, Wind, Water, Fire, Mountain, Lake. |
| lowerTrigram* | string | Lower trigram (lines 1-3). Combines with the upper trigram to form the hexagram and its meaning. |
| judgment* | string | The Judgment (Tuan) text, the primary oracle statement of the hexagram offering core guidance and outcome. |
| image* | string | The Image (Xiang) text, symbolic guidance derived from the trigram combination describing the ideal attitude and action. |
| interpretation* | object | |
| interpretation.general* | string | General life situation interpretation of this hexagram. |
| interpretation.love* | string | Love and relationship guidance from this hexagram. |
| interpretation.career* | string | Career and professional life interpretation. |
Show all fieldsShow fewer fields
| Field | Type | Description |
|---|---|---|
| interpretation.decision* | string | Decision-making guidance for whether to act, wait, retreat, or advance based on this hexagram. |
| interpretation.advice* | string | Practical wisdom and actionable advice from this hexagram for daily life application. |
| changingLines* | array of object | Changing line interpretations for all 6 lines |
| changingLines[].position* | number | Line position (1-6, bottom to top). In I-Ching, each hexagram has six lines (yao) read from bottom upward. |
| changingLines[].text* | string | The oracle statement for this line. It applies when this specific line comes up changing (old yin or old yang) in a casting, and it speaks in the concrete imagery of the tradition. |
| changingLines[].meaning | string | What the line statement asks of the querent, read from its position in the hexagram (1 is the hidden beginning, 3 is the exposed threshold, 5 is the ruling line, 6 is past the peak) and from whether the line is yin or yang. This is the meaning behind the image, so a consuming agent does not have to invent one. |
Supported options
lang
Call it in your language in seconds.
Every snippet is generated from the live OpenAPI spec, so method names, parameters, and fields always match production.
import { createRoxy } from '@roxyapi/sdk'
const roxy = createRoxy(process.env.ROXY_API_KEY!)
const { data } = await roxy.iching.lookupHexagram({ query: { lines: '111111' } })from roxy_sdk import create_roxy
roxy = create_roxy("YOUR_API_KEY")
result = roxy.iching.lookup_hexagram(lines='111111')use function RoxyAPI\Sdk\createRoxy;
$roxy = createRoxy(getenv('ROXY_API_KEY'));
$result = $roxy->iching->lookupHexagram(lines: '111111');using RoxyApi;
var roxy = new RoxyClient(Environment.GetEnvironmentVariable("ROXY_API_KEY")!);
var result = await roxy.Iching.Hexagrams.Lookup.GetAsync();import roxyapi "github.com/RoxyAPI/sdk-go"
roxy, _ := roxyapi.NewRoxy(os.Getenv("ROXY_API_KEY"))
resp, _ := roxy.Iching.LookupHexagram(ctx, nil)curl "https://roxyapi.com/api/v2/iching/hexagrams/lookup?lines=111111" \
-H "X-API-Key: YOUR_KEY"Prefer to try before you write code? Run this I-Ching endpoint live in the API playground and inspect a real production response.
More I Ching Hexagram endpoints
The I Ching Hexagram API bundles these related endpoints under one key.
List all 64 hexagrams
Browse all 64 I-Ching hexagrams from the Book of Changes with their Chinese names, English translations, and trigram compositions. The hexagrams are ordered by the traditional King Wen sequence used in I-Ching divination for 3,000 years. Each hexagram represents a unique life situation combining two trigrams (Heaven, Earth, Thunder, Wind, Water, Fire, Mountain, Lake) into profound wisdom for decision-making and self-understanding.
Try it liveGet hexagram by number
Retrieve complete I-Ching hexagram details by King Wen sequence number (1-64). Returns the full hexagram with Chinese name, English translation, judgment text, image text, modern interpretations for general situations, love, career, and decision-making, plus all six changing line meanings. Use this to display detailed hexagram information after casting or for educational reference.
Try it liveGet a random hexagram
Receive a random I-Ching hexagram with full interpretation. Perfect for daily oracle features, meditation prompts, or exploring the Book of Changes. Returns complete hexagram data including judgment, image, interpretations for love/career/decisions, and all six changing line meanings.
Try it liveRemote MCP for AI agents
Every I-Ching endpoint is a callable tool on the Remote MCP server over Streamable HTTP. No local setup, no Docker. Claude, ChatGPT, Cursor, and any MCP client auto-discover the tools and ground their answers in verified data.
claude mcp add --transport http \
roxy-iching https://roxyapi.com/mcp/iching \
--header "X-API-Key: YOUR_KEY"Tool name for GET /iching/hexagrams/lookup: get_iching_hexagrams_lookup. Full MCP setup guide
What you can build
Build I-Ching divination apps with authentic coin-toss readings: users ask their question and receive complete hexagram interpretations with changing lines and transformations
Add daily oracle features to wellness and meditation apps: daily hexagrams, daily cast readings, and contemplation prompts from 3,000 years of Chinese philosophy
Build AI I-Ching chatbots with MCP: your OpenAI, Claude, or Gemini agent auto-discovers oracle endpoints and delivers conversational hexagram readings
Create Chinese philosophy education platforms teaching the Book of Changes, Taoist principles, trigram symbolism, and hexagram patterns through interactive exploration
Ship comprehensive spiritual guidance platforms combining I-Ching with astrology, tarot, numerology, and dream interpretation under one API key
Power decision-making and journaling apps: users record situations, cast hexagrams, track how readings relate to outcomes, and gain clarity through structured ancient wisdom
Drop-in UI components
Render I Ching Hexagram API responses without building charts yourself. These open source, framework-agnostic web components take the typed response and draw it, in React, Vue, Svelte, Angular, plain HTML, and WordPress.
Related capabilities
I Ching Hexagram API FAQ
What does the I Ching Hexagram API return?
Find an I-Ching hexagram by its binary line pattern. Every response is structured JSON with documented fields, not free text, so you map it straight into your product.
How do I authenticate with the I Ching Hexagram API?
Pass your key in the X-API-Key header on every request. Keys are delivered instantly at checkout with no approval queue. Use a secret sk key server side, or mint a publishable pk key locked to your origins for browser and no-code use.
Does the I Ching Hexagram API support multiple languages?
Yes. Append the lang query parameter to any endpoint for responses in English, German, Spanish, French, Hindi, Portuguese, Russian and Turkish. The translated payload includes the full interpretation text, not just field labels.
Is the I Ching Hexagram API available over Remote MCP for AI agents?
Yes. Every endpoint is exposed as a callable tool on the Remote MCP server at https://roxyapi.com/mcp/iching over Streamable HTTP, so Claude, ChatGPT, Cursor, and any MCP client auto-discover it with no local setup or Docker.
How is the I Ching Hexagram API billed?
Flat pricing: 1 request equals 1 quota unit, REST and MCP identical, with no credit weighting or per-token markup. Every plan includes all 12 domains, so the I Ching Hexagram API is included at no extra cost.
What lang values does the I Ching Hexagram API accept?
The lang parameter accepts en, tr, de, es, hi, pt, fr, ru. Case-insensitive where it is a path value.
Start using I Ching Hexagram API today.
Bring 3,000 years of I-Ching wisdom to your app. In days.
All 12 domains included with every plan. Every endpoint, MCP server, SDK, and starters.
Plans from $39/mo, starting at $2.70 per domain on annual billing. No credit card required for testing.
View Pricing & Get API Key