I Ching Hexagram API

Lookup hexagram by line pattern

GET/iching/hexagrams/lookupGET/iching/hexagramsGET/iching/hexagrams/{number}GET/iching/hexagrams/random

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

ParameterTypeDescription
langquerystring enumResponse 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*querystringSix-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.

200 OK
{
  "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

FieldTypeDescription
number*numberHexagram number in the traditional King Wen sequence (1-64), the standard ordering used in I-Ching divination for over 3,000 years.
symbol*stringUnicode hexagram symbol (U+4DC0 block) representing all six lines. Use for visual display in I-Ching apps and divination interfaces.
chinese*stringOriginal Chinese character name of the hexagram in traditional script.
english*stringEnglish translation of the hexagram name, conveying the core concept and life situation it represents.
pinyin*stringPinyin romanization of the Chinese name with tone marks for correct pronunciation.
binary*stringBinary 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*stringUpper trigram (lines 4-6). One of 8 trigrams: Heaven, Earth, Thunder, Wind, Water, Fire, Mountain, Lake.
lowerTrigram*stringLower trigram (lines 1-3). Combines with the upper trigram to form the hexagram and its meaning.
judgment*stringThe Judgment (Tuan) text, the primary oracle statement of the hexagram offering core guidance and outcome.
image*stringThe Image (Xiang) text, symbolic guidance derived from the trigram combination describing the ideal attitude and action.
interpretation*object
interpretation.general*stringGeneral life situation interpretation of this hexagram.
interpretation.love*stringLove and relationship guidance from this hexagram.
interpretation.career*stringCareer and professional life interpretation.
Show all fields
FieldTypeDescription
interpretation.decision*stringDecision-making guidance for whether to act, wait, retreat, or advance based on this hexagram.
interpretation.advice*stringPractical wisdom and actionable advice from this hexagram for daily life application.
changingLines*array of objectChanging line interpretations for all 6 lines
changingLines[].position*numberLine position (1-6, bottom to top). In I-Ching, each hexagram has six lines (yao) read from bottom upward.
changingLines[].text*stringThe 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[].meaningstringWhat 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

entrdeeshiptfrru

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.

TypeScript
import { createRoxy } from '@roxyapi/sdk'

const roxy = createRoxy(process.env.ROXY_API_KEY!)
const { data } = await roxy.iching.lookupHexagram({ query: { lines: '111111' } })
Install: npm install @roxyapi/sdk

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.

GET/iching/hexagrams

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 live
GET/iching/hexagrams/{number}

Get 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 live
GET/iching/hexagrams/random

Get 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 live

Remote 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 Code / Cursor
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.

<roxy-hexagram>
See them live on Roxy UI

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