True solar time
curl -X POST https://api.astroway.info/v1/chinese/true-solar-time \ -H "X-Api-Key: aw_live_..." \ -H "Content-Type: application/json" \ -d '{ "date": "1995-06-15", "time": "09:20:00", "timezoneOffset": 8, "longitude": 75.9 }'const res = await fetch('https://api.astroway.info/v1/chinese/true-solar-time', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "date": "1995-06-15", "time": "09:20:00", "timezoneOffset": 8, "longitude": 75.9 }),});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/chinese/true-solar-time', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': "1995-06-15", 'time': "09:20:00", 'timezoneOffset': 8, 'longitude': 75.9 },)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('chinese/true-solar-time', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '1995-06-15', 'time' => '09:20:00', 'timezoneOffset' => 8, 'longitude' => 75.9, ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);The clock corrected to the sun over the birth longitude, split into the meridian term and the equation of time. China runs one zone across sixty degrees, so a Kashgar birth reads nearly three hours from solar noon on a Beijing clock, which moves the hour pillar.
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
4Request Body required
Section titled “Request Body required ”object
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": "1995-06-15", "time": "09:20:00", "timezoneOffset": 8, "longitude": 75.9}Responses
Section titled “ Responses ”Successful calculation
object
object
object
Example
{ "ok": true, "data": { "input": { "date": "1995-06-15", "time": "09:20:00", "timezoneOffset": 8, "longitude": 75.9 }, "clockTime": "09:20:00", "trueSolarTime": "06:23:20", "totalCorrectionMinutes": -176.66, "longitudeCorrectionMinutes": -176.4, "equationOfTimeMinutes": -0.26, "dayShift": 0, "date": "1995-06-15", "hourBranchNote": "The double-hour is cut from the sun over the birth place, so this is the clock the hour pillar should be read from. A correction of an hour or more moves the branch; near midnight it moves the day pillar too.", "methodology": "True solar time is the hour angle of the apparent Sun at the birth longitude, carried round by half a day. It decomposes into the meridian term, (longitude - 15 x timezoneOffset) x 4 minutes, and the equation of time, the Sun's own annual wobble of up to about sixteen minutes. Both are reported.", "note": "timezoneOffset is the offset the clock was actually running on, which only the caller knows: a 1988 Beijing birth ran on UTC+9 under summer time, not UTC+8, and no arithmetic here can recover that from the date.", "source": "Swiss Ephemeris apparent right ascension; equation of time verified against the published annual extrema" }}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" }}