/v1/acg-near
API-Key noetig Kartografie ACG-Linien nach Naehe zu einem Ort: welche Linien wie nah liegen (km).
Beschreibung
Serverseitige Entsprechung der Ort→Linie-Distanz (bisher nur clientseitig, turf.js). Baut dieselben Linien wie /v1/acg-lines (Achsen MC/IC/AC/DC, optional Aspektlinien) und liefert je Linie die kleinste Grosskreis-Distanz in km zum angegebenen Ort — aufsteigend sortiert, optional per max_km begrenzt. Distanz per Cross-/Along-Track auf der Segment-Geometrie (mittlerer Erdradius 6371.0088 km).
Parameter
| Name | In | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
birth |
body | object | ja | {datetime, timezone, location{latitude, longitude}}. |
location |
body | object | ja | {latitude, longitude} — der zu bewertende Ort. |
bodies |
body | array | nein | Max. 16. Default: Sonne..Pluto + Chiron + true_node. |
line_types |
body | array | nein | Teilmenge von ["mc","ic","ac","dc"]. Default alle. |
aspects |
body | object | nein | {angles:[60,90,120,…], targets:["mc","ac",…]} — Aspektlinien werden mitbewertet. |
max_km |
body | number | nein | Nur Linien mit Distanz ≤ max_km. Default: alle. |
step_degrees |
body | number | nein | Kurven-Aufloesung (0.1..2). Default 0.5. |
Beispiel-Aufruf
curl -sS \
-H "X-API-Key: ak_test_<DEIN_KEY>" \
-H "Content-Type: application/json" \
-X POST \
-d '{
"birth": {
"datetime": "1987-06-21T04:30:00",
"timezone": "Europe/Berlin",
"location": {
"latitude": 48.137,
"longitude": 11.575
}
},
"location": {
"latitude": 52.52,
"longitude": 13.405
},
"bodies": [
"sun",
"venus",
"mars"
],
"max_km": 500
}' \
"https://astroapi.services/v1/acg-near"
<?php
$ch = curl_init("https://astroapi.services/v1/acg-near");
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, '{"birth":{"datetime":"1987-06-21T04:30:00","timezone":"Europe/Berlin","location":{"latitude":48.137,"longitude":11.575}},"location":{"latitude":52.52,"longitude":13.405},"bodies":["sun","venus","mars"],"max_km":500}');
$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->acgNear([
'birth' => [
'datetime' => '1987-06-21T04:30:00',
'timezone' => 'Europe/Berlin',
'location' => [
'latitude' => 48.137,
'longitude' => 11.575,
],
],
'location' => [
'latitude' => 52.52,
'longitude' => 13.405,
],
'bodies' => [
'sun',
'venus',
'mars',
],
'max_km' => 500,
]);
print_r($response);
const response = await fetch('https://astroapi.services/v1/acg-near', {
method: 'POST',
headers: { 'X-API-Key': 'ak_test_<DEIN_KEY>', 'Content-Type': 'application/json' },
body: JSON.stringify({
"birth": {
"datetime": "1987-06-21T04:30:00",
"timezone": "Europe/Berlin",
"location": {
"latitude": 48.137,
"longitude": 11.575
}
},
"location": {
"latitude": 52.52,
"longitude": 13.405
},
"bodies": [
"sun",
"venus",
"mars"
],
"max_km": 500
}),
});
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.acgNear({
"birth": {
"datetime": "1987-06-21T04:30:00",
"timezone": "Europe/Berlin",
"location": {
"latitude": 48.137,
"longitude": 11.575
}
},
"location": {
"latitude": 52.52,
"longitude": 13.405
},
"bodies": [
"sun",
"venus",
"mars"
],
"max_km": 500
});
console.log(response);
import requests
url = 'https://astroapi.services/v1/acg-near'
headers = {'X-API-Key': 'ak_test_<DEIN_KEY>'}
payload = {
"birth": {
"datetime": "1987-06-21T04:30:00",
"timezone": "Europe/Berlin",
"location": {
"latitude": 48.137,
"longitude": 11.575
}
},
"location": {
"latitude": 52.52,
"longitude": 13.405
},
"bodies": [
"sun",
"venus",
"mars"
],
"max_km": 500
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
from astroapi_client import AstroApiClient
api = AstroApiClient('ak_test_<DEIN_KEY>')
response = api.acg_near({
'birth': {
'datetime': '1987-06-21T04:30:00',
'timezone': 'Europe/Berlin',
'location': {
'latitude': 48.137,
'longitude': 11.575,
},
},
'location': {
'latitude': 52.52,
'longitude': 13.405,
},
'bodies': [
'sun',
'venus',
'mars',
],
'max_km': 500,
})
print(response)