# I Ching Hexagram API

> I Ching Hexagram API. Find an I-Ching hexagram by its binary line pattern. Provide 6 digits (0 or 1) representing broken (yin) and solid (yang) lines from

- Capability page: https://roxyapi.com/apis/i-ching-hexagram-api
- Full domain: https://roxyapi.com/products/iching-api
- OpenAPI spec: https://roxyapi.com/api/v2/iching/openapi.json
- Remote MCP server: https://roxyapi.com/mcp/iching

## Overview

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).

## Endpoints

- `GET /api/v2/iching/hexagrams/lookup` Lookup hexagram by line pattern
- `GET /api/v2/iching/hexagrams` List all 64 hexagrams
- `GET /api/v2/iching/hexagrams/{number}` Get hexagram by number
- `GET /api/v2/iching/hexagrams/random` Get a random hexagram

## Example request

```bash
curl "https://roxyapi.com/api/v2/iching/hexagrams/lookup?lines=111111" \
  -H "X-API-Key: YOUR_KEY"
```

## Example response

```json
{
  "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."
    }
  ]
}
```

## Remote MCP

Every endpoint is a callable tool on the Remote MCP server at https://roxyapi.com/mcp/iching over Streamable HTTP. Tool name for `GET /iching/hexagrams/lookup`: `get_iching_hexagrams_lookup`. `tools/list` is free; `tools/call` bills the same as REST.

## 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.

## Full reference

Fetch the OpenAPI spec at https://roxyapi.com/api/v2/iching/openapi.json. Master agent manifest at https://roxyapi.com/llms.txt.
