KP Ruling Planets
Computes KP Ruling Planets at a given moment (no natal birth chart). Request body: latitude, longitude, optional target_date, target_time, target_timezone. Returns day lord, Moon sign/nakshatra/sub lords, ascendant sign/nakshatra/sub lords, and the combined list of ruling planets in priority order.
Endpoint
POST /v1/astro/kp/ruling-planets
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| latitude | number | Yes | Location latitude in decimal degrees. North positive, south negative. |
| longitude | number | Yes | Location longitude in decimal degrees. East positive, west negative. |
| target_date | string | null | No | YYYY-MM-DD. Defaults to today. |
| target_time | string | null | No | HH:MM |
| target_timezone | string | null | No | IANA timezone |
Example request
- curl
- Python
- TypeScript
curl -X POST "https://api.asterwise.com/v1/astro/kp/ruling-planets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"1985-11-12","time":"06:45","latitude":19.076,"longitude":72.8777,"timezone":"Asia/Kolkata"}'
import asterwise
from asterwise.api.kp_api import KpApi
from asterwise.models.kp_ruling_planets_request import KPRulingPlanetsRequest
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
request = KPRulingPlanetsRequest(
date="1985-11-12",
time="06:45",
latitude=19.076,
longitude=72.8777,
timezone="Asia/Kolkata",
)
with asterwise.ApiClient(configuration) as client:
api = KpApi(client)
result = api.kp_ruling_planets(kp_ruling_planets_request=request)
print(result)
import { createClient, createConfig, kpRulingPlanets } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const result = await kpRulingPlanets({
client,
body: {
"date": "1985-11-12",
"time": "06:45",
"latitude": 19.076,
"longitude": 72.8777,
"timezone": "Asia/Kolkata"
},
});
console.log(result.data);
Example response
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | True if the request succeeded |
| message | string | Human-readable status message |
| data | object | |
| data.ayanamsa | string | |
| data.target_utc | string | |
| data.day_lord | string | |
| data.moon | object | |
| data.moon.longitude | number | |
| data.moon.rashi | string | |
| data.moon.sign_lord | string | |
| data.moon.nakshatra_lord | string | |
| data.moon.sub_lord | string | |
| data.ascendant | object | |
| data.ascendant.longitude | number | |
| data.ascendant.rashi | string | |
| data.ascendant.sign_lord | string | |
| data.ascendant.nakshatra_lord | string | |
| data.ascendant.sub_lord | string | |
| data.ruling_planets | array[string] |
Errors
| Code | Description | Reference |
|---|---|---|
| authentication_failed | Missing or invalid API key. | authentication_failed |
| ephemeris_unavailable | Upstream ephemeris service error. | ephemeris_unavailable |
| insufficient_tier | API key tier does not include this endpoint. | insufficient_tier |
| internal_error | Unexpected server error. | internal_error |
| ip_rate_limit_exceeded | Too many requests in a short window. | ip_rate_limit_exceeded |
| payload_too_large | Request body exceeds the size limit. | payload_too_large |
| resource_not_found | Referenced resource was not found. | resource_not_found |
| validation_error | Request body failed schema validation. | validation_error |