Western Aspect Grid
Calculate all active aspects between any set of planetary positions. Provide a dictionary of body names to tropical ecliptic longitudes. Uses standard modern Western orbs by default: major aspects 5°, sextile 3°, minor aspects 1.5°. Custom orbs can be provided per aspect type.
Endpoint
POST /v1/western/aspects
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| positions | object | Yes | Dictionary of body name to tropical ecliptic longitude (0-360). Example: {"Sun": 229.6, "Moon": 221.8, "Mars": 189.6} |
| orbs | object | null | No | Custom orbs per aspect type. If omitted, uses standard modern Western orbs: major=5°, sextile=3°, minor=1.5° |
Example request
- curl
- Python
- TypeScript
curl -X POST "https://api.asterwise.com/v1/western/aspects" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"positions":{"Sun":229.6,"Moon":221.8,"Mars":189.6}}'
import asterwise
from asterwise.api.western_astrology_api import WesternAstrologyApi
from asterwise.models.western_aspects_request import WesternAspectsRequest
configuration = asterwise.Configuration(
host="https://api.asterwise.com",
access_token="YOUR_API_KEY",
)
request = WesternAspectsRequest(
positions={'Sun': 229.6, 'Moon': 221.8, 'Mars': 189.6},
)
with asterwise.ApiClient(configuration) as client:
api = WesternAstrologyApi(client)
result = api.western_aspects(western_aspects_request=request)
print(result)
import { createClient, createConfig, westernAspects } from 'asterwise';
const client = createClient(createConfig({
baseUrl: 'https://api.asterwise.com',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
}));
const result = await westernAspects({
client,
body: {
"positions": {
"Sun": 229.6,
"Moon": 221.8,
"Mars": 189.6
}
},
});
console.log(result.data);
Example response
Response fields
| Field | Type | Description |
|---|---|---|
| success | boolean | True if the request succeeded |
| message | string | Human-readable status message |
| data | object | |
| data.aspects | array[object] | All active aspects between the provided bodies |
| data.aspects[].planet_a | string | |
| data.aspects[].planet_b | string | |
| data.aspects[].type | string | Aspect type: conjunction | opposition | trine | square | sextile | semisextile | semisquare | sesquiquadrate | quincunx |
| data.aspects[].exact_angle | number | Actual angular distance between planets |
| data.aspects[].orb | number | Difference from exact aspect angle (always positive) |
| data.aspects[].is_applying | boolean | True if the faster planet is moving toward exact aspect (orb decreasing). |
| data.orbs_used | object | Orb values used for this calculation |
| data.body_count | integer | Number of bodies provided |
| data.aspect_count | integer | Number of aspects found |
Errors
| Code | Description | Reference |
|---|---|---|
| authentication_failed | Missing or invalid API key. | authentication_failed |
| ephemeris_unavailable | Upstream ephemeris service error. | ephemeris_unavailable |
| insufficient_tier | API key tier does not include this endpoint. | insufficient_tier |
| internal_error | Unexpected server error. | internal_error |
| ip_rate_limit_exceeded | Too many requests in a short window. | ip_rate_limit_exceeded |
| payload_too_large | Request body exceeds the size limit. | payload_too_large |
| resource_not_found | Referenced resource was not found. | resource_not_found |
| validation_error | Request body failed schema validation. | validation_error |