AstroWay/api v2.180.1 · de
alle Systeme in Ordnung

Schnellstart für Astrologie-API: TypeScript und Python in 5 Minuten

SDK installieren, API-Schlüssel erhalten, ersten Antrag auf eine Geburtshoroskopkarte stellen. 5 Minuten - und ein funktionierendes JSON in der Hand (TypeScript und Python).

🕓 Eintrag vom 2026-04-14, aktualisiert am 2026-05-09. TS / Python / PHP SDK leben jetzt in öffentlichen Registries - @astroway/sdk (npm), astroway (PyPI), astroway/sdk (Packagist). Details im changelog.

Du willst eine Geburtshoroskop aus dem Code berechnen. Hier ist der kürzeste Weg – in 5 Minuten von Null zum funktionierenden JSON.

Schritt 1: Hol dir den API-Schlüssel (30 Sekunden)

Abschnitt betitelt „Schritt 1: Hol dir den API-Schlüssel (30 Sekunden)“

Registriere dich unter api.astroway.info/dashboard/sign-up. Kostenloser Plan: 10 000 Credits / Monat. Ohne Karte.

Im dashboard klicke auf „Create key“ → „Production“ → kopiere. Schlüssel sehen so aus: aw_live_aB3xY7pQ9rN2mK4jH8vC5tL6wZ1fD0eR.

Hinweis: Es gibt auch Sandbox-Schlüssel mit dem Präfix aw_test_ – sie verbrauchen keine Credits. Verwende sie während der Entwicklung.

Terminal-Fenster
npm install @astroway/sdk
Terminal-Fenster
pip install astroway

Beide SDKs decken alle 758 Endpunkte mit typisierten Anfragen und Antworten ab.

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, літо в Києві
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}`);

Führe aus:

Terminal-Fenster
ASTROWAY_API_KEY=aw_live_... npx tsx chart.ts

Die Datei verwendet top-level await, also muss in package.json "type": "module" stehen. Andernfalls fällt tsx mit Top-level await is currently not supported with the "cjs" output format.

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'])}")

Führe aus:

Terminal-Fenster
ASTROWAY_API_KEY=aw_live_... python3 chart.py

Zurück kommt ein JSON-Objekt mit vier Hauptteilen:

Ein Array mit 13 Objekten. In name steht der Körpername aus der Swiss Ephemeris: Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, true Node (Nordknoten), mean Apogee (Lilith), Chiron.

{
"id": 0,
"name": "Sun",
"longitude": 354.702, // еклiптична довгота у градусах
"latitude": -0.00016,
"distance": 0.9945, // в астрономічних одиницях
"speedLong": 0.9971, // градусів на день (від'ємне = ретроград)
"speedLat": 0.00003,
"speedDist": 0.00019,
"isRetrograde": false,
"declination": -1.4159,
"rightAscension": 355.437
}

Zeichen und Haus kommen hier nicht: Berechne das Zeichen mit Math.floor(longitude / 30), und das Haus über die Cusps aus houses.

Haus-Cusps (12 Stück) sowie asc und MC:

{
"system": "P",
"cusps": [118.18, 138.27, ...], // 12 значень
"ascendant": 118.18,
"mc": 12.708,
"armc": 11.69,
"vertex": 253.97,
"equatorialAsc": 100.75,
"coAscWK": 81.13,
"coAscMunkasey": 123.7,
"polarAsc": 261.13
}

Ein Array von Aspekten zwischen den Planeten:

{
"planet1": "Sun",
"planet2": "Mercury",
"planet1Id": 0,
"planet2Id": 2,
"type": { // об'єкт, не рядок
"name": "Conjunction",
"i18nKey": "aspect_conjunction",
"angle": 0,
"orb": 12,
"symbol": "",
"isMajor": true,
"color": "#660480"
},
"exactAngle": 3.365,
"orb": 3.365, // відхилення від точного у градусах
"isApplying": true
}

"diurnal" (Sonne über dem Horizont zum Zeitpunkt der Geburt) oder "nocturnal" (unter dem Horizont). Wird in der klassischen Astrologie verwendet.

Was du noch ausprobieren kannst:

Synastrie: Kompatibilität zweier Personen:

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`);

Aktuelle Transite auf das Geburtshoroskop:

const transits = await client.transits({
// дані народження
date: '1990-07-14', time: '14:30:00', timezoneOffset: 3,
latitude: 50.4501, longitude: 30.5234,
// дата транзиту
transitDate: '2026-04-14',
});

Tägliches Horoskop aus realen Transiten:

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);

Vollständige Human Design Karte:

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}`);
  • Geburtshoroskop (/chart): 20 Credits
  • Synastrie: 50 Credits
  • Transite: 50 Credits
  • Tägliches Horoskop: 20 Credits
  • Human Design: 50 Credits

Kostenloser Plan: 10 000 Credits / Monat = 500 Geburtshoroskope, oder 200 Synastrien, oder gemischte Belastung.

Jede Antwort enthält Header mit Credits:

X-Credits-Used: 20
X-Credits-Remaining: 4980
X-Credits-Reset: 2026-05-01T00:00:00Z

Wenn die Credits aufgebraucht sind – bekommst du 402 Payment Required. Wenn du das Rate-Limit (Free: 10 Anfragen / Min) überschreitest – 429 Too Many Requests mit dem Header Retry-After.

Das SDK wirft typisierte Fehler, die du abfangen kannst:

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;
}
}

Fange sie von spezifisch zu allgemein ab: Sie erben alle von ApiError, sodass die Prüfung darauf zuerst den Rest auffängt.

Jetzt hast du:

  • Funktionsfähigen API-Schlüssel
  • Installiertes SDK
  • Erstes Geburtshoroskop
  • Genug Beispiele, um Synastrie, Transite, Horoskope hinzuzufügen

Weiterlesen:

MakSeong · AstroWay

Ich entwickle das AstroWay API: packe Swiss Ephemeris in reines REST und schreibe über langweilige Details, die eigentlich wichtig sind.

// darauf aufbauen

Derselbe Swiss Ephemeris wie in Solar Fire - in 4 Zeilen Code.

Kostenloser Schlüssel ohne Kreditkarte. 5.000 Aufrufe pro Monat vor der ersten Zahlung.

Mehr aus dem Blog alle Beiträge →

Industry 2026-06-05

Free Astrology API: Which One Has the Best Free Tier in 2026?

A side-by-side of free tiers across the major astrology APIs - credits, request caps, card requirements - and how much you can actually build for free.

Engineering 2026-06-05

Horoscope API Tutorial: Build a Daily Horoscope Feature

Add daily, weekly and monthly horoscopes to your app via API - sign-based text vs transit-based personalization - with TypeScript and Python code.

Engineering 2026-06-05

Natal Chart API in PHP: SDK + Laravel Example

Compute a natal chart in PHP with the AstroWay SDK - plain PHP and a Laravel facade - without compiling a Swiss Ephemeris extension.