Chart Rendering
Generate beautiful SVG and PNG chart images.
SVG Charts
Generate an SVG natal chart using query parameters:
bash
curl -X GET "https://api.astroapi.cloud/api/chart/image.svg?width=800&height=800&dateTime=1990-06-15T14:30&location.longitude=-0.1278&location.latitude=51.5074&location.timezone=Europe/London" \
-H "X-Api-Key: your-api-key"PNG Charts
Convert to PNG format:
bash
curl -X GET "https://api.astroapi.cloud/api/chart/image.png?width=800&height=800&dateTime=1990-06-15T14:30&location.longitude=-0.1278&location.latitude=51.5074&location.timezone=Europe/London" \
-H "X-Api-Key: your-api-key" \
--output chart.pngChart Types
| Endpoint | Description |
|---|---|
/api/chart/image.svg | Natal chart as SVG |
/api/chart/image.png | Natal chart as PNG |
/api/chart/image.svg with transit.* params | Transit bi-wheel chart |
/api/chart/composite.svg | Composite chart (midpoints) |
/api/chart/composite.png | Composite chart as PNG |
Transit Bi-wheel Chart
Add transit parameters to render a bi-wheel chart with natal (inner) and transit (outer) wheels:
bash
curl -X GET "https://api.astroapi.cloud/api/chart/image.svg?width=800&height=800&dateTime=1990-06-15T14:30&location.longitude=-0.1278&location.latitude=51.5074&location.timezone=Europe/London&transit.dateTime=2024-01-15T12:00&transit.timezone=Europe/London" \
-H "X-Api-Key: your-api-key"Transit Parameters
| Parameter | Required | Description |
|---|---|---|
transit.dateTime | Yes | Transit date/time (YYYY-MM-DDTHH:mm) |
transit.timezone | Yes | Transit timezone |
transit.longitude | No | Transit location longitude (defaults to natal) |
transit.latitude | No | Transit location latitude (defaults to natal) |
Composite Chart
Generate a composite chart showing midpoints between two natal charts:
bash
curl -X GET "https://api.astroapi.cloud/api/chart/composite.svg?width=800&height=800&person1.dateTime=1990-06-15T14:30&person1.timezone=Europe/London&person1.longitude=-0.1278&person1.latitude=51.5074&person2.dateTime=1988-03-22T09:15&person2.timezone=Europe/Paris&person2.longitude=2.3522&person2.latitude=48.8566" \
-H "X-Api-Key: your-api-key"Query Parameters
Natal Chart Parameters
| Parameter | Required | Description |
|---|---|---|
width | Yes | Chart width in pixels |
height | Yes | Chart height in pixels |
dateTime | Yes | Birth date/time (YYYY-MM-DDTHH:mm) |
location.longitude | Yes | Birth location longitude |
location.latitude | Yes | Birth location latitude |
location.timezone | Yes | Birth location timezone (IANA format) |
Composite Chart Parameters
| Parameter | Required | Description |
|---|---|---|
width | Yes | Chart width in pixels |
height | Yes | Chart height in pixels |
person1.dateTime | Yes | Person 1 birth date/time |
person1.timezone | Yes | Person 1 timezone |
person1.longitude | Yes | Person 1 longitude |
person1.latitude | Yes | Person 1 latitude |
person2.dateTime | Yes | Person 2 birth date/time |
person2.timezone | Yes | Person 2 timezone |
person2.longitude | Yes | Person 2 longitude |
person2.latitude | Yes | Person 2 latitude |
Response Headers
Chart endpoints return appropriate content types:
- SVG:
image/svg+xml - PNG:
image/png
Embedding Charts
Use the returned SVG directly in HTML:
html
<div class="chart-container">
<!-- SVG content from API -->
</div>Or use as an image source with data URL:
html
<img src="data:image/svg+xml;base64,..." alt="Natal Chart" />