API reference › Feng Shui

Feng Shui House Gua API

A building's gua from its facing, its eight mansions, and how it fits an occupant's Kua

POST/v1/feng-shui/house

1 credit · Secret key (test or live) · getFengShuiHouse

Request body

  • facing_degrees number required

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

    ≥ 0 · < 360

  • kua integer

    An occupant's Kua number, from /v1/feng-shui/kua. 5 is not valid.

    ≥ 1 · ≤ 9

  • options object
    • lang string required

      one of en, hi · default "en"

    No other fields are accepted.

No other fields are accepted.

Response

JSON { data, meta, warnings }, where data is:

  • facing object required
    • id string required
    • chinese string required
    • palace object required
      Fields
      • id string required
      • name string required
    • order_in_palace integer required
    • from_degree number required
    • to_degree number required
  • sitting object required
    • id string required
    • chinese string required
    • palace object required
      Fields
      • id string required
      • name string required
    • order_in_palace integer required
    • from_degree number required
    • to_degree number required
  • house object required
    • number integer required
    • gua string required
    • chinese string required
    • group string required

      one of east, west

    • home_direction object required
      Fields
      • id string required
      • name string required
    • mansions array of object required
      Fields
      • id string required
      • chinese string required
      • name string required
      • kind string required

        one of good, bad

      • direction object required
        Fields
        • id string required
        • name string required
  • occupant object
    • kua integer required
    • group string required
    • same_group boolean required
    • facing_mansion string required
    • sitting_mansion string required
    • mansions array of object required
      Fields
      • id string required
      • chinese string required
      • name string required
      • kind string required

        one of good, bad

      • direction object required
        Fields
        • id string required
        • name string required

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

Example request

curl -X POST 'https://api.astrologics.in/v1/feng-shui/house' \
  -H 'Authorization: Bearer al_test_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"facing_degrees":180,"kua":1}'
Node.js
const res = await fetch("https://api.astrologics.in/v1/feng-shui/house", {
  method: "POST",
  headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
  body: JSON.stringify({
    "facing_degrees": 180,
    "kua": 1
  }),
});
console.log(JSON.stringify(await res.json(), null, 2));
Python
import json
import urllib.error
import urllib.request

body = {
    "facing_degrees": 180,
    "kua": 1,
}

req = urllib.request.Request(
    "https://api.astrologics.in/v1/feng-shui/house",
    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(json.dumps(json.load(res), indent=2, ensure_ascii=False))
except urllib.error.HTTPError as err:
    print(err.code, err.read().decode())
PHP
<?php
$ch = curl_init('https://api.astrologics.in/v1/feng-shui/house');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer al_test_YOUR_KEY', 'Content-Type: application/json'],
    CURLOPT_POSTFIELDS => '{"facing_degrees":180,"kua":1}',
    CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch), PHP_EOL;

Example response

200 OK · 4,600 characters
{
  "data": {
    "facing": {
      "id": "wu",
      "chinese": "午",
      "palace": {
        "id": "S",
        "name": "south"
      },
      "order_in_palace": 2,
      "from_degree": 172.5,
      "to_degree": 187.5
    },
    "sitting": {
      "id": "zi",
      "chinese": "子",
      "palace": {
        "id": "N",
        "name": "north"
      },
      "order_in_palace": 2,
      "from_degree": 352.5,
      "to_degree": 7.5
    },
    "house": {
      "number": 1,
      "gua": "kan",
      "chinese": "坎",
      "group": "east",
      "home_direction": {
        "id": "N",
        "name": "north"
      },
      "mansions": [
        {
          "id": "sheng_qi",
          "chinese": "生气",
          "name": "Life Generating",
          "kind": "good",
          "direction": {
            "id": "SE",
            "name": "southeast"
          }
        },
        {
          "id": "tian_yi",
          "chinese": "天医",
          "name": "Heavenly Doctor",
          "kind": "good",
          "direction": {
            "id": "E",
            "name": "east"
          }
        },
        {
          "id": "yan_nian",
          "chinese": "延年",
          "name": "Longevity",
          "kind": "good",
          "direction": {
            "id": "S",
            "name": "south"
          }
        },
        {
          "id": "fu_wei",
          "chinese": "伏位",
          "name": "Stability",
          "kind": "good",
          "direction": {
            "id": "N",
            "name": "north"
          }
        },
        {
          "id": "huo_hai",
          "chinese": "祸害",
          "name": "Mishap",
          "kind": "bad",
          "direction": {
            "id": "W",
            "name": "west"
          }
        },
        {
          "id": "wu_gui",
          "chinese": "五鬼",
          "name": "Five Ghosts",
          "kind": "bad",
          "direction": {
            "id": "NE",
            "name": "northeast"
          }
        },
        {
          "id": "liu_sha",
          "chinese": "六煞",
          "name": "Six Killings",
          "kind": "bad",
          "direction": {
            "id": "NW",
            "name": "northwest"
          }
        },
        {
          "id": "jue_ming",
          "chinese": "绝命",
          "name": "Life Ending",
          "kind": "bad",
          "direction": {
            "id": "SW",
            "name": "southwest"
          }
        }
      ]
    },
    "occupant": {
      "kua": 1,
      "group": "east",
      "same_group": true,
      "facing_mansion": "yan_nian",
      "sitting_mansion": "fu_wei",
      "mansions": [
        {
          "id": "sheng_qi",
          "chinese": "生气",
          "name": "Life Generating",
          "kind": "good",
          "direction": {
            "id": "SE",
            "name": "southeast"
          }
        },
        {
          "id": "tian_yi",
          "chinese": "天医",
          "name": "Heavenly Doctor",
          "kind": "good",
          "direction": {
            "id": "E",
            "name": "east"
          }
        },
        {
          "id": "yan_nian",
          "chinese": "延年",
          "name": "Longevity",
          "kind": "good",
          "direction": {
            "id": "S",
            "name": "south"
          }
        },
        {
          "id": "fu_wei",
          "chinese": "伏位",
          "name": "Stability",
          "kind": "good",
          "direction": {
            "id": "N",
            "name": "north"
          }
        },
        {
          "id": "huo_hai",
          "chinese": "祸害",
          "name": "Mishap",
          "kind": "bad",
          "direction": {
            "id": "W",
            "name": "west"
          }
        },
        {
          "id": "wu_gui",
          "chinese": "五鬼",
          "name": "Five Ghosts",
          "kind": "bad",
          "direction": {
            "id": "NE",
            "name": "northeast"
          }
        },
        {
          "id": "liu_sha",
          "chinese": "六煞",
          "name": "Six Killings",
          "kind": "bad",
          "direction": {
            "id": "NW",
            "name": "northwest"
          }
        },
        {
          "id": "jue_ming",
          "chinese": "绝命",
          "name": "Life Ending",
          "kind": "bad",
          "direction": {
            "id": "SW",
            "name": "southwest"
          }
        }
      ]
    }
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 1
  },
  "warnings": []
}
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