Plum Blossom (Mei Hua) Cast
curl -X POST https://api.astroway.info/v1/iching/plum-blossom \ -H "X-Api-Key: aw_live_..." \ -H "Content-Type: application/json" \ -d '{ "date": "2026-11-07", "time": "10:30", "timezoneOffset": 2 }'const res = await fetch('https://api.astroway.info/v1/iching/plum-blossom', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "date": "2026-11-07", "time": "10:30", "timezoneOffset": 2 }),});const { ok, data, error } = await res.json();if (!ok) throw new Error(error.message);console.log(data);import os, requests
r = requests.post( 'https://api.astroway.info/v1/iching/plum-blossom', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': "2026-11-07", 'time': "10:30", 'timezoneOffset': 2 },)result = r.json()if not result['ok']: raise RuntimeError(result['error']['message'])print(result['data'])<?phpuse GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.astroway.info/v1/']);$r = $client->post('iching/plum-blossom', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '2026-11-07', 'time' => '10:30', 'timezoneOffset' => 2, ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);Casts a hexagram from the moment of the question by the Mei Hua Yi Shu method: Chinese lunar year branch, lunar month and day (from the ephemeris, Beijing days) and the hour branch give the upper trigram, the lower trigram and one moving line; the response shows every term and sum, the Legge reading, and ti and yong (the asker and the matter) with their five-phase verdict.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.
Example
planets.name,planets.longitudeRound every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.
Example
4Header Parameters
Section titled “Header Parameters ”Unique per logical operation, kept across retries. For 24 hours from the first request, a repeat with the same key, method, path, body and query string returns the stored response with Idempotent-Replayed: true and costs 0 credits. The same key with a different body or query string is a 409 IDEMPOTENCY_KEY_REUSED; a repeat while the first is still running is a 409 IDEMPOTENCY_IN_PROGRESS. Only 2xx responses are kept. See /idempotency/.
Example
01HXY2A7ZM0ABCDEFRequest Body required
Section titled “Request Body required ”object
Date of the question, YYYY-MM-DD.
Clock time of the question, HH:mm or HH:mm:ss; gives the hour branch.
Hours from UTC at the place of the question; places the lunar day. Defaults to 8, China Standard Time. Ignored when timezone is sent.
IANA zone name such as Europe/Kyiv, or auto to look the zone up from latitude and longitude. The server takes the offset that zone kept at this local date and time, summer time included, and uses it in place of timezoneOffset. A clock time that happened twice takes the first occurrence; one skipped when clocks went forward takes the offset from before the change. Abbreviations such as EST are refused. Before 1970 the tz database is not reliable for every place, so send timezoneOffset when the local clock is known.
Example
{ "date": "2026-11-07", "time": "10:30", "timezoneOffset": 2}Responses
Section titled “ Responses ”Successful calculation
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
object
Example
{ "ok": true, "data": { "date": "2026-11-07", "time": "10:30", "lunarDate": { "year": 2026, "yearBranch": "Wu", "month": 9, "isLeapMonth": false, "day": 29, "hourBranch": "Si" }, "terms": { "year": 7, "month": 9, "day": 29, "hour": 6, "upperSum": 45, "lowerSum": 51, "upperTrigramNumber": 5, "lowerTrigramNumber": 3, "movingLine": 3, "rule": "Upper trigram: (year + month + day) mod 8; lower: (year + month + day + hour) mod 8; moving line: the same sum mod 6; a remainder of 0 counts as 8 or 6. Trigrams are numbered in the Earlier Heaven order (1 Qian, 2 Dui, 3 Li, 4 Zhen, 5 Xun, 6 Kan, 7 Gen, 8 Kun)." }, "lines": [ { "position": 1, "value": 7, "yang": true, "changing": false } ], "primary": { "number": 37, "name": "The Family", "pinyin": "Jia Ren", "legge": "Kiâ Zăn", "chinese": "䷤", "lines": [ 1, 0, 1, 0, 1, 1 ], "lowerTrigram": 6, "upperTrigram": 5, "judgment": "For (the realisation of what is taught in) Kiâ Zăn, (or for the regulation of the family), what is most advantageous is that the wife be firm and correct." }, "changingLines": [ { "position": 3, "text": "The third line, undivided, shows its subject (treating) the members of the household with stern severity. There will be occasion for repentance, there will be peril, (but) there will (also) be good fortune. If the wife and children were to be smirking and chattering, in the end there would be occasion for regret." } ], "resulting": { "number": 42, "name": "Increase", "pinyin": "Yi", "legge": "Yî", "chinese": "䷩", "lines": [ 1, 0, 0, 0, 1, 1 ], "lowerTrigram": 2, "upperTrigram": 5, "judgment": "Yî indicates that (in the state which it denotes) there will be advantage in every movement which shall be undertaken, that it will be advantageous (even) to cross the great stream." }, "focus": { "rule": "One changing line: read that line.", "texts": [ { "hexagram": 37, "part": "line 3", "text": "The third line, undivided, shows its subject (treating) the members of the household with stern severity. There will be occasion for repentance, there will be peril, (but) there will (also) be good fortune. If the wife and children were to be smirking and chattering, in the end there would be occasion for regret." } ] }, "source": "James Legge, The Yi King, Sacred Books of the East vol. XVI (1882; 2nd ed. 1899), public domain: the Text (judgments and line statements)", "readingRuleSource": "Zhu Xi, Yixue Qimeng (1186), ch. 4, on reading changing lines", "tiYong": { "ti": { "index": 5, "name": "Xun (Wind)", "symbol": "☴", "lines": [ 0, 1, 1 ], "pinyin": "Xun", "chinese": "巽", "image": "wind, wood", "attribute": "penetration", "family": "eldest daughter", "animal": "fowl", "bodyPart": "thighs", "earlierHeaven": { "number": 5, "direction": "southwest" }, "laterHeaven": { "number": 4, "direction": "southeast" }, "phase": "wood" }, "yong": { "index": 6, "name": "Li (Fire)", "symbol": "☲", "lines": [ 1, 0, 1 ], "pinyin": "Li", "chinese": "離", "image": "fire, the sun", "attribute": "brightness", "family": "middle daughter", "animal": "pheasant", "bodyPart": "eyes", "earlierHeaven": { "number": 3, "direction": "east" }, "laterHeaven": { "number": 9, "direction": "south" }, "phase": "fire" }, "relation": "generated-by", "verdict": "Ti generates yong: draining, the asker gives more than returns." }, "meiHuaSource": "Mei Hua Yi Shu (attributed to Shao Yong, 11th c.), casting by year, month, day and hour; ti and yong by the five phases" }}Validation error
Example
{ "ok": false, "error": { "code": "INVALID_INPUT", "message": "Validation failed: date: Date must be YYYY-MM-DD", "details": [ { "path": "date", "message": "Date must be YYYY-MM-DD" } ] }}Missing or invalid API key
Example
{ "ok": false, "error": { "code": "INVALID_API_KEY", "message": "Invalid API key" }}