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

Tong Shu date selection

POST
/chinese/tong-shu/select
request.sh
curl -X POST https://api.astroway.info/v1/chinese/tong-shu/select \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "from": "2026-09-01", "to": "2026-12-31", "activity": "marriage", "avoidClashWith": "Rat" }'

Walk a date range and return the days the almanac endorses for one activity, each with the officer that decided it. Optionally drop the days that clash a person’s animal. Range capped at 366 days and a longer one is refused, not truncated.

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
Media type application/json
object
from required
string
/^\d{4}-\d{2}-\d{2}$/
to required
string
/^\d{4}-\d{2}-\d{2}$/
activity required
string
Allowed values: marriage opening moving travel contract construction demolition medical funeral education
avoidClashWith
string
>= 2 characters <= 12 characters
includeNeutral
boolean
language
string
Example
{
"from": "2026-09-01",
"to": "2026-12-31",
"activity": "marriage",
"avoidClashWith": "Rat"
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
activity
string
nullable
scanned
number
nullable
matched
number
nullable
dropped
object
byRegister
number
nullable
byClash
number
nullable
days
Array<object>
nullable
object
date
string
nullable
verdict
string
nullable
dayPillar
string
nullable
officer
object
chinese
string
nullable
name
string
nullable
mansion
object
chinese
string
nullable
name
string
nullable
clashesWith
string
nullable
Example
{
"ok": true,
"data": {
"activity": "marriage",
"scanned": 122,
"matched": 24,
"dropped": {
"byRegister": 88,
"byClash": 10
},
"days": [
{
"date": "2026-09-12",
"verdict": "suitable",
"dayPillar": "Ren-Wu",
"officer": {
"chinese": "成",
"name": "Success"
},
"mansion": {
"chinese": "井",
"name": "Well"
},
"clashesWith": "Rat"
}
]
}
}

Validation error

Media type application/json
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

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
}
Was this helpful?