API reference › KP

KP Ruling Planets API

The seven KP ruling planets at a moment and place

GET/v1/kp/ruling-planets

1 credit · Secret or publishable key · getKpRulingPlanets

Parameters

NameInTypeNotes
datetime requiredquerystring (date-time)The moment, ISO 8601 with a zone (e.g. 2026-10-02T06:00:00Z).
lat requiredquerynumber ≥ -90 · ≤ 90
lon requiredquerynumber ≥ -180 · ≤ 180

Response

JSON { data, meta, warnings }, where data is:

  • at string (date-time) required
  • day_lord string required
  • lagna object required
    • sign_lord string required
    • star_lord string required
    • sub_lord string required
  • moon object required
    • sign_lord string required
    • star_lord string required
    • sub_lord string required
  • local object required
    • date string (date) required

      e.g. "1990-08-13"

    • time string required
    • offset_hours number required
  • weekday object required
    • name string required
    • lord string required
  • lagna_sign string or null required

    One of:

    1. string
    2. null
  • moon_sign string or null required

    One of:

    1. string
    2. null
  • nakshatra object or null required

    One of:

    1. object
      Fields
      • name string required
      • lord string required
      • pada integer required

        ≥ 1 · ≤ 4

    2. null

Errors: 400, 401, 403, 404, 422, 429, 500. See error codes.

Example request

curl 'https://api.astrologics.in/v1/kp/ruling-planets?datetime=2026-10-02T06:00:00Z&lat=28.6139&lon=77.209' \
  -H 'Authorization: Bearer al_test_YOUR_KEY'
Node.js
const res = await fetch("https://api.astrologics.in/v1/kp/ruling-planets?datetime=2026-10-02T06:00:00Z&lat=28.6139&lon=77.209", {
  headers: { Authorization: "Bearer al_test_YOUR_KEY" },
});
console.log(JSON.stringify(await res.json(), null, 2));
Python
import json
import urllib.error
import urllib.request

req = urllib.request.Request(
    "https://api.astrologics.in/v1/kp/ruling-planets?datetime=2026-10-02T06:00:00Z&lat=28.6139&lon=77.209",
    method="GET",
    headers={"Authorization": "Bearer al_test_YOUR_KEY"},
)
try:
    with urllib.request.urlopen(req) as res:
        print(json.dumps(json.load(res), indent=2, ensure_ascii=False))
except urllib.error.HTTPError as err:
    print(err.code, err.read().decode())
PHP
<?php
$ch = curl_init('https://api.astrologics.in/v1/kp/ruling-planets?datetime=2026-10-02T06:00:00Z&lat=28.6139&lon=77.209');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY'],
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

200 OK · 779 characters
{
  "data": {
    "at": "2026-10-02T06:00:00.000Z",
    "day_lord": "venus",
    "lagna": {
      "sign_lord": "mars",
      "star_lord": "mercury",
      "sub_lord": "sun"
    },
    "moon": {
      "sign_lord": "venus",
      "star_lord": "mars",
      "sub_lord": "jupiter"
    },
    "local": {
      "date": "2026-10-02",
      "time": "11:30",
      "offset_hours": 5.5
    },
    "weekday": {
      "name": "friday",
      "lord": "venus"
    },
    "lagna_sign": "scorpio",
    "moon_sign": "taurus",
    "nakshatra": {
      "name": "mrigashira",
      "lord": "mars",
      "pada": 2
    }
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 1
  },
  "warnings": []
}
Try it

Leave empty to use the shared demo key (limited). Test keys only: never charged. Kept in this browser tab and sent through this site to the API. Create one

More in KP

Get a free API key KP product page