Flying Star Chart API
A Xuan Kong flying star chart: base, mountain and water stars in all nine palaces, and its structure
POST/v1/feng-shui/flying-stars
2 credits · Secret key (test or live) · getFlyingStars
Give the facing bearing and either the period or the year built. Replacement charts are not calculated: near_boundary says when a school might use one.
Request body
facing_degreesnumber requiredThe bearing the building faces, in degrees from magnetic north, as a luopan reads it.
≥ 0 · < 360
periodintegerPeriod 9 runs from Li Chun 2024 to Li Chun 2044.
≥ 1 · ≤ 9
built_yearintegerUsed for the period if you do not give one. It does not know which side of Li Chun the building was finished.
≥ 1864 · ≤ 2100
optionsobjectlangstring requiredone of
en,hi· default"en"
No other fields are accepted.
No other fields are accepted.
Response
JSON { data, meta, warnings }, where data is:
periodinteger requiredfacingobject requireddegreesnumber requiredmountainobject requiredFields
idstring requiredchinesestring requiredpalaceobject requiredFields
idstring requirednamestring required
order_in_palaceinteger requiredfrom_degreenumber requiredto_degreenumber required
sittingobject requireddegreesnumber requiredmountainobject requiredFields
idstring requiredchinesestring requiredpalaceobject requiredFields
idstring requirednamestring required
order_in_palaceinteger requiredfrom_degreenumber requiredto_degreenumber required
mountain_starobject requiredcenterinteger requiredflightstring requiredone of
forward,reverse
water_starobject requiredcenterinteger requiredflightstring requiredone of
forward,reverse
palacesarray of object requiredpalaceobject requiredFields
idstring requirednamestring required
baseinteger requiredmountaininteger requiredwaterinteger requiredtimelinessobject requiredFields
mountainstring requiredone of
current,next,future,retreating,pastwaterstring requiredone of
current,next,future,retreating,past
structurestring or null requiredOne of:
- string
- null
fu_yinobject requiredmountainboolean requiredwaterboolean required
fan_yinobject requiredmountainboolean requiredwaterboolean required
near_boundaryboolean requiredreplacement_chartboolean required
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' \
-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", {
method: "POST",
headers: { Authorization: "Bearer al_test_YOUR_KEY", "Content-Type": "application/json" },
body: JSON.stringify({
"facing_degrees": 180,
"period": 9
}),
});
console.log(JSON.stringify(await res.json(), null, 2));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",
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/flying-stars');
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
200 OK · 3,445 characters
{
"data": {
"period": 9,
"facing": {
"degrees": 180,
"mountain": {
"id": "wu",
"chinese": "午",
"palace": {
"id": "S",
"name": "south"
},
"order_in_palace": 2,
"from_degree": 172.5,
"to_degree": 187.5
}
},
"sitting": {
"degrees": 0,
"mountain": {
"id": "zi",
"chinese": "子",
"palace": {
"id": "N",
"name": "north"
},
"order_in_palace": 2,
"from_degree": 352.5,
"to_degree": 7.5
}
},
"mountain_star": {
"center": 5,
"flight": "reverse"
},
"water_star": {
"center": 4,
"flight": "forward"
},
"palaces": [
{
"palace": {
"id": "NW",
"name": "northwest"
},
"base": 1,
"mountain": 4,
"water": 5,
"timeliness": {
"mountain": "past",
"water": "past"
}
},
{
"palace": {
"id": "W",
"name": "west"
},
"base": 2,
"mountain": 3,
"water": 6,
"timeliness": {
"mountain": "past",
"water": "past"
}
},
{
"palace": {
"id": "NE",
"name": "northeast"
},
"base": 3,
"mountain": 2,
"water": 7,
"timeliness": {
"mountain": "future",
"water": "past"
}
},
{
"palace": {
"id": "S",
"name": "south"
},
"base": 4,
"mountain": 1,
"water": 8,
"timeliness": {
"mountain": "next",
"water": "retreating"
}
},
{
"palace": {
"id": "N",
"name": "north"
},
"base": 5,
"mountain": 9,
"water": 9,
"timeliness": {
"mountain": "current",
"water": "current"
}
},
{
"palace": {
"id": "SW",
"name": "southwest"
},
"base": 6,
"mountain": 8,
"water": 1,
"timeliness": {
"mountain": "retreating",
"water": "next"
}
},
{
"palace": {
"id": "E",
"name": "east"
},
"base": 7,
"mountain": 7,
"water": 2,
"timeliness": {
"mountain": "past",
"water": "future"
}
},
{
"palace": {
"id": "SE",
"name": "southeast"
},
"base": 8,
"mountain": 6,
"water": 3,
"timeliness": {
"mountain": "past",
"water": "past"
}
},
{
"palace": {
"id": "center",
"name": "center"
},
"base": 9,
"mountain": 5,
"water": 4,
"timeliness": {
"mountain": "past",
"water": "past"
}
}
],
"structure": "double_at_sitting",
"fu_yin": {
"mountain": false,
"water": false
},
"fan_yin": {
"mountain": true,
"water": false
},
"near_boundary": false,
"replacement_chart": false
},
"meta": {
"request_id": "req_example",
"api_version": "v1",
"engine_version": "2026.10.10",
"mode": "live",
"credits_charged": 2
},
"warnings": []
}Try it
More in Feng Shui
- Kua Number API: A person's Kua number, East or West group and eight directions
- Feng Shui House Gua API: A building's gua from its facing, its eight mansions, and how it fits an occupant's Kua
- Flying Star Grid SVG API: The flying star chart drawn as a nine-palace grid in SVG, south at the top
- Annual Flying Stars API: A year's flying stars, Five Yellow, Tai Sui, Sui Po and San Sha, with the twelve monthly charts