API reference › Vastu

Vastu Mandala SVG API

The mandala drawn as SVG, north up, in English or Hindi, with the door marked

POST/v1/vastu/mandala.svg

2 credits · Secret key (test or live) · getVastuMandalaSvg

Request body

  • plot object required
    • width_m number required

      Along the front, in metres.

      > 0 · ≤ 100000

    • depth_m number required

      From the front to the back, in metres.

      > 0 · ≤ 100000

    • facing_deg number required

      The compass bearing a person looks along when facing out through the front: 0 north, 90 east.

      ≥ 0 · ≤ 360

    No other fields are accepted.

  • grid integer

    The mandala: 81 squares (verse 42) or 64 (verse 55).

    one of 81, 64 · default 81

  • lang string

    one of en, hi · default "en"

  • theme string

    one of light, dark · default "light"

  • door object
    • wall string required

      Left and right as seen from outside, looking at the front.

      one of front, left, back, right

    • from_left_m number required

      The door's centre, from the left end of that wall as seen from outside it.

      ≥ 0

    • width_m number

      > 0 · ≤ 100

    No other fields are accepted.

No other fields are accepted.

Response

image/svg+xml

Errors: 400, 401, 403, 404, 422, 429, 500. See error codes.

Example request

curl -X POST 'https://api.astrologics.in/v1/vastu/mandala.svg' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"plot":{"width_m":18,"depth_m":27,"facing_deg":90},"door":{"wall":"front","from_left_m":10}}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/vastu/mandala.svg", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "plot": {
      "width_m": 18,
      "depth_m": 27,
      "facing_deg": 90
    },
    "door": {
      "wall": "front",
      "from_left_m": 10
    }
  }),
});
console.log(await res.text());
Python
import json
import urllib.error
import urllib.request

body = {
    "plot": {
        "width_m": 18,
        "depth_m": 27,
        "facing_deg": 90,
    },
    "door": {
        "wall": "front",
        "from_left_m": 10,
    },
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/vastu/mandala.svg",
    method="POST",
    headers={"Authorization": "Bearer al_test_YOUR_KEY", "Content-Type": "application/json"},
    data=json.dumps(body).encode(),
)
try:
    with urllib.request.urlopen(req) as res:
        print(res.read().decode())
except urllib.error.HTTPError as err:
    print(err.code, err.read().decode())
PHP
<?php
$ch = curl_init('https://api.astrologics.in/v1/vastu/mandala.svg');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"plot":{"width_m":18,"depth_m":27,"facing_deg":90},"door":{"wall":"front","from_left_m":10}}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

The chart this example request returns

Try it

Leave empty to use the shared demo key (limited). Test keys only: never charged. Kept in this browser tab and sent through this site to the API. Create one

More in Vastu

Get a free API key Vastu product page