API reference › KP

KP Sub Lord Changes API

When each planet changes sign, star lord or sub lord over a range

POST/v1/kp/changes

2 credits · Secret key (test or live) · getKpChanges

Times are UTC, to the minute, on the KP-New ayanamsa our KP chart uses. At most 366 days, or 31 with the Moon.

Request body

  • from string (date) required

    e.g. "1990-08-13"

  • to string (date) required

    Inclusive. At most 366 days after from, or 31 with the Moon.

    e.g. "1990-08-13"

  • planets array of string

No other fields are accepted.

Response

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

  • ayanamsa string required
  • from string (date) required

    e.g. "1990-08-13"

  • to string (date) required

    e.g. "1990-08-13"

  • count integer required
  • changes array of object required
    • at string (date-time) required
    • planet string required
    • changed array of string required
    • from object required
      Fields
      • sign string required
      • star_lord string required
      • sub_lord string required
    • to object required
      Fields
      • sign string required
      • star_lord string required
      • sub_lord string required
    • retrograde boolean required

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

Example request

curl -X POST 'https://api.astrologics.in/v1/kp/changes' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"from":"2026-11-01","to":"2026-11-07","planets":["sun","mars"]}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/kp/changes", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "from": "2026-11-01",
    "to": "2026-11-07",
    "planets": [
      "sun",
      "mars"
    ]
  }),
});
console.log(JSON.stringify(await res.json(), null, 2));
Python
import json
import urllib.error
import urllib.request

body = {
    "from": "2026-11-01",
    "to": "2026-11-07",
    "planets": [
        "sun",
        "mars",
    ],
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/kp/changes",
    method="POST",
    headers={"Authorization": "Bearer al_test_YOUR_KEY", "Content-Type": "application/json"},
    data=json.dumps(body).encode(),
)
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/changes');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"from":"2026-11-01","to":"2026-11-07","planets":["sun","mars"]}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

200 OK · 3,525 characters
{
  "data": {
    "ayanamsa": "kp_new",
    "from": "2026-11-01",
    "to": "2026-11-07",
    "count": 8,
    "changes": [
      {
        "at": "2026-11-01T00:18:00.000Z",
        "planet": "sun",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "mercury"
        },
        "to": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "ketu"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-01T18:58:00.000Z",
        "planet": "sun",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "ketu"
        },
        "to": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "venus"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-04T00:14:00.000Z",
        "planet": "sun",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "venus"
        },
        "to": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "sun"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-04T06:43:00.000Z",
        "planet": "mars",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "cancer",
          "star_lord": "mercury",
          "sub_lord": "rahu"
        },
        "to": {
          "sign": "cancer",
          "star_lord": "mercury",
          "sub_lord": "jupiter"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-04T16:12:00.000Z",
        "planet": "sun",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "sun"
        },
        "to": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "moon"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-05T18:48:00.000Z",
        "planet": "sun",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "moon"
        },
        "to": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "mars"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-06T13:25:00.000Z",
        "planet": "sun",
        "changed": [
          "star_lord",
          "sub_lord"
        ],
        "from": {
          "sign": "libra",
          "star_lord": "rahu",
          "sub_lord": "mars"
        },
        "to": {
          "sign": "libra",
          "star_lord": "jupiter",
          "sub_lord": "jupiter"
        },
        "retrograde": false
      },
      {
        "at": "2026-11-07T22:30:00.000Z",
        "planet": "mars",
        "changed": [
          "sub_lord"
        ],
        "from": {
          "sign": "cancer",
          "star_lord": "mercury",
          "sub_lord": "jupiter"
        },
        "to": {
          "sign": "cancer",
          "star_lord": "mercury",
          "sub_lord": "saturn"
        },
        "retrograde": false
      }
    ]
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 2
  },
  "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