API reference › Feng Shui

Flying Star Grid SVG API

The flying star chart drawn as a nine-palace grid in SVG, south at the top

POST/v1/feng-shui/flying-stars.svg

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

Request body

  • facing_degrees number required

    The bearing the building faces, in degrees from magnetic north, as a luopan reads it.

    ≥ 0 · < 360

  • period integer

    Period 9 runs from Li Chun 2024 to Li Chun 2044.

    ≥ 1 · ≤ 9

  • built_year integer

    ≥ 1864 · ≤ 2100

  • theme string

    one of light, dark · default "light"

  • options object
    • lang string required

      one of en, hi · default "en"

    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/feng-shui/flying-stars.svg' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"facing_degrees":180,"period":9}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/feng-shui/flying-stars.svg", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "facing_degrees": 180,
    "period": 9
  }),
});
console.log(await res.text());
Python
import json
import urllib.error
import urllib.request

body = {
    "facing_degrees": 180,
    "period": 9,
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/feng-shui/flying-stars.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/feng-shui/flying-stars.svg');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"facing_degrees":180,"period":9}',
    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 Feng Shui

Get a free API key Feng Shui product page