KP Astrology API with True and Mean Node Support: Complete Developer Guide
Build KP astrology apps with true and mean Rahu/Ketu node positions, 3 ayanamsa systems, Placidus house cusps, and real-time ruling planet intervals. Verified against authoritative KP sources.
KP Astrology API with True and Mean Node Support
You are building a KP astrology application. You need Rahu and Ketu positions that match your reference software. You pull the data from an API, compare it with your KP software, and the sub-lord assignments are off by one position.
The problem is almost always the node calculation. Some KP software uses mean node (the mathematically averaged orbital position). Others use true node (the osculating position that accounts for gravitational perturbations). The difference is typically 0.5 to 1.5 degrees, which is enough to shift a sub-lord assignment when a planet sits near a boundary.
This guide covers how to use KP astrology API endpoints with full control over node type, ayanamsa system, and coordinate output, so your app matches whichever reference source your users trust.
Why Node Type Matters in KP Astrology
In Krishnamurti Paddhati, every planet is assigned a sign lord, star (nakshatra) lord, and sub-lord based on its exact sidereal longitude. The 249 KP sub-lord divisions are narrow. Some span less than 1 degree. When Rahu or Ketu sits near a sub-lord boundary, the difference between mean and true node can push it into a different sub-lord.
Mean node follows a smooth mathematical curve. It is the average position of the Moon ascending node over its 18.6-year cycle. This is what most traditional KP practitioners use, and what DrikPanchang displays by default.
True node (osculating node) adds five Chapront perturbation terms that account for the Sun and other planetary gravitational effects. The true node oscillates around the mean node with a primary period of about 173 days and an amplitude of up to 1.5 degrees.
Neither is "wrong." They are different models. The key is matching what your users expect.
| Node Type | Formula | Oscillation | Best For |
|---|---|---|---|
| Mean | Meeus Ch. 22, 4-term polynomial | None (smooth curve) | Traditional KP, DrikPanchang matching |
| True | Mean + 5 Chapront perturbation terms | Up to 1.5 degrees, 173-day period | Software that uses osculating elements |
KP Endpoints Overview
Roxy provides 9 KP-specific endpoints, all accepting nodeType, ayanamsa, and standard birth data parameters:
| Endpoint | What It Returns |
|---|---|
POST /kp/chart |
Full KP birth chart with planet positions, house cusps, star lords, sub-lords |
POST /kp/planets |
Planet positions with KP subdivision (sign lord, star lord, sub-lord) |
POST /kp/cusps |
All 12 Placidus house cusps with star lords and sub-lords |
POST /kp/ruling-planets |
KP ruling planets at a specific moment (for prashna/horary) |
POST /kp/ruling-planets-interval |
Ruling planets at regular intervals with significator houses |
POST /kp/planets-interval |
Planet positions at intervals (track sub-lord changes over time) |
POST /kp/sublord-changes |
Exact moments when any planet changes sub-lord |
POST /kp/rasi-changes |
Exact moments when planets change signs |
GET /kp/ayanamsa |
Ayanamsa value for a given date and system |
Every endpoint uses true Placidus house cusps (iterative semi-arc method), not Porphyry or Equal. This matches what KP astrology mandates.
Using Node Type in API Calls
Add "nodeType": "true" or "nodeType": "mean" to any KP endpoint request body. If omitted, it defaults to "mean".
Example: KP Chart with True Node
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/kp/chart \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"date": "2026-03-08",
"time": "21:30:00",
"latitude": 19.076,
"longitude": 72.8777,
"timezone": 5.5,
"ayanamsa": "kp-newcomb",
"nodeType": "true"
}'
Example: Compare Mean vs True at the Same Moment
To see how node type affects sub-lord assignments, call the same endpoint twice with different nodeType values:
const birthData = {
date: "2026-03-08",
time: "21:30:00",
latitude: 19.076,
longitude: 72.8777,
timezone: 5.5,
ayanamsa: "kp-newcomb"
};
const headers = {
"Content-Type": "application/json",
"X-API-Key": process.env.ROXY_API_KEY
};
const [meanResult, trueResult] = await Promise.all([
fetch("https://roxyapi.com/api/v2/vedic-astrology/kp/planets", {
method: "POST",
headers,
body: JSON.stringify({ ...birthData, nodeType: "mean" })
}).then(r => r.json()),
fetch("https://roxyapi.com/api/v2/vedic-astrology/kp/planets", {
method: "POST",
headers,
body: JSON.stringify({ ...birthData, nodeType: "true" })
}).then(r => r.json())
]);
// Compare Rahu sub-lord between the two
const rahuMean = meanResult.planets.find(p => p.planet === "Rahu");
const rahuTrue = trueResult.planets.find(p => p.planet === "Rahu");
console.log("Mean Rahu sub-lord:", rahuMean.subLord);
console.log("True Rahu sub-lord:", rahuTrue.subLord);
When Rahu sits near a sub-lord boundary, you will see different sub-lord assignments. When it sits in the middle of a sub-lord range, both will agree.
Three Ayanamsa Systems
KP astrology depends on precise ayanamsa (the offset between tropical and sidereal zodiacs). Different KP schools use different ayanamsa values, and the difference matters at sub-lord boundaries.
| Ayanamsa | Value (2026) | Source | Use When |
|---|---|---|---|
kp-newcomb |
~24.125 degrees | KP-Newcomb dynamic formula | Default for most KP practitioners |
kp-old |
~24.135 degrees | Krishnamurti original table from KP Reader-1 | Matching older KP software |
lahiri |
~24.223 degrees | Lahiri/Chitrapaksha | Matching DrikPanchang, traditional Vedic software |
The difference between KP-Newcomb and Lahiri is about 0.1 degrees. That is enough to shift a sub-lord assignment when a planet sits on a boundary. If your app targets users who compare against DrikPanchang, use "lahiri". If they use KP-specific software, use "kp-newcomb" or "kp-old".
{
"date": "2026-03-08",
"time": "21:30:00",
"latitude": 19.076,
"longitude": 72.8777,
"timezone": 5.5,
"ayanamsa": "lahiri",
"nodeType": "mean"
}
Ruling Planets at Intervals
The ruling planets interval endpoint is essential for KP prashna (horary) astrology. It returns the ruling planets (day lord, Moon sign lord, Moon star lord, Moon sub-lord, and Ascendant details) at regular time intervals, along with significator houses for each.
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/kp/ruling-planets-interval \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"startDatetime": "2026-03-08T10:00:00",
"endDatetime": "2026-03-08T22:00:00",
"intervalMinutes": 60,
"latitude": 19.076,
"longitude": 72.8777,
"timezone": 5.5,
"ayanamsa": "kp-newcomb",
"nodeType": "mean"
}'
Each interval includes moonSignLordSignifies, moonStarLordSignifies, moonSublordSignifies, and moonSignifies, showing which houses each ruling planet signifies. This is the core data KP practitioners use to time predictions.
Tracking Sub-Lord Changes
The sub-lord changes endpoint returns the exact moment any planet crosses a sub-lord boundary. This is useful for building transit alerts, prediction timing tools, or for verifying your calculations against reference software.
curl -X POST https://roxyapi.com/api/v2/vedic-astrology/kp/sublord-changes \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"planet": "Moon",
"startDate": "2026-03-01",
"endDate": "2026-03-31",
"timezone": 5.5,
"ayanamsa": "kp-newcomb",
"nodeType": "mean"
}'
The Moon changes sub-lord roughly every 2 hours, making this endpoint essential for KP timing work.
Verification and Accuracy
Every KP endpoint is verified against authoritative sources:
- Planet positions: within 0.03 degrees of DrikPanchang (Lahiri ayanamsa)
- Sub-lord assignments: exact match with onlinejyotish.com (KP-Newcomb)
- House cusps: true Placidus, verified across 6 international locations (Mumbai, Delhi, Tokyo, Singapore, London, Sydney)
- Sunrise/sunset: within 1-2 minutes of timeanddate.com
- Day lord: correct Hindu day system (transitions at local sunrise, not midnight)
- Panchang data: nakshatra, tithi, yoga, karana verified against DrikPanchang
Gold standard test charts (Mumbai and New Delhi) with 42 deterministic tests run on every code change, covering planet houses, star lords, sub-lords, cusp lords, and full significator chains.
Common Integration Patterns
Pattern 1: KP Birth Chart App
Generate a full KP chart and display planet positions with their KP subdivision:
const chart = await fetch("https://roxyapi.com/api/v2/vedic-astrology/kp/chart", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ROXY_API_KEY
},
body: JSON.stringify({
date: "1990-07-15",
time: "14:30:00",
latitude: 28.6139,
longitude: 77.2090,
timezone: 5.5,
ayanamsa: "kp-newcomb",
nodeType: "mean"
})
}).then(r => r.json());
// Display each planet with KP data
for (const planet of chart.planets) {
console.log(
`${planet.planet}: ${planet.sign} | ` +
`Star: ${planet.starLord} | Sub: ${planet.subLord} | ` +
`House: ${planet.house}`
);
}
Pattern 2: Prashna (Horary) Tool
For KP horary, the ruling planets at the moment of the question determine the significators:
const now = new Date();
const ruling = await fetch("https://roxyapi.com/api/v2/vedic-astrology/kp/ruling-planets", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.ROXY_API_KEY
},
body: JSON.stringify({
datetime: now.toISOString().slice(0, 19),
latitude: 19.076,
longitude: 72.8777,
timezone: 5.5
})
}).then(r => r.json());
console.log("Day Lord:", ruling.dayLord);
console.log("Moon Sign Lord:", ruling.moonSignLord);
console.log("Moon Star Lord:", ruling.moonStarLord);
console.log("Moon Sub Lord:", ruling.moonSublord);
Pattern 3: Let Users Choose Node Type
Give your users control over node type and ayanamsa in your app settings:
// User preferences from your app settings
const userPrefs = {
nodeType: userSettings.nodeType || "mean", // "mean" or "true"
ayanamsa: userSettings.ayanamsa || "kp-newcomb" // "kp-newcomb", "kp-old", or "lahiri"
};
// Pass through to all KP API calls
const chartData = await fetchKPChart({
...birthData,
...userPrefs
});
This way, users who compare against DrikPanchang can switch to Lahiri, and users who compare against specific KP software can pick the matching node type and ayanamsa.
For Developers: Building KP Astrology Apps
KP astrology is one of the most systematic branches of Vedic astrology, which makes it particularly well-suited for software applications. The KP system relies on precise mathematical divisions (nakshatras split into 249 sub-lord segments) rather than subjective interpretation, making API-driven apps practical and verifiable.
If you are building a KP astrology app, here is what matters:
Essential features your users expect:
- Accurate planet positions with star lord and sub-lord at minimum
- True Placidus house cusps (not Porphyry or Equal, KP mandates Placidus)
- Significator tables showing which planets signify which houses at each level
- Ruling planets for prashna/horary timing
- Choice of ayanamsa system (different users trust different systems)
What separates good KP software from bad:
- Sub-lord accuracy. If your sub-lords do not match onlinejyotish.com or the user's desktop software, they will not trust anything else in your app.
- Node type control. Professional KP astrologers will ask for this.
- Timezone handling. KP day lord changes at local sunrise, not UTC midnight. Get this wrong and every early-morning reading in Asia-Pacific is broken.
Roxy's Vedic Astrology API provides all 9 KP endpoints with true/mean node support, 3 ayanamsa systems, and true Placidus cusps. Check our Vedic Astrology domain guide for the full endpoint reference, or test endpoints live in the API Reference.
Frequently Asked Questions
Q: What is the difference between mean node and true node for Rahu and Ketu? A: Mean node follows a smooth mathematical curve (the average position over Rahu's 18.6-year orbital cycle). True node adds gravitational perturbation corrections, causing it to oscillate around the mean by up to 1.5 degrees. Most traditional KP sources use mean node. Some modern KP software uses true node. The API supports both.
Q: Which ayanamsa should I use for KP astrology?
A: For standard KP practice, use kp-newcomb (the default). If your users compare against DrikPanchang or traditional Vedic software, use lahiri. If they use older KP software based on the original Krishnamurti tables, use kp-old. The difference between them is small (0.1 degrees) but can shift sub-lord assignments at boundaries.
Q: Why do my Rahu/Ketu positions differ from DrikPanchang?
A: Two likely reasons. First, DrikPanchang uses Lahiri ayanamsa by default, while most KP software uses KP-Newcomb. Second, DrikPanchang uses mean node by default. If you are using true node or a different ayanamsa, positions will differ. Set ayanamsa to lahiri and nodeType to mean to match DrikPanchang.
Q: Does the API use true Placidus or Porphyry house cusps? A: True Placidus, computed using the iterative semi-arc method. KP astrology requires Placidus. The cusps are verified against authoritative KP sources across multiple international locations including Mumbai, Delhi, Tokyo, Singapore, London, and Sydney.
Q: How accurate are the planetary positions? A: Planetary longitudes are within 0.03 degrees (about 1.8 arcminutes) of DrikPanchang. The calculation engine uses VSOP87 planetary theory validated against NASA JPL DE405 ephemeris. Sub-lord and star lord assignments are exact matches with onlinejyotish.com for the same ayanamsa and node type settings.
Q: Can I use this API for KP prashna (horary) astrology?
A: Yes. The /kp/ruling-planets endpoint returns the five ruling planets (day lord, Moon sign lord, Moon star lord, Moon sub-lord, Ascendant sign lord) at any moment. The /kp/ruling-planets-interval endpoint returns ruling planets at regular intervals with house significators, which is the core data needed for KP horary timing.
Q: How does the API handle timezone and day lord calculation? A: KP day lord follows the Hindu day system where the day changes at local sunrise, not midnight. The API correctly handles this across all timezones, including edge cases where the UTC date differs from the local date (for example, Tokyo early morning hours). All datetime inputs accept both UTC format (with Z suffix) and local time (without Z, interpreted using the timezone parameter).
Ready to build your KP astrology app? Roxy's Vedic Astrology API provides 42 Vedic astrology endpoints including 9 dedicated KP endpoints, all with true/mean node support and 3 ayanamsa systems. View pricing to get started, or explore our complete API suite covering 8 spiritual intelligence domains.