Skip to main content
POST/v1/western/planetary-hours

Planetary hours

The 24 planetary hours for a date and place, with the planet ruling each hour. Sunrise to sunset and sunset to the next sunrise are each split into 12 equal parts, so hours are longer by day in summer and shorter in winter. The first hour after sunrise belongs to the planet of the weekday (Sunday Sun, Monday Moon, Tuesday Mars, Wednesday Mercury, Thursday Jupiter, Friday Venus, Saturday Saturn); the rest follow the Chaldean order Saturn, Jupiter, Mars, Sun, Venus, Mercury, Moon. Same calculation as /v1/astro/panchanga/hora, with Western naming and both local and UTC times.

GET works too

GET /v1/western/planetary-hours: Same answer as the POST route with the same fields as query parameters; cacheable (public, 10 minutes). Current-moment flags such as is_current may lag by up to the cache age.

Request parameters​

daterequired
string
Date in YYYY-MM-DD format
locationoptional
string | null
City name. Example: 'Mumbai'
latitudeoptional
number | null
Latitude in decimal degrees, north positive. Use with longitude and timezone instead of location.
longitudeoptional
number | null
Longitude in decimal degrees, east positive. Use with latitude and timezone instead of location.
timezoneoptional
string | null
IANA timezone string

Response fields​

success
boolean
True if the request succeeded
message
string
Human-readable status message
data
object
data.status
string
ok, or no_sunrise when the place has no sunrise or sunset on that date (polar latitudes): the hour fields are then null.
data.status_detail
string | null
Plain-English reason when status is not ok.
data.date
string
data.weekday
string | null
Weekday of the date, e.g. Sunday.
data.weekday_id
string | null
Fixed id of weekday (see https://docs.asterwise.com/reference/names-and-ids/). Stays the same in every language; store and compare this, not the name.
data.weekday_label
string | null
weekday in the answer's language (see https://docs.asterwise.com/reference/names-and-ids/). Only in answers asked for in a language other than English; show it to people, never store or compare it.
data.day_ruler
string | null
Planet of the weekday; it rules the first hour after sunrise.
data.day_ruler_id
string | null
Fixed id of day_ruler (see https://docs.asterwise.com/reference/names-and-ids/). Stays the same in every language; store and compare this, not the name.
data.day_ruler_label
string | null
day_ruler in the answer's language (see https://docs.asterwise.com/reference/names-and-ids/). Only in answers asked for in a language other than English; show it to people, never store or compare it.
data.convention
string | null
unequal_seasonal: day and night each split into 12 equal parts from real sunrise and sunset.
data.sunrise_local
string | null
data.sunset_local
string | null
data.next_sunrise_local
string | null
data.sunrise_utc
string | null
data.sunset_utc
string | null
data.next_sunrise_utc
string | null
data.day_hour_minutes
number | null
Length of one day hour in minutes.
data.night_hour_minutes
number | null
Length of one night hour in minutes.
data.hours
array[PlanetaryHour] | null
The 24 hours; null when status is no_sunrise.
key_labels
object | null
Labels of the names and ids this answer uses as map keys ({"Sun": ...} -> {"Sun": "सूर्य"}, {"varna": ...} -> {"varna": "वर्ण"}), in the answer's language (see https://docs.asterwise.com/reference/names-and-ids/). Only in answers asked for in a language other than English; the keys themselves never change.

Errors​

Invalid API key format.
API key is missing. Include it in the Authorization header as 'Bearer YOUR_KEY'.
The provided API key was not found. Verify the key in your Asterwise dashboard.
This API key has been revoked.
Too many requests per minute. Please slow down.
Confirm your email first. Open the link we emailed you, or sign in at asterwise.com/dashboard to send a new one.
Something went wrong on our end. Please try again, or contact [email protected] if the problem persists. Include your request_id when contacting support.
Too many requests from this IP address. Please slow down.
Monthly API call limit reached. Upgrade your plan to continue.
Request body exceeds maximum allowed size of 64KB.
Your subscription has expired. Please renew at asterwise.com/dashboard to continue.
The request couldn't be processed. See the 'details' field for specific field-level issues.