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.
Endpoint
POST /v1/western/planetary-hours
GET works tooGET /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
| Field | Type | Required | Description |
|---|---|---|---|
| date | string | Yes | Date in YYYY-MM-DD format |
| location | string | null | No | City name. Example: 'Mumbai' |
| latitude | number | null | No | Latitude in decimal degrees, north positive. Use with longitude and timezone instead of location. |
| longitude | number | null | No | Longitude in decimal degrees, east positive. Use with latitude and timezone instead of location. |
| timezone | string | null | No | IANA timezone string |
Example request
- curl
- Python
- TypeScript
curl -X POST "https://api.asterwise.com/v1/western/planetary-hours" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"2026-01-01","latitude":19.076,"longitude":72.8777,"timezone":"Asia/Kolkata"}'
import asterwise
from asterwise.api.western_astrology_api import WesternAstrologyApi
from asterwise.models.planetary_hours_request import PlanetaryHoursRequest
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
request = PlanetaryHoursRequest(
date="2026-01-01",
latitude=19.076,
longitude=72.8777,
timezone="Asia/Kolkata",
)
with asterwise.ApiClient(configuration) as client:
api = WesternAstrologyApi(client)
result = api.western_planetary_hours(planetary_hours_request=request)
print(result)
import { createClient, createConfig, westernPlanetaryHours } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const result = await westernPlanetaryHours({
client,
body: {
"date": "2026-01-01",
"latitude": 19.076,
"longitude": 72.8777,
"timezone": "Asia/Kolkata"
},
});
console.log(result.data);
Example response
Example response omitted — live API call did not return HTTP 200.
Response fields
| Field | Type | Description |
|---|---|---|
| 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.day_ruler | string | null | Planet of the weekday; it rules the first hour after sunrise. |
| 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. |
Errors
| Code | Description | Reference |
|---|---|---|
| api_key_invalid | Invalid API key format. | api_key_invalid |
| api_key_missing | API key is missing. Include it in the Authorization header as 'Bearer YOUR_KEY'. | api_key_missing |
| api_key_not_found | The provided API key was not found. Verify the key in your Asterwise dashboard. | api_key_not_found |
| api_key_revoked | This API key has been revoked. | api_key_revoked |
| burst_limit_exceeded | Too many requests per minute. Please slow down. | burst_limit_exceeded |
| internal_error | Something went wrong on our end. Please try again, or contact [email protected] if the problem persists. Include your request_id when contacting support. | internal_error |
| ip_rate_limit_exceeded | Too many requests from this IP address. Please slow down. | ip_rate_limit_exceeded |
| monthly_usage_limit_exceeded | Monthly API call limit reached. Upgrade your plan to continue. | monthly_usage_limit_exceeded |
| payload_too_large | Request body exceeds maximum allowed size of 64KB. | payload_too_large |
| subscription_expired | Your subscription has expired. Please renew at asterwise.com/dashboard to continue. | subscription_expired |
| validation_error | The request couldn't be processed. See the 'details' field for specific field-level issues. | validation_error |