Chinese zodiac animal for a birth date (public, no key)
curl -X POST 'https://api.astroway.info/v1/public/chinese/zodiac/animal?lang=en' \ -H 'Content-Type: application/json' \ -d '{"date":"1990-05-15"}'The same answer as POST /chinese/zodiac/animal, served anonymously: animal, stem, branch and element of the solar year the date falls in. The year turns at Li Chun (around 4 February), not on 1 January, so send time and timezoneOffset for a birth near that boundary. animalName, fixedName and cyclingName follow ?lang=; the English identifiers stay as they are. Costs 1 unit of the public bucket. Characters (simplified, traditional beside the animal) and Hanyu Pinyin with tone marks for the animal, stem and branch; hours is the double hour of the branch in local clock time (Rat 23:00-01:00); trine (三合), secretFriend (六合), clash (六冲) and harm (六害) are the fixed branch relations, the same arithmetic the BaZi interactions use. Pair it with GET /public/chinese/zodiac/texts for the reading.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Example
enLanguage for this call, overriding Accept-Language. The canonical per-call form: a page that renders in one language passes it here rather than reconfiguring its client. Unknown or inactive codes fall back to uk.
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 ”BCP-47 language (e.g. uk, en, de). Set it once on your HTTP client as its default; for a single call, ?lang= overrides it. Unknown or inactive codes fall back to uk.
Request Body required
Section titled “Request Body required ”object
Hours from UTC at the given moment, not minutes. Fractional zones are hours too: 5.5 for India, 5.75 for Nepal, -3.5 for Newfoundland. Defaults to 0, meaning UTC. 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": "1990-05-15"}Responses
Section titled “ Responses ”OK
object
object
object
object
object
object
object
object
object
object
object
Free-tier watermark, present on every public response. Keys on a paid plan do not receive it.
Example
{ "ok": true, "data": { "solarYear": 1990, "animal": "Horse", "animalName": "Horse", "glyph": "🐎", "animalHanzi": "马", "animalHanziTraditional": "馬", "animalPinyin": "mǎ", "stemHanzi": "庚", "stemPinyin": "gēng", "branchHanzi": "午", "branchPinyin": "wǔ", "hours": { "start": "11:00", "end": "13:00" }, "trine": { "element": "Fire", "elementName": "Fire", "chinese": "三合", "animals": [ { "animal": "Tiger", "animalName": "Tiger" }, { "animal": "Horse", "animalName": "Horse" }, { "animal": "Dog", "animalName": "Dog" } ] }, "secretFriend": { "animal": "Goat", "animalName": "Goat", "branch": "Wei", "chinese": "六合" }, "clash": { "animal": "Rat", "animalName": "Rat", "branch": "Zi", "chinese": "六冲" }, "harm": { "animal": "Ox", "animalName": "Ox", "branch": "Chou", "chinese": "六害" }, "branch": "Wu", "stem": "Geng", "element": { "fixed": "Fire", "fixedName": "Fire", "cycling": "Metal", "cyclingName": "Metal", "yin": false }, "pillar": "Geng-Wu", "yearStart": { "utc": "1990-02-04T02:14:00Z", "beijing": "1990-02-04T10:14:00+08:00" }, "yearEnd": { "utc": "1991-02-04T08:08:24Z", "beijing": "1991-02-04T16:08:24+08:00" } }, "_footer": "Powered by astroway.api - get your own key at https://api.astroway.info"}Invalid input
Example
{ "ok": false, "error": { "code": "INVALID_FIELD", "message": "Unsupported fields: \"tz\", \"lat\", \"lng\". Rename them to \"timezoneOffset\", \"latitude\", \"longitude\". See details for what each one expects.", "details": [ { "path": "tz", "expected": "timezoneOffset", "message": "numeric hours from UTC, e.g. 5.75; a zone name goes in timezone" }, { "path": "lat", "expected": "latitude", "message": "decimal degrees, north positive" }, { "path": "lng", "expected": "longitude", "message": "decimal degrees, east positive" } ], "docs": "https://api.astroway.info/en/errors/#invalid_field" }}