Skip to content

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

EndpointDescription
/api/chart/natal/svgNatal chart as SVG
/api/chart/natal/pngNatal chart as PNG
/api/chart/transit/svgTransit chart overlay
/api/chart/synastry/svgBi-wheel synastry chart
/api/chart/composite/svgComposite 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 theme
  • dark - Dark background
  • minimal - Clean, simplified design
  • traditional - 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" />

AstroAPI Documentation