True solar time
POST
/chinese/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 ”Request Body required
Section titled “Request Body required ” Media type application/json
object
date required
string
time required
string
timezoneOffset required
number
longitude required
number
language
string
Example
{ "date": "1995-06-15", "time": "09:20:00", "timezoneOffset": 8, "longitude": 75.9}Responses
Section titled “ Responses ”Successful calculation
Media type application/json
object
ok
boolean
data
object
input
object
date
string
time
string
timezoneOffset
number
longitude
number
clockTime
string
trueSolarTime
string
totalCorrectionMinutes
number
longitudeCorrectionMinutes
number
equationOfTimeMinutes
number
dayShift
number
date
string
hourBranchNote
string
methodology
string
note
string
source
string
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
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" }} Корисно?
Дякуємо за фідбек.