Chart Rendering
Generate beautiful SVG and PNG chart images.
SVG Charts
Generate an SVG natal chart:
bash
curl -X POST "https://api.astroapi.cloud/api/chart/natal/svg" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"datetime": "1990-06-15T14:30:00",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London"
}'PNG Charts
Convert to PNG format:
bash
curl -X POST "https://api.astroapi.cloud/api/chart/natal/png" \
-H "X-Api-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"datetime": "1990-06-15T14:30:00",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London",
"width": 800,
"height": 800
}'Chart Types
| Endpoint | Description |
|---|---|
/api/chart/natal/svg | Natal chart as SVG |
/api/chart/natal/png | Natal chart as PNG |
/api/chart/transit/svg | Transit chart overlay |
/api/chart/synastry/svg | Bi-wheel synastry chart |
/api/chart/composite/svg | Composite chart |
Styling Options
Customize chart appearance:
json
{
"datetime": "...",
"latitude": 51.5074,
"longitude": -0.1278,
"timezone": "Europe/London",
"style": {
"theme": "dark",
"colorScheme": {
"fire": "#ff6b6b",
"earth": "#95d5b2",
"air": "#ffd166",
"water": "#118ab2"
},
"showAspects": true,
"showDegrees": true,
"showRetrograde": true
}
}Themes
Available built-in themes:
default- Classic light themedark- Dark backgroundminimal- Clean, simplified designtraditional- Classic astrological style
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" />