POST · WESTERN

Solar Return Chart Image

Endpoint POST https://starsapi.com/api/v3/western/forecasting/solar-return-chart-image

Overview

Renders a solar return chart wheel as a 1100×1100 PNG image. Computes the exact SR moment (Sun returning to natal longitude in the requested year), calculates all positions and aspects, and returns a signed URL to the rendered chart. The signed URL is valid for 24 hours and can be embedded in a UI or downloaded.

For the raw SR data (positions, houses, aspects, angles) without the rendered image, use forecasting/solar-return. For SR with text interpretations, use predictions/solar-return.

Authentication

MethodExample
Header (recommended)X-Api-Key: sa_live_xxxxxxxxxxxx
BearerAuthorization: Bearer sa_live_xxxxxxxxxxxx

Auth is required only for the POST request. The returned chart_url is pre-signed with HMAC and does not require an API key when fetched.

Request body

FieldTypeRequiredDescription
yearminuteintegerYesStandard birth data fields.
latitude, longitudenumberYesBirth location (signed decimal degrees).
timezonestringYesIANA timezone (e.g. Asia/Kolkata).
return_yearintegerYesYear to calculate the solar return for. Range: 1800–2400.
house_systemstringNoDefault placidus. Supports koch, whole_sign, equal, and 19 more.
return_latitudenumberNoRelocation latitude. Default: birth latitude.
return_longitudenumberNoRelocation longitude. Default: birth longitude.
return_timezonestringNoRelocation IANA timezone. Default: birth timezone.
namestringNoNative's name (used in chart footer if branding is enabled).
center_textstringNoText rendered in the center of the wheel. Default: SR {year}.
brandingobjectNoOptional footer branding: { "name": "...", "url": "..." }.

Relocation

Solar return charts are highly location-sensitive — the house cusps and rendered wheel change based on where the native is at the moment of the return. Pass return_latitude, return_longitude, and return_timezone to render the SR wheel for a different location (e.g. the native has relocated).

The return_location block in the response echoes back the coordinates and timezone actually used.

Response shape

The response envelope follows the standard v3 shape (status, success, data, meta). The data.chart object contains:

FieldDescription
codeChart code: SR.
nameDisplay name (e.g. Solar Return 2026).
significanceShort human-readable description of what this chart represents.
return_yearYear requested.
solar_return_momentExact UTC timestamp, datetime, and Julian day of the solar return.
return_locationLocation used for the SR chart (birth or relocation).
ascendantSR ascendant with longitude, sign, degree, and DMS string.
chart_urlSigned URL to the rendered PNG. Valid for 24 hours. Embed directly in <img src> or fetch as binary.

meta.house_system confirms the system used and meta.cache indicates cache HIT or MISS.

Fetching the image

The chart_url is a pre-signed URL of the form:

https://starsapi.com/api/v3/western/forecasting/solar-return-chart-image?key=<cacheKey>&expires=<unix>&token=<hmac>

Fetch it with a plain GET (no auth headers required). The response is an image/png with dimensions 1100×1100. Typical size: 250–280 KB.

Since the URL is signed with an expiry, do not store it long-term. Store the birth details and re-request the endpoint when you need the image again — the response will be a fast cache HIT if the same inputs were used recently.

Caching

Chart images are cached on disk for 24 hours, keyed by the full input set (birth data, return year, return location, house system). Identical requests return meta.cache: "HIT" with response times of ~3–5 ms; fresh computations show MISS with ~50–70 ms compute time.

Coordinates are rounded to 4 decimal places before hashing to avoid cache misses from floating-point drift (e.g. 77.2090 vs 77.209 hit the same cache entry).

Errors

HTTPCodeCause
400MISSING_FIELDRequired field absent (including return_year).
400INVALID_RETURN_YEARreturn_year outside 1800–2400.
400INVALID_TIMEZONEreturn_timezone is not a valid IANA identifier.
400INVALID_COORDINATESreturn_latitude or return_longitude out of range.
401INVALID_SIGNATURESigned URL token invalid or tampered with. Re-request via POST.
410URL_EXPIREDSigned URL past its 24-hour expiry. Re-request via POST.
500COMPUTE_ERRORSolar return moment not found.
500RENDER_ERRORWheel rendering failed.

See also