Planets in Houses
POST https://starsapi.com/api/v3/vedic/natal/planets-in-houses
Returns a house-by-house overview of the birth chart. For each of the 12 houses: the sign on the cusp, its lord, which planets occupy it, and which planets aspect it via Parashari graha drishti. This is the “at a glance” view of a Vedic chart — one loop gives you the complete picture without any client-side assembly.
Houses are computed using whole-sign (Rashi) house logic: house 1 is the ascendant sign, house 2 is the next sign, and so on. Aspects follow traditional Parashari rules — every planet casts a 7th-house aspect; Mars additionally aspects the 4th and 8th; Jupiter the 5th and 9th; Saturn the 3rd and 10th; Rahu/Ketu the 5th, 7th, and 9th.
Authentication
Required. Three methods accepted:
| Method | Example |
|---|---|
| Header (recommended) | X-Api-Key: am_live_xxxxxxxxxxxx |
| Bearer | Authorization: Bearer am_live_xxxxxxxxxxxx |
| Query | ?api_key=am_live_xxxxxxxxxxxx |
See authentication for security considerations.
Request body
Send a JSON object with Content-Type: application/json. All core
fields are required — the ascendant (and therefore every house cusp)
depends on the precise time and place of birth.
| Field | Type | Required | Description |
|---|---|---|---|
year | integer | Yes | Birth year, 4-digit (e.g. 1990). |
month | integer | Yes | Birth month, 1–12. |
day | integer | Yes | Day of month, 1–31. |
hour | integer | Yes | Hour in 24-hour local clock time, 0–23. |
minute | integer | Yes | Minute, 0–59. |
second | integer | No | Second, 0–59. Default 0. |
latitude | number | Yes | Signed decimal degrees, −90…90. Positive = North (e.g. 28.6139). |
longitude | number | Yes | Signed decimal degrees, −180…180. Positive = East (e.g. 77.2090). |
timezone | string | Yes | IANA timezone identifier (e.g. Asia/Kolkata). DST is resolved automatically. |
name | string | No | Native’s name. Not returned by this endpoint; use /vedic/birth-details to retrieve it. |
place | string | No | Birth place label. Not returned by this endpoint; use /vedic/birth-details to retrieve it. |
ayanamsa | string | No | Sidereal mode. Default lahiri. Full list of 45+ ayanamsas → |
node_type | string | No | mean (default) or true. Controls Rahu/Ketu position calculation. |
timezone of the birth place — the backend converts to
UTC internally. Do not pre-convert to UTC yourself.
Response shape
The data.houses array always contains exactly 12 objects, one per house
in order. Each house is flat — no nested objects. Birth input (name,
date, time, gender, location) is not echoed back — call
/vedic/birth-details
separately to retrieve resolved birth details.
| Field | Type | Description |
|---|---|---|
| houses[] | ||
house | integer | House number, 1–12. |
sign_number | integer | Sign on the cusp, 1 = Aries … 12 = Pisces. |
sign | string | Sign name in English. |
sign_hindi | string | Sign name in Hindi. |
house_lord | string | Ruling planet of the house sign. |
occupying_planets | string[] | Planets sitting in this house. Empty array if none. |
aspected_by | string[] | Planets aspecting this house via graha drishti. Empty array if none. |
| meta | ||
meta.endpoint | string | Echo of the called endpoint path. |
meta.version | string | API version (currently 3.0). |
meta.response_time_ms | integer | Server-side response time in milliseconds. |
meta.timestamp | string (ISO 8601) | Time the response was served. |
meta.credits_remaining | integer | API credits remaining on your plan. |
meta.request_id | string | Unique request identifier — include in support tickets. |
meta.ayanamsa.name | string | Sidereal mode applied. |
meta.ayanamsa.value | number | Ayanamsa offset in decimal degrees. |
meta.ayanamsa.value_dms | string | Same in D°M′S″ format. |
meta.node_type | string | Rahu/Ketu calculation mode: mean or true. |
Use cases
- House grid UI — loop 1–12 and render each house with its sign, occupants, and aspects in a single pass.
- Report cards — “Your 7th house (Pisces, lord Jupiter) has Moon and Venus, aspected by Saturn and Ketu.”
- Quick strength check — count how many planets occupy or aspect a house to gauge its activation level.
- House lord analysis — pair
house_lordwith the planets endpoint to find where each lord sits. - Localized UI — the dual English / Hindi sign names let you render in either language without a second call.
Errors
| HTTP | Code | Cause |
|---|---|---|
| 400 | MISSING_FIELD | A required birth field is absent. |
| 400 | INVALID_DATE | Invalid calendar date. |
| 400 | INVALID_TIME | Hour/minute/second out of range. |
| 400 | INVALID_TIMEZONE | Numeric or non-IANA timezone. |
| 400 | INVALID_COORDINATE | latitude / longitude out of range. |
| 401 | AUTH_MISSING_KEY | No API key in request. |
| 401 | AUTH_INVALID_KEY | Key format invalid or not found. |
| 401 | AUTH_REVOKED_KEY | Key has been revoked. |
| 403 | AUTH_ORIGIN_DENIED | Request from non-whitelisted origin. |
| 405 | METHOD_NOT_ALLOWED | Non-POST request. |
| 429 | RATE_LIMIT_EXCEEDED | Plan quota exceeded. |
| 500 | CALCULATION_ERROR | Ephemeris calculation failed. |
Error response format
{
"success": false,
"error": {
"code": "INVALID_TIMEZONE",
"message": "Unrecognised timezone: 'Asia/Calcutta_'. Use a valid IANA identifier such as 'Asia/Kolkata'."
}
}
See also
- Planetary Aspects — planet-to-planet drishti with aspect type and strength
- Planets — full positional data for all 9 grahas
- Vedic Astrology overview — full category index
- Authentication — keys, headers, origin whitelisting
- Errors reference — universal error codes