Kundli chart image API demo
One real call to POST /v1/charts/{varga}.svg (2 credits). It takes the same birth body as the kundli call, plus a style of north or south, and returns an SVG image ready to put on a page. Change D1 in the path to D9 for the navamsa, edit the body and press Send.
Try it
Why an image API
Drawing a North Indian chart is fiddly: twelve diamond houses, sign numbers, and planets that have to fit when four of them share a house. The SVG scales without blurring and can be styled. If you need a raster image for an email or a WhatsApp message, POST /v1/charts/{varga}.png (3 credits) returns a PNG of the same chart.
If you would rather draw the chart yourself, the positions are in the kundli demo as JSON.
The same call in code
curl -X POST 'https://api.astrologics.in/v1/charts/D1.svg' \
-H 'Authorization: Bearer al_test_YOUR_KEY' \
-H 'Content-Type: application/json' \
-d '{"birth":{"date":"1990-08-13","time":"06:30","place":{"latitude":28.6139,"longitude":77.209}},"style":"north"}'const res = await fetch("https://api.astrologics.in/v1/charts/D1.svg", {
method: "POST",
headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"birth": {
"date": "1990-08-13",
"time": "06:30",
"place": {
"latitude": 28.6139,
"longitude": 77.209
}
},
"style": "north"
}),
});
console.log(await res.text());<?php
$ch = curl_init('https://api.astrologics.in/v1/charts/D1.svg');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"birth":{"date":"1990-08-13","time":"06:30","place":{"latitude":28.6139,"longitude":77.209}},"style":"north"}',
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;Questions
Which charts can it draw?
The D1 birth chart and the divisional charts the chart images reference lists, in North or South Indian style.
Can I put the SVG straight into a page?
Yes. It is a self-contained SVG with no scripts. Serve it from your own server so that your secret key stays there.
Can I show the chart in Hindi?
The chart images reference lists the options the call takes, including the label language.
Want your own chart rather than an API? Make a free kundli on astrologics.in.