Skip to content

Content & Interpretaties

Krijg toegang tot de uitgebreide bibliotheek van astrologische interpretaties.

Overzicht

De Content API biedt toegang tot interpretatieteksten voor:

  • Planeet in teken-plaatsingen
  • Planeet in huis-plaatsingen
  • Aspecten tussen planeten
  • Transitinterpretaties
  • Synastrie-interpretaties

Content opvragen

Vraag content op per horoscooptype en contenttype:

bash
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign?page[size]=20" \
  -H "X-Api-Key: your-api-key"

Contenttypes

TypeBeschrijving
planet-in-signPlaneetplaatsing in dierenriemteken
planet-in-housePlaneetplaatsing in huis
aspectAspect tussen twee planeten
transitTransitinterpretatie
synastrySynastrie-aspectinterpretatie

Horoscooptypes

TypeBeschrijving
natalGeboortehoroscoopinterpretaties
transitTransitinterpretaties
synastrySynastrie-interpretaties
compositeComposiethoroscoopinterpretaties
chinese-horoscopeChinese horoscoopinterpretaties
chinese-forecastChinese jaarvoorspellingsinterpretaties
numerologyNumerologie-interpretaties
moon-sunMaan- en zoninterpretaties
moon-calendarMaankalenderinterpretaties
retrogradeRetrograde-periode-interpretaties
progressionSecundaire progressie-interpretaties
horoscopeAlgemene horoscoopinterpretaties

Ophalen op ID

bash
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign/abc123" \
  -H "X-Api-Key: your-api-key"

Response

json
{
  "data": {
    "type": "content",
    "id": "abc123",
    "attributes": {
      "title": "Sun in Gemini",
      "body": "With your Sun in Gemini, you possess a quick, curious mind...",
      "urn": "urn:content:1:natal:planet-in-sign:sun:gemini:en"
    }
  }
}

Markdown-formaat

Het body-veld in contentresponses is opgemaakt als Markdown. Dit maakt rijke tekstopmaak mogelijk, inclusief koppen, vetgedrukte/cursieve tekst, lijsten en meer.

Als u de content als HTML in uw toepassing wilt weergeven, moet u de Markdown naar HTML converteren met een markdown-parserbibliotheek.

JavaScript/TypeScript

javascript
import { marked } from "marked";

const html = marked.parse(content.body);

Of met markdown-it:

javascript
import MarkdownIt from "markdown-it";

const md = new MarkdownIt();
const html = md.render(content.body);

Python

python
import markdown

html = markdown.markdown(content["body"])

PHP

php
use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter();
$html = $converter->convert($content['body']);

Filteren op titel

Zoek content op titel met de filter queryparameter:

bash
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign?filter=title:*sun*" \
  -H "X-Api-Key: your-api-key"

Interpretaties opnemen bij berekeningen

De aanbevolen manier om interpretatieteksten te verkrijgen is ze direct bij uw berekeningsverzoeken op te nemen met de includeText-parameter:

bash
curl -X POST "https://api.astroapi.cloud/api/calc/natal" \
  -H "X-Api-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "dateTime": "1990-06-15T14:30",
    "location": {
      "latitude": 51.5074,
      "longitude": -0.1278,
      "timezone": "Europe/London"
    },
    "includeText": true,
    "language": "en"
  }'

Dit verrijkt uw berekeningsresponse met interpretatieteksten voor elke plaatsing en elk aspect.

Paginering

Gebruik JSON:API pagineringsparameters:

bash
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign?page[size]=10&page[number]=0" \
  -H "X-Api-Key: your-api-key"

De response bevat een links.next-URL voor de volgende pagina met resultaten.

AstroAPI Documentation