# API für Synastrie und Kompatibilität

Vollständige Endpunkt-Sammlung zur Analyse der Kompatibilität zwischen Menschen – von klassischer Synastrie bis zu Gruppenmatrizen für 10 Personen.

## Was wird berechnet

- **Kreuz-Aspekte** – Aspekte zwischen den Planeten zweier Geburtskarten (z. B. Sonne-Venus-Trigon, Mond-Mars-Quadrat usw.)
- **Kompatibilitäts-Score** – numerischer Score von 0–100 mit Label (harmonisch, ausgewogen, gemischt, herausfordernd)
- **Harmonie/Spannung** – gewichtete Summe harmonischer und angespannter Aspekte
- **Kompositkarte** – Mittelpunkte zwischen den Planeten zweier Menschen
- **Davison-Karte** – Karte mit durchschnittlichem Datum und Koordinaten
- **Gruppenmatrix** – paarweise Kompatibilität jeder mit jedem (2–10 Personen)

## Endpunkte

| Endpunkt | Credits | Rückgabe |
|---|---|---|
| `/v1/synastry` | 50 | Kreuz-Aspekte + Kompatibilitäts-Score |
| `/v1/composite` | 50 | Kompositkarte (Mittelpunkte) |
| `/v1/davison` | 50 | Davison-Karte (Durchschnittsdatum) |
| `/v1/coalescent` | 50 | Koaleszentkarte |
| `/v1/group-synastry` | 100 | Kompatibilitätsmatrix für 2–10 Personen |
| `/v1/human-design/compatibility` | 100 | HD-Kompatibilität |

## Beispiel

<Tabs>
  <TabItem label="cURL">
    ```bash frame="terminal"
    curl -X POST https://api.astroway.info/v1/synastry \
      -H "X-Api-Key: aw_live_your_key_here" \
      -H "Content-Type: application/json" \
      -d '{
        "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
        }
      }'
    ```
  </TabItem>
  <TabItem label="Node.js">
    ```ts
    const r = await fetch('https://api.astroway.info/v1/synastry', {
      method: 'POST',
      headers: {
        'X-Api-Key': process.env.ASTROWAY_API_KEY!,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        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 },
      }),
    });
    const { data: result } = await r.json();

    console.log(`Score: ${result.compatibility.score}/100`);
    console.log(`Label: ${result.compatibility.label}`);
    ```
  </TabItem>
  <TabItem label="Python">
    ```python

    r = requests.post(
        'https://api.astroway.info/v1/synastry',
        headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'},
        json={
            '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},
        },
    )
    result = r.json()['data']
    print(f"Score: {result['compatibility']['score']}/100 ({result['compatibility']['label']})")
    ```
  </TabItem>
  <TabItem label="PHP">
    ```php
    <?php
    use GuzzleHttp\Client;

    $aw = new Client(['base_uri' => 'https://api.astroway.info/v1/']);
    $r = $aw->post('synastry', [
        'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')],
        'json' => [
            '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],
        ],
    ]);
    $result = json_decode($r->getBody(), true)['data'];
    echo "Score: {$result['compatibility']['score']}/100 ({$result['compatibility']['label']})\n";
    ```
  </TabItem>
</Tabs>

## Beispielantwort (Kompatibilität)

```json
{
  "compatibility": {
    "score": 72,
    "label": "harmonious",
    "harmony": 18.5,
    "tension": 7.2
  }
}
```

## Anwendungsfälle

### Dating-Apps

Aufruf von `/v1/synastry` beim Match – der Kompatibilitäts-Score als zusätzlicher Ranking-Faktor. Zwischenspeichern des Ergebnisses für ein Paar (gleiche Eingabe = gleiches Ergebnis).

### Astrologie-Apps

Vollständige Analyse: Synastrie + Komposit + Davison. Drei Anfragen – 150 Credits, vollständiges Bild der Beziehung.

### Team-Tools

`/v1/group-synastry` mit 5 Personen – Matrix aus 10 Paaren in einer Anfrage (100 Credits statt 500 einzelne).

## Kosten

Synastrie kostet **50 Credits**. Im Free-Tarif sind 200 Synastrie-Analysen pro Monat kostenlos.

<CardGrid>
  <LinkCard title="Ausführliches Beispiel →" href="/examples/synastry/" description="Parameter, Antwort, Kreuz-Aspekte" />
  <LinkCard title="Schnellstart" href="/getting-started/" description="Erste Anfrage in 5 Minuten" />
  <LinkCard title="Tarife" href="/pricing/" description="Von Free bis Enterprise" />
</CardGrid>
