/v1/lunar-phases
API-Key noetig Berechnung Mondphasen: aktuelle Phase oder alle Phasenwechsel im Fenster.
Beschreibung
Phasenwinkel = (lon_moon - lon_sun) mod 360°. Vier Hauptphasen: 0° = new_moon, 90° = first_quarter, 180° = full_moon, 270° = last_quarter. Zwei Modi: "at" → Snapshot mit aktueller Phase, Beleuchtung und naechstem Hauptevent. "start"+"end" → Window mit allen Hauptphasen-Events im Zeitraum (max 365 Tage). Beleuchtungsanteil = (1 - cos(angle)) / 2.
Parameter
| Name | In | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
at |
body | string | nein | Snapshot-Modus: ISO 8601 UTC. Alternative zu "start"+"end". |
start |
body | string | nein | Window-Modus: Beginn des Fensters (ISO 8601 UTC). |
end |
body | string | nein | Window-Modus: Ende des Fensters (ISO 8601 UTC). Maximal 365 Tage nach "start". |
step_days |
body | number | nein | Abtast-Schrittweite fuer die Suche im Window-Modus. Default 0.5, Range 0.05-2.0. |
Beispiel-Aufruf
curl -sS \
-H "X-API-Key: ak_test_<DEIN_KEY>" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"start": "2026-04-01T00:00:00Z",
"end": "2026-05-01T00:00:00Z"
}' \
"https://astroapi.services/v1/lunar-phases"
<?php
$ch = curl_init("https://astroapi.services/v1/lunar-phases");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: ak_test_<DEIN_KEY>", "Content-Type: application/json"]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"start":"2026-04-01T00:00:00Z","end":"2026-05-01T00:00:00Z"}');
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
<?php
require 'astroapi-client.php';
$api = new AstroApiClient('ak_test_<DEIN_KEY>');
$response = $api->lunarPhases([
'start' => '2026-04-01T00:00:00Z',
'end' => '2026-05-01T00:00:00Z',
]);
print_r($response);
const response = await fetch('https://astroapi.services/v1/lunar-phases', {
method: 'POST',
headers: { 'X-API-Key': 'ak_test_<DEIN_KEY>', 'Content-Type': 'application/json' },
body: JSON.stringify({
"start": "2026-04-01T00:00:00Z",
"end": "2026-05-01T00:00:00Z"
}),
});
const data = await response.json();
console.log(data);
import { AstroApiClient } from './astroapi-client.js';
const api = new AstroApiClient('ak_test_<DEIN_KEY>');
const response = await api.lunarPhases({
"start": "2026-04-01T00:00:00Z",
"end": "2026-05-01T00:00:00Z"
});
console.log(response);
import requests
url = 'https://astroapi.services/v1/lunar-phases'
headers = {'X-API-Key': 'ak_test_<DEIN_KEY>'}
payload = {
"start": "2026-04-01T00:00:00Z",
"end": "2026-05-01T00:00:00Z"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
from astroapi_client import AstroApiClient
api = AstroApiClient('ak_test_<DEIN_KEY>')
response = api.lunar_phases({
'start': '2026-04-01T00:00:00Z',
'end': '2026-05-01T00:00:00Z',
})
print(response)