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" />Chart2 - Next Generation Charts
AstroAPI offers a next-generation chart rendering engine with theme support and animations.
Endpoints
| Endpoint | Description | Required Module |
|---|---|---|
/api/chart2/natal.svg | Natal chart (SVG) | module:natal-calc |
/api/chart2/natal.png | Natal chart (PNG) | module:natal-calc |
/api/chart2/transit.svg | Transit bi-wheel (SVG) | module:transit-calc |
/api/chart2/transit.png | Transit bi-wheel (PNG) | module:transit-calc |
/api/chart2/synastry.svg | Synastry chart (SVG) | module:synastry-calc |
/api/chart2/synastry.png | Synastry chart (PNG) | module:synastry-calc |
/api/chart2/composite.svg | Composite chart (SVG) | module:synastry-calc |
/api/chart2/composite.png | Composite chart (PNG) | module:synastry-calc |
/api/chart2/animated-transit.svg | Animated transit (SVG) | module:transit-calc |
Basic Usage
bash
curl -X GET "https://api.astroapi.cloud/api/chart2/natal.svg?width=800&height=800&dateTime=1990-06-15T14:30&location.longitude=4.89&location.latitude=52.37&location.timezone=Europe/Amsterdam&theme=dark" \
-H "X-Api-Key: your-api-key"Theme Presets
| Theme | Description |
|---|---|
default | Classic white background with colored elements |
classic | Traditional astrological look |
dark | Modern dark theme with vibrant colors |
minimal | Clean, less visual noise |
colorful | Vibrant planet colors |
nextgen | Modern with curved aspect lines, glow effects and gradients |
vintage | Old parchment/manuscript style with sepia tones |
neon | Cyberpunk with bright neon colors on black |
pastel | Soft, calming pastel colors |
print | High contrast black/white, optimized for printing |
Theme Overrides
Customize individual theme properties via query parameters:
| Parameter | Description |
|---|---|
theme.background | Background color (hex) |
theme.foreground | Foreground color (hex) |
theme.strokeOnly | Stroke-only mode (true/false) |
theme.symbolScale | Symbol scale factor |
theme.showDegrees | Show degree labels (true/false) |
theme.showHouseNumbers | Show house numbers (true/false) |
theme.showRuler | Show ruler (true/false) |
theme.signBackgroundOpacity | Sign background opacity (0-1) |
Synastry & Composite Charts
bash
curl -X GET "https://api.astroapi.cloud/api/chart2/synastry.svg?width=800&height=800&person1.dateTime=1990-06-15T14:30&person1.timezone=Europe/Amsterdam&person1.longitude=4.89&person1.latitude=52.37&person2.dateTime=1992-03-20T09:15&person2.timezone=Europe/London&person2.longitude=-0.12&person2.latitude=51.50" \
-H "X-Api-Key: your-api-key"Animated Transit
Generate animated SVG showing transit progression over time:
bash
curl -X GET "https://api.astroapi.cloud/api/chart2/animated-transit.svg?width=800&height=800&dateTime=1990-06-15T14:30&location.longitude=4.89&location.latitude=52.37&location.timezone=Europe/Amsterdam&transit.dateTime=2025-01-01T12:00&transit.timezone=Europe/Amsterdam&target.dateTime=2025-12-31T23:59&animation.duration=3000" \
-H "X-Api-Key: your-api-key"| Parameter | Description |
|---|---|
target.dateTime | End date for animation |
animation.duration | Animation duration in milliseconds |
animation.easing | Easing function (default: easeInOut) |
animation.loop | Loop animation (default: false) |