Skip to content

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.png

Chart Types

EndpointDescription
/api/chart/image.svgNatal chart as SVG
/api/chart/image.pngNatal chart as PNG
/api/chart/image.svg with transit.* paramsTransit bi-wheel chart
/api/chart/composite.svgComposite chart (midpoints)
/api/chart/composite.pngComposite 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

ParameterRequiredDescription
transit.dateTimeYesTransit date/time (YYYY-MM-DDTHH:mm)
transit.timezoneYesTransit timezone
transit.longitudeNoTransit location longitude (defaults to natal)
transit.latitudeNoTransit 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

ParameterRequiredDescription
widthYesChart width in pixels
heightYesChart height in pixels
dateTimeYesBirth date/time (YYYY-MM-DDTHH:mm)
location.longitudeYesBirth location longitude
location.latitudeYesBirth location latitude
location.timezoneYesBirth location timezone (IANA format)

Composite Chart Parameters

ParameterRequiredDescription
widthYesChart width in pixels
heightYesChart height in pixels
person1.dateTimeYesPerson 1 birth date/time
person1.timezoneYesPerson 1 timezone
person1.longitudeYesPerson 1 longitude
person1.latitudeYesPerson 1 latitude
person2.dateTimeYesPerson 2 birth date/time
person2.timezoneYesPerson 2 timezone
person2.longitudeYesPerson 2 longitude
person2.latitudeYesPerson 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

EndpointDescriptionRequired Module
/api/chart2/natal.svgNatal chart (SVG)module:natal-calc
/api/chart2/natal.pngNatal chart (PNG)module:natal-calc
/api/chart2/transit.svgTransit bi-wheel (SVG)module:transit-calc
/api/chart2/transit.pngTransit bi-wheel (PNG)module:transit-calc
/api/chart2/synastry.svgSynastry chart (SVG)module:synastry-calc
/api/chart2/synastry.pngSynastry chart (PNG)module:synastry-calc
/api/chart2/composite.svgComposite chart (SVG)module:synastry-calc
/api/chart2/composite.pngComposite chart (PNG)module:synastry-calc
/api/chart2/animated-transit.svgAnimated 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

ThemeDescription
defaultClassic white background with colored elements
classicTraditional astrological look
darkModern dark theme with vibrant colors
minimalClean, less visual noise
colorfulVibrant planet colors
nextgenModern with curved aspect lines, glow effects and gradients
vintageOld parchment/manuscript style with sepia tones
neonCyberpunk with bright neon colors on black
pastelSoft, calming pastel colors
printHigh contrast black/white, optimized for printing

Theme Overrides

Customize individual theme properties via query parameters:

ParameterDescription
theme.backgroundBackground color (hex)
theme.foregroundForeground color (hex)
theme.strokeOnlyStroke-only mode (true/false)
theme.symbolScaleSymbol scale factor
theme.showDegreesShow degree labels (true/false)
theme.showHouseNumbersShow house numbers (true/false)
theme.showRulerShow ruler (true/false)
theme.signBackgroundOpacitySign 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"
ParameterDescription
target.dateTimeEnd date for animation
animation.durationAnimation duration in milliseconds
animation.easingEasing function (default: easeInOut)
animation.loopLoop animation (default: false)

AstroAPI Documentation