Chart Image
POST https://starsapi.com/api/v3/vedic/natal/chart-image
Returns signed, time-limited image URLs for the D1 (Rashi)
birth chart in both North Indian and South Indian styles. The URLs point to
rendered chart images that can be embedded directly in an <img>
tag or downloaded. Each URL includes a secure token and expiry — no
additional authentication is needed to fetch the image.
This is a convenience endpoint for apps that need a visual chart without
client-side rendering. For the underlying planet and house data, call
/natal/planets or
/natal/planets-in-houses.
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.
| 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. |
longitude | number | Yes | Signed decimal degrees, −180…180. Positive = East. |
timezone | string | Yes | IANA timezone identifier. |
name | string | No | Use /vedic/birth-details to retrieve. |
place | string | No | Use /vedic/birth-details to retrieve. |
ayanamsa | string | No | Default lahiri. Full list → |
node_type | string | No | mean (default) or true. |
Response shape
A single data.chart object with chart metadata and two signed
image URLs.
| Field | Type | Description |
|---|---|---|
| data.chart | ||
code | string | Divisional chart code (always D1 for this endpoint). |
name | string | Chart name (always Rashi). |
| data.chart.images | ||
north | string (URL) | Signed URL for the North Indian style chart image. Token-authenticated, time-limited. |
south | string (URL) | Signed URL for the South Indian style chart image. Token-authenticated, time-limited. |
expires timestamp and a token. The image
can be fetched directly (no API key needed) but will return 403 after expiry. Generate
fresh URLs by calling this endpoint again.
Use cases
- Instant chart display — embed the URL in an
<img>tag for immediate chart rendering without any client-side drawing. - PDF reports — download the image and insert it into generated kundli reports.
- Chat/messaging — send the chart image URL directly in WhatsApp, Telegram, or in-app chat.
- North vs South preference — let users choose their regional chart style — both are always returned.
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
- Planets — the underlying planet data used to draw the chart
- Planets in Houses — house-level occupant and aspect data
- Ascendant — detailed ascendant data with nakshatra
- Vedic Astrology overview — full category index