API reference › Reports

Vastu PDF Report API

A client-ready Vastu report as a PDF: mandala, plot, door and rooms

POST/v1/reports/vastu.pdf

10 credits · Secret key (test or live) · getVastuReport

The plot and mandala always; the ground, door and rooms when you send them. English or Hindi throughout. Nothing is stored.

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.

  • brand object required
    • name string required

      Printed at the top of every page.

      at least 1 characters · at most 80 characters

    • tagline string

      at most 120 characters

    • contact string

      Printed at the foot of every page.

      at most 120 characters

    • color string

      Accent colour, as #rrggbb.

      pattern ^#[0-9a-fA-F]{6}$

    • logo_base64 string

      A PNG or JPEG in base64, up to about 150 KB.

      at most 200000 characters

    No other fields are accepted.

  • client_name string

    at least 1 characters · at most 80 characters

  • lang string

    one of en, hi · default "en"

  • grid integer

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

    one of 81, 64 · default 81

  • ground object
    • irregular_shape boolean
    • higher_side string

      Which part of the ground stands higher; none when it is level.

      one of none, north, northeast, east, southeast, south, southwest, west, northwest

    • water array of string

      Where water lies.

      no repeats

    • cuts array of string

      Corners cut away.

      no repeats

    • extensions array of string

      Corners that extend out.

      no repeats

    • road_sides array of string

      Sides with a road.

      no repeats

    • crossroads boolean

      Four roads meet close by.

    No other fields are accepted.

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

  • rooms array of object

    at least 1 item · at most 60 items

    • type string required

      one of puja, kitchen, utensil_store, treasury, granary, master_bedroom, bedroom, living, dining, study, toilet, staircase, garage, overhead_tank, septic_tank

    • zone string

      one of north, northeast, east, southeast, south, southwest, west, northwest, center

    • from_left_m number

      With from_front_m and plot, in place of zone.

      ≥ 0

    • from_front_m number

      ≥ 0

    No other fields are accepted.

No other fields are accepted.

Response

application/pdf

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

Example request

curl -X POST 'https://api.astrologics.in/v1/reports/vastu.pdf' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"plot":{"width_m":20,"depth_m":25,"facing_deg":90},"brand":{"name":"Sample Vastu Studio"},"door":{"wall":"front","from_left_m":10,"width_m":1.2},"rooms":[{"type":"kitchen","zone":"southeast"},{"type":"puja","zone":"northeast"}],"lang":"hi"}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/reports/vastu.pdf", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "plot": {
      "width_m": 20,
      "depth_m": 25,
      "facing_deg": 90
    },
    "brand": {
      "name": "Sample Vastu Studio"
    },
    "door": {
      "wall": "front",
      "from_left_m": 10,
      "width_m": 1.2
    },
    "rooms": [
      {
        "type": "kitchen",
        "zone": "southeast"
      },
      {
        "type": "puja",
        "zone": "northeast"
      }
    ],
    "lang": "hi"
  }),
});
console.log(await res.text());
Python
import json
import urllib.error
import urllib.request

body = {
    "plot": {
        "width_m": 20,
        "depth_m": 25,
        "facing_deg": 90,
    },
    "brand": {
        "name": "Sample Vastu Studio",
    },
    "door": {
        "wall": "front",
        "from_left_m": 10,
        "width_m": 1.2,
    },
    "rooms": [
        {
            "type": "kitchen",
            "zone": "southeast",
        },
        {
            "type": "puja",
            "zone": "northeast",
        },
    ],
    "lang": "hi",
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/reports/vastu.pdf",
    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/reports/vastu.pdf');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"plot":{"width_m":20,"depth_m":25,"facing_deg":90},"brand":{"name":"Sample Vastu Studio"},"door":{"wall":"front","from_left_m":10,"width_m":1.2},"rooms":[{"type":"kitchen","zone":"southeast"},{"type":"puja","zone":"northeast"}],"lang":"hi"}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

Returns a PDF document. Save the response body as a file.

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 Reports

Get a free API key Reports product page