🕓 Recorded 2026-04-14, updated 2026-05-09. TS / Python / PHP SDKs are now live on public registries -
@astroway/sdk(npm),astroway(PyPI),astroway/sdk(Packagist). Details in changelog.
You want to calculate a natal chart from code. Here’s the fastest path - under 5 minutes from nothing to working JSON.
Step 1: Get an API key (30 seconds)
Section titled “Step 1: Get an API key (30 seconds)”Register at api.astroway.info/dashboard/sign-up. Free plan: 10,000 credits/month. No credit card.
In the dashboard, click “Create key” → “Production” → copy it. Keys look like aw_live_aB3xY7pQ9rN2mK4jH8vC5tL6wZ1fD0eR.
Tip: There are also aw_test_ sandbox keys that don’t consume credits. Use them for development.
Step 2: Install the SDK
Section titled “Step 2: Install the SDK”TypeScript
Section titled “TypeScript”npm install @astroway/sdkPython
Section titled “Python”pip install astrowayBoth SDKs cover all 777 endpoints with typed requests and responses.
Step 3: Your first natal chart
Section titled “Step 3: Your first natal chart”TypeScript
Section titled “TypeScript”import { Astroway } from '@astroway/sdk';
const aw = new Astroway({ apiKey: process.env.ASTROWAY_API_KEY!,});
const chart = await aw.chart.compute({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, // UTC+3 for Kyiv summer latitude: 50.4501, longitude: 30.5234, houseSystem: 'P', // Placidus});
const SIGNS = ['Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'];
const sun = chart.planets.find((p) => p.name === 'Sun')!;console.log(`Sun: ${SIGNS[Math.floor(sun.longitude / 30)]} at ${sun.longitude.toFixed(2)}°`);console.log(`ASC: ${chart.houses.ascendant.toFixed(2)}°`);console.log(`Aspects: ${chart.aspects.length}`);Run it:
ASTROWAY_API_KEY=aw_live_... npx tsx chart.tsThe file uses top-level await, so your package.json needs "type": "module". Without it tsx fails with Top-level await is currently not supported with the "cjs" output format.
Python
Section titled “Python”from astroway import Astroway, BirthData
aw = Astroway(api_key="aw_live_your_key_here")
chart = aw.chart.compute(BirthData( date="1990-07-14", time="14:30:00", timezone_offset=3, latitude=50.4501, longitude=30.5234, house_system="P",))
SIGNS = ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"]
sun = next(p for p in chart["planets"] if p["name"] == "Sun")print(f"Sun: {SIGNS[int(sun['longitude'] // 30)]} at {sun['longitude']:.2f}°")print(f"ASC: {chart['houses']['ascendant']:.2f}°")print(f"Aspects: {len(chart['aspects'])}")Run it:
ASTROWAY_API_KEY=aw_live_... python3 chart.pyUnderstanding the response
Section titled “Understanding the response”You get back a JSON object with four main parts:
planets
Section titled “planets”Array of 13 objects. name carries the Swiss Ephemeris label for the body: Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, true Node (the North Node), mean Apogee (Lilith), Chiron.
{ "id": 0, "name": "Sun", "longitude": 354.702, // ecliptic longitude in degrees "latitude": -0.00016, "distance": 0.9945, // in astronomical units "speedLong": 0.9971, // degrees per day (negative = retrograde) "speedLat": 0.00003, "speedDist": 0.00019, "isRetrograde": false, "declination": -1.4159, "rightAscension": 355.437}Sign and house are not returned here: derive the sign as Math.floor(longitude / 30), and the house from the cusps in houses.
houses
Section titled “houses”House cusps (12 of them), plus ascendant and MC:
{ "system": "P", "cusps": [118.18, 138.27, ...], // 12 values "ascendant": 118.18, "mc": 12.708, "armc": 11.69, "vertex": 253.97, "equatorialAsc": 100.75, "coAscWK": 81.13, "coAscMunkasey": 123.7, "polarAsc": 261.13}aspects
Section titled “aspects”Array of aspects between planets:
{ "planet1": "Sun", "planet2": "Mercury", "planet1Id": 0, "planet2Id": 2, "type": { // an object, not a string "name": "Conjunction", "i18nKey": "aspect_conjunction", "angle": 0, "orb": 12, "symbol": "☌", "isMajor": true, "color": "#660480" }, "exactAngle": 3.365, "orb": 3.365, // deviation from exact in degrees "isApplying": true}chartSect
Section titled “chartSect”"diurnal" (Sun above horizon at birth) or "nocturnal" (below). Used in classical astrology.
Next steps
Section titled “Next steps”What to try next:
Synastry: compatibility between two people:
const synastry = await client.synastry({ chart1: { date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.45, longitude: 30.52 }, chart2: { date: '1992-03-22', time: '09:15:00', timezoneOffset: 2, latitude: 48.85, longitude: 2.35 },});console.log(`Compatibility score: ${synastry.compatibility.score}/100`);Current transits on a natal chart:
const transits = await client.transits({ // birth data date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234, // transit date transitDate: '2026-04-14',});Daily horoscope generated from real transits:
const horoscope = await client.horoscopeDaily({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234,});console.log(horoscope.text);Full Human Design chart:
const hd = await client.humanDesign({ date: '1990-07-14', time: '14:30:00', timezoneOffset: 3, latitude: 50.4501, longitude: 30.5234,});console.log(`${hd.type} - ${hd.strategy} - Profile ${hd.profile}`);Credit costs
Section titled “Credit costs”- Natal chart (
/chart): 20 credits - Synastry: 50 credits
- Transits: 50 credits
- Daily horoscope: 20 credits
- Human Design: 50 credits
Free plan: 10,000 credits/month = 500 natal charts, or 200 synastries, or mixed workload.
Error handling
Section titled “Error handling”Every response includes credit headers:
X-Credits-Used: 20X-Credits-Remaining: 4980X-Credits-Reset: 2026-05-01T00:00:00ZWhen credits run out you get 402 Payment Required. When rate limit hits (Free: 10 req/min), 429 Too Many Requests with Retry-After header.
SDK throws typed errors you can catch:
import { QuotaExceededError, RateLimitError } from '@astroway/sdk';
try { const chart = await aw.chart.compute(birth);} catch (err) { if (err instanceof QuotaExceededError) { console.log('Upgrade plan or wait for reset'); } else if (err instanceof RateLimitError) { console.log(`Retry in ${err.retryAfterSeconds ?? 60} seconds`); } else { throw err; }}Catch order runs from specific to general: they all extend ApiError, so testing for that first swallows the rest.
That’s it
Section titled “That’s it”You now have:
- A working API key
- SDK installed
- First natal chart
- Enough patterns to add synastry, transits, horoscopes
Next reading:
- Full getting started guide: more detail
- Example: Natal chart: deeper walkthrough
- API reference: all 777 endpoints
Same Swiss Ephemeris as Solar Fire - but in 4 lines of code.
Free key, no card. 5,000 calls/month before you pay anything.