Перейти до вмісту
AstroWay/api v2.325.0 · docs
усі системи в нормі

Floor plan to verdicts

POST
/vastu/plan
request.sh
curl -X POST https://api.astroway.info/v1/vastu/plan \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "coords": { "system": "metric", "units": "m" }, "northAngle": 0, "boundary": [ [ 0, 0 ], [ 12, 0 ], [ 12, 9 ], [ 0, 9 ] ], "rooms": [ { "type": "kitchen", "polygon": [ [ 8, 0 ], [ 12, 0 ], [ 12, 3 ], [ 8, 3 ] ] }, { "type": "master-bedroom", "polygon": [ [ 0, 0 ], [ 4, 0 ], [ 4, 4 ], [ 0, 4 ] ] } ], "items": [ { "type": "toilet", "point": [ 11, 8 ] } ], "entrance": [ 12, 6 ] }'

Send the outline of a house or plot, the angle to north and the rooms, fixtures and main door as points or polygons, in image pixels (or fractions with the image size) or in metres. Each room gets its bearing from the centre of the wall-aligned mandala, its 8, 16 and 32 sector, its mandala cell and deity, the share of each direction it covers, and the verdict and source /vastu/rooms gives; the door gets its pada and result. Findings come heaviest first with remedies, and the score is version 2: weighted by importance, with a band. Magnetic north needs the declination, walls on the diagonals need the facing side, and an L-shaped plan is warned about rather than averaged. The outline itself is judged too: square or modest rectangle, irregular, or turned off the directions, each with its verse. school sixteen-zone reads from the area centre and judges by 16 zones.

fields
string

Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.

Example
planets.name,planets.longitude
precision
integer
<= 15

Round every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.

Example
4
Idempotency-Key
string
>= 1 characters <= 255 characters /^[\x21-\x7E]+$/

Unique per logical operation, kept across retries. For 24 hours from the first request, a repeat with the same key, method, path, body and query string returns the stored response with Idempotent-Replayed: true and costs 0 credits. The same key with a different body or query string is a 409 IDEMPOTENCY_KEY_REUSED; a repeat while the first is still running is a 409 IDEMPOTENCY_IN_PROGRESS. Only 2xx responses are kept. See /idempotency/.

Example
01HXY2A7ZM0ABCDEF
Media type application/json
object
coords required
object
system required
string
Allowed values: image metric
width
number
height
number
normalized
boolean
units
string
Allowed values: m ft
northAngle required
number
>= -360 <= 360
northReference
string
Allowed values: true magnetic
declination
number
>= -90 <= 90
boundary required
Array<Array<number>>
>= 3 items <= 500 items
rooms
Array<object>
<= 60 items
object
type required
string
>= 1 characters <= 40 characters
label
string
<= 60 characters
point
Array<number>
>= 2 items <= 2 items
polygon
Array<Array<number>>
>= 3 items <= 200 items
items
Array<object>
<= 60 items
object
type required
string
>= 1 characters <= 40 characters
label
string
<= 60 characters
point
Array<number>
>= 2 items <= 2 items
polygon
Array<Array<number>>
>= 3 items <= 200 items
entrance
Array<number>
>= 2 items <= 2 items
entranceMethod
string
Allowed values: eight-per-side mandala-cells
facing
string
Allowed values: E S W N
school
string
Allowed values: brihat-samhita mayamata sixteen-zone
scoreVersion
Any of:
number
Allowed values: 1
Example
{
"coords": {
"system": "metric",
"units": "m"
},
"northAngle": 0,
"boundary": [
[
0,
0
],
[
12,
0
],
[
12,
9
],
[
0,
9
]
],
"rooms": [
{
"type": "kitchen",
"polygon": [
[
8,
0
],
[
12,
0
],
[
12,
3
],
[
8,
3
]
]
},
{
"type": "master-bedroom",
"polygon": [
[
0,
0
],
[
4,
0
],
[
4,
4
],
[
0,
4
]
]
}
],
"items": [
{
"type": "toilet",
"point": [
11,
8
]
}
],
"entrance": [
12,
6
]
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
language
string
nullable
requestedLanguage
string
nullable
school
string
nullable
coords
object
system
string
nullable
units
string
nullable
north
object
northAngle
number
nullable
northReference
string
nullable
declination
nullable
trueNorthAngle
number
nullable
centres
object
grid
object
x
number
nullable
y
number
nullable
area
object
x
number
nullable
y
number
nullable
insideContour
boolean
nullable
mandala
object
wallAngle
number
nullable
sides
object
N
object
normalBearing
number
nullable
E
object
normalBearing
number
nullable
S
object
normalBearing
number
nullable
W
object
normalBearing
number
nullable
orientation
string
nullable
brahmasthan
object
from
string
nullable
cells
Array<Array<number>>
nullable
shape
object
rectangular
boolean
nullable
fill
number
nullable
proportion
object
ratio
number
nullable
listed
boolean
nullable
source
string
nullable
offsetFromCardinal
number
nullable
findings
Array
nullable
cells
Array<object>
nullable
object
row
number
nullable
col
number
nullable
ring
string
nullable
devatas
Array<string>
nullable
outsideContour
boolean
nullable
rooms
Array<object>
nullable
object
type
string
nullable
label
nullable
placement
string
nullable
verdict
string
nullable
basis
string
nullable
ideal
Array<string>
nullable
source
string
nullable
at
object
x
number
nullable
y
number
nullable
from
string
nullable
bearing
number
nullable
direction
string
nullable
sector16
string
nullable
sector32
object
index
number
nullable
centre
number
nullable
from
number
nullable
to
number
nullable
cell
object
row
number
nullable
col
number
nullable
ring
string
nullable
devatas
Array<string>
nullable
coverage
object
SE
number
nullable
E
number
nullable
items
Array<object>
nullable
object
type
string
nullable
label
nullable
placement
string
nullable
verdict
string
nullable
basis
string
nullable
ideal
Array
nullable
source
string
nullable
rule
string
nullable
at
object
x
number
nullable
y
number
nullable
from
string
nullable
bearing
number
nullable
direction
string
nullable
sector16
string
nullable
sector32
object
index
number
nullable
centre
number
nullable
from
number
nullable
to
number
nullable
cell
object
row
number
nullable
col
number
nullable
ring
string
nullable
devatas
Array<string>
nullable
coverage
nullable
entrance
object
side
string
nullable
position
number
nullable
pada
string
nullable
devata
string
nullable
devataMayamata
string
nullable
effect
string
nullable
verdict
string
nullable
source
string
nullable
edgeDistance
number
nullable
method
string
nullable
at
object
x
number
nullable
y
number
nullable
wallFraction
number
nullable
from
string
nullable
bearing
number
nullable
sector32
object
index
number
nullable
centre
number
nullable
from
number
nullable
to
number
nullable
findings
Array<object>
nullable
object
priority
number
nullable
level
string
nullable
basis
string
nullable
subject
object
kind
string
nullable
index
number
nullable
type
string
nullable
label
nullable
placement
string
nullable
text
string
nullable
source
string
nullable
remedies
Array<object>
nullable
object
id
string
nullable
effort
string
nullable
reversible
boolean
nullable
basis
string
nullable
source
string
nullable
action
string
nullable
reason
string
nullable
scoreVersion
number
nullable
score
number
nullable
band
string
nullable
scoring
object
points
object
ideal
number
nullable
acceptable
number
nullable
caution
number
nullable
avoid
number
nullable
weights
object
classical
number
nullable
convention
number
nullable
importance
object
kitchen
number
nullable
stove
number
nullable
master-bedroom
number
nullable
toilet
number
nullable
entrance
number
nullable
puja-room
number
nullable
staircase
number
nullable
well
number
nullable
underground-water-tank
number
nullable
septic-tank
number
nullable
overhead-tank
number
nullable
other
number
nullable
shape
number
nullable
bands
Array<object>
nullable
object
band
string
nullable
from
number
nullable
formula
string
nullable
warnings
Array
nullable
notes
Array<string>
nullable
Example
{
"ok": true,
"data": {
"language": "uk",
"requestedLanguage": "uk",
"school": "brihat-samhita",
"coords": {
"system": "metric",
"units": "m"
},
"north": {
"northAngle": 0,
"northReference": "true",
"declination": null,
"trueNorthAngle": 0
},
"centres": {
"grid": {
"x": 6,
"y": 4.5
},
"area": {
"x": 6,
"y": 4.5,
"insideContour": true
}
},
"mandala": {
"wallAngle": 0,
"sides": {
"N": {
"normalBearing": 0
},
"E": {
"normalBearing": 90
},
"S": {
"normalBearing": 180
},
"W": {
"normalBearing": 270
}
},
"orientation": "row 0 is the N side, col 0 the W side, as in /vastu/mandala"
},
"brahmasthan": {
"from": "grid",
"cells": [
[
3,
3
],
[
3,
4
]
]
},
"shape": {
"rectangular": true,
"fill": 1,
"proportion": {
"ratio": 1.333333,
"listed": false,
"source": "Mayamata 2.10-14: square, or length over breadth by 1/8, 1/6 or 1/4"
},
"offsetFromCardinal": 0,
"findings": []
},
"cells": [
{
"row": 7,
"col": 7,
"ring": "middle",
"devatas": [
"Sāvitra"
],
"outsideContour": false
}
],
"rooms": [
{
"type": "kitchen",
"label": null,
"placement": "SE",
"verdict": "ideal",
"basis": "classical",
"ideal": [
"SE"
],
"source": "Brihat Samhita, tr. N. Chidambaram Iyer (1884) 53.118: kitchen in the south-east. NW as second choice and N as avoided (fire against water) are modern practice",
"at": {
"x": 10,
"y": 1.5
},
"from": "grid",
"bearing": 126.869898,
"direction": "SE",
"sector16": "SE",
"sector32": {
"index": 11,
"centre": 123.75,
"from": 118.125,
"to": 129.375
},
"cell": {
"row": 7,
"col": 7,
"ring": "middle",
"devatas": [
"Sāvitra"
]
},
"coverage": {
"SE": 0.903,
"E": 0.098
}
},
{
"type": "master-bedroom",
"label": null,
"placement": "SW",
"verdict": "ideal",
"basis": "convention",
"ideal": [
"SW"
],
"source": "Modern practice; no verse places bedrooms",
"at": {
"x": 2,
"y": 2
},
"from": "grid",
"bearing": 237.994617,
"direction": "SW",
"sector16": "WSW",
"sector32": {
"index": 21,
"centre": 236.25,
"from": 230.625,
"to": 241.875
},
"cell": {
"row": 7,
"col": 1,
"ring": "middle",
"devatas": [
"Jaya"
]
},
"coverage": {
"SW": 0.711,
"W": 0.289
}
}
],
"items": [
{
"type": "toilet",
"label": null,
"placement": "NE",
"verdict": "avoid",
"basis": "convention",
"ideal": [],
"source": "Modern practice. Writers agree on never NE and never the centre, and split on where it should go (NW and W against the MahaVastu SSW and WNW), so no direction is marked ideal",
"rule": "toilet",
"at": {
"x": 11,
"y": 8
},
"from": "grid",
"bearing": 55.00798,
"direction": "NE",
"sector16": "NE",
"sector32": {
"index": 5,
"centre": 56.25,
"from": 50.625,
"to": 61.875
},
"cell": {
"row": 1,
"col": 8,
"ring": "outer",
"devatas": [
"Parjanya"
]
},
"coverage": null
}
],
"entrance": {
"side": "E",
"position": 3,
"pada": "E3",
"devata": "Jayanta",
"devataMayamata": "Jayanta",
"effect": "Great wealth.",
"verdict": "auspicious",
"source": "Brihat Samhita, tr. N. Chidambaram Iyer (1884) 53.72",
"edgeDistance": 0.041667,
"method": "eight-per-side",
"at": {
"x": 12,
"y": 6
},
"wallFraction": 0.333333,
"from": "grid",
"bearing": 75.963757,
"sector32": {
"index": 7,
"centre": 78.75,
"from": 73.125,
"to": 84.375
}
},
"findings": [
{
"priority": 1,
"level": "avoid",
"basis": "convention",
"subject": {
"kind": "item",
"index": 0,
"type": "toilet",
"label": null,
"placement": "NE"
},
"text": "Вбиральня: північний схід, небажано.",
"source": "Modern practice. Writers agree on never NE and never the centre, and split on where it should go (NW and W against the MahaVastu SSW and WNW), so no direction is marked ideal",
"remedies": [
{
"id": "toilet-closed-dry",
"effort": "easy",
"reversible": true,
"basis": "convention",
"source": "Modern practice; no verse prescribes it",
"action": "Тримайте двері вбиральні зачиненими, кришку опущеною, а приміщення сухим, провітреним і чистим.",
"reason": "Звичайна сучасна порада для вбиральні, яку не можна перенести."
}
]
},
{
"priority": 2,
"level": "ideal",
"basis": "classical",
"subject": {
"kind": "entrance",
"pada": "E3"
},
"text": "Головні двері в паді E3: ідеально. Наслідок за віршем: Велике багатство.",
"source": "Brihat Samhita, tr. N. Chidambaram Iyer (1884) 53.72",
"remedies": []
}
],
"scoreVersion": 2,
"score": 83,
"band": "good",
"scoring": {
"points": {
"ideal": 1,
"acceptable": 0.5,
"caution": 0.25,
"avoid": 0
},
"weights": {
"classical": 2,
"convention": 1
},
"importance": {
"kitchen": 3,
"stove": 3,
"master-bedroom": 3,
"toilet": 3,
"entrance": 3,
"puja-room": 2,
"staircase": 2,
"well": 2,
"underground-water-tank": 2,
"septic-tank": 2,
"overhead-tank": 2,
"other": 1,
"shape": 1
},
"bands": [
{
"band": "excellent",
"from": 90
},
{
"band": "good",
"from": 75
},
{
"band": "fair",
"from": 60
},
{
"band": "weak",
"from": 40
},
{
"band": "poor",
"from": 0
}
],
"formula": "round(100 * sum(importance * weight * points) / sum(importance * weight)) over findings; null when there are none"
},
"warnings": [],
"notes": [
"Bearings are read from the centre of the mandala rectangle (centres.grid), the smallest rectangle aligned with the walls; centres.area is the centroid of the outline."
]
}
}

Validation error

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_INPUT",
"message": "Validation failed: date: Date must be YYYY-MM-DD",
"details": [
{
"path": "date",
"message": "Date must be YYYY-MM-DD"
}
]
}
}

Missing or invalid API key

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
}