# I Ching, runes, biorhythm

Every route on this page costs **10 credits**. Draws take an optional `seed`: the same seed always gives the same cast, so a reading can be shown again or tested.

## I Ching

The text is James Legge's translation, *The Yi King* (Sacred Books of the East XVI, 1882; 2nd ed. 1899), which is in the public domain: the judgment of each hexagram and the statement of each line.

| Route | What it returns |
|---|---|
| `POST /v1/iching/reading` | Primary hexagram, the text of each changing line, the resulting hexagram, and `focus`: which texts to read |
| `GET /v1/iching/trigrams` | The eight trigrams: image, attribute, family member, animal, body part, Earlier and Later Heaven number and direction, five-phase element |
| `POST /v1/iching/trigram-analysis` | Both trigrams of a hexagram, nuclear trigrams and nuclear hexagram, the figure turned over and the figure with every line changed |
| `POST /v1/iching/compatibility` | Two hexagrams compared line by line and by the phases of their trigrams, with a 0-100 score whose formula is in the response |
| `POST /v1/iching/plum-blossom` | A cast from the moment of the question by the Mei Hua method: lunar year branch, month, day and hour |
| `POST /v1/iching/yearly` | The same formula for a person and a year (`basis: convention`) |

`/reading` takes your own coins: send six totals from bottom to top (6 old yin, 7 young yang, 8 young yin, 9 old yang). Without `lines` it casts from `seed`, and with the same seed it gives the same hexagram as `/iching/throw-coins`. `focus` follows Zhu Xi's rule (1186): no changing line, read the judgment; one, that line; two, both lines with the upper leading; three, both judgments; four, the two unchanged lines of the resulting hexagram; five, its one unchanged line; six, the use of nines or sixes on Qian and Kun, otherwise the resulting judgment.

  **cURL**
    ```bash frame="terminal"
    curl -X POST https://api.astroway.info/v1/iching/reading \
      -H "X-Api-Key: aw_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{ "lines": [9, 7, 7, 7, 7, 7] }'
    ```

```json
{
  "primary": { "number": 1, "name": "The Creative", "pinyin": "Qian", "legge": "Khien", "judgment": "Khien (represents) what is great and originating, penetrating, advantageous, correct and firm." },
  "changingLines": [{ "position": 1, "text": "In the first (or lowest) line, undivided, (we see its subject as) the dragon lying hid (in the deep). It is not the time for active doing." }],
  "resulting": { "number": 44, "pinyin": "Gou" },
  "focus": { "rule": "One changing line: read that line.", "texts": [{ "hexagram": 1, "part": "line 1" }] }
}
```

`/plum-blossom` needs `date` and `time` of the question and, for a place outside China, `timezoneOffset` (hours from UTC); the lunar month and day come from the ephemeris. The upper trigram is (year + month + day) mod 8, the lower adds the hour, the moving line is that sum mod 6, and the response shows every term. `tiYong` names the trigram of the asker (ti) and of the matter (yong) and how their phases stand.

**Note:**
The compatibility score and the yearly cast are conventions of this API and say so in the response. The English hexagram names in `name` are the ones the older I Ching routes return; the texts are Legge's.

## Runes

Every rune in a draw carries `poem`: its stanza of the Old English Rune Poem (public domain), with a plain-English gloss we wrote.

- `POST /v1/runes/five`: five runes in a cross, Present, Past, Future, Help, Challenge.
- `POST /v1/runes/bind-rune`: two to four runes (`runes`, Elder Futhark slugs) or the runes whose meanings name an `intent`, joined on one stave. Returns each rune's SVG, the combined strokes as coordinates and `bindRune.svg`, ready for an `<img>` or inline.
- `POST /v1/runes/calendar`: the medieval Scandinavian runestaff for a date. The day rune repeats seven runes from 1 January; the Sunday rune is the year's dominical letter (two in a leap year); the golden-number rune marks the year of the 19-year lunar cycle.

```bash
curl -X POST https://api.astroway.info/v1/runes/bind-rune \
  -H "X-Api-Key: aw_live_your_key_here" -H "Content-Type: application/json" \
  -d '{ "runes": ["algiz", "sowilo"] }'
```

## Biorhythm

Biorhythm is a 19th-century model (23, 28 and 33-day sines, Fliess and Swoboda) with no evidential support. The routes do the arithmetic exactly, name the formula and carry a disclaimer; they make no health claim.

- `POST /v1/wellness/biorhythm/compatibility`: two birth dates. Per cycle the phase offset and 50 x (1 + cos(2 pi x offset / period)); the offset is set at birth, so the figure never changes.
- `POST /v1/wellness/biorhythm/best-days`: the highest days in a range by the sum of the three values, critical days left out unless `excludeCritical: false`.

Critical days for a range are already in `POST /v1/wellness/biorhythm` (`criticalDays`).

## Crystals and dreams

- `GET /v1/esoteric/crystals/by-planet/{planet}`: crystals by their traditional planet.
- `POST /v1/esoteric/dreams/journal`: up to 100 dated entries. Per symbol: in how many entries it appears, first and last date, whether it recurs and its trend.
