Skip to content
AstroWay/api v2.254.12 · docs
all systems operational

Chinese zodiac animal for a birth date (public, no key)

POST
/public/chinese/zodiac/animal
Code sample: cURL
request.sh
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.

lang
string
Example
en

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

fields
string

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.longitude
precision
integer
<= 15

Round 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
4
Accept-Language
string

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.

Media type application/json
object
date required
string
/^\d{4}-\d{2}-\d{2}$/
time
string
/^\d{2}:\d{2}(:\d{2})?$/
timezoneOffset

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.

number
0 nullable >= -14 <= 14
timezone

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.

string
solarYear
integer
>= 1800 <= 2200
language
string
Example
{
"date": "1990-05-15"
}

OK

Media type application/json
object
ok
boolean
data
object
solarYear
number
nullable
animal
string
nullable
animalName
string
nullable
glyph
string
nullable
animalHanzi
string
nullable
animalHanziTraditional
string
nullable
animalPinyin
string
nullable
stemHanzi
string
nullable
stemPinyin
string
nullable
branchHanzi
string
nullable
branchPinyin
string
nullable
hours
object
start
string
nullable
end
string
nullable
trine
object
element
string
nullable
elementName
string
nullable
chinese
string
nullable
animals
Array<object>
nullable
object
animal
string
nullable
animalName
string
nullable
secretFriend
object
animal
string
nullable
animalName
string
nullable
branch
string
nullable
chinese
string
nullable
clash
object
animal
string
nullable
animalName
string
nullable
branch
string
nullable
chinese
string
nullable
harm
object
animal
string
nullable
animalName
string
nullable
branch
string
nullable
chinese
string
nullable
branch
string
nullable
stem
string
nullable
element
object
fixed
string
nullable
fixedName
string
nullable
cycling
string
nullable
cyclingName
string
nullable
yin
boolean
nullable
pillar
string
nullable
yearStart
object
utc
string
nullable
beijing
string
nullable
yearEnd
object
utc
string
nullable
beijing
string
nullable
_footer

Free-tier watermark, present on every public response. Keys on a paid plan do not receive it.

string
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

Media type application/json
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"
}
}
Was this helpful?