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:
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign?page[size]=20" \
-H "X-Api-Key: your-api-key"Contenttypes
| Type | Beschrijving |
|---|---|
planet-in-sign | Planeetplaatsing in dierenriemteken |
planet-in-house | Planeetplaatsing in huis |
aspect | Aspect tussen twee planeten |
transit | Transitinterpretatie |
synastry | Synastrie-aspectinterpretatie |
Horoscooptypes
| Type | Beschrijving |
|---|---|
natal | Geboortehoroscoopinterpretaties |
transit | Transitinterpretaties |
synastry | Synastrie-interpretaties |
composite | Composiethoroscoopinterpretaties |
chinese-horoscope | Chinese horoscoopinterpretaties |
chinese-forecast | Chinese jaarvoorspellingsinterpretaties |
numerology | Numerologie-interpretaties |
moon-sun | Maan- en zoninterpretaties |
moon-calendar | Maankalenderinterpretaties |
retrograde | Retrograde-periode-interpretaties |
progression | Secundaire progressie-interpretaties |
horoscope | Algemene horoscoopinterpretaties |
Ophalen op ID
curl -X GET "https://api.astroapi.cloud/api/content/natal/planet-in-sign/abc123" \
-H "X-Api-Key: your-api-key"Response
{
"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
import { marked } from "marked";
const html = marked.parse(content.body);Of met markdown-it:
import MarkdownIt from "markdown-it";
const md = new MarkdownIt();
const html = md.render(content.body);Python
import markdown
html = markdown.markdown(content["body"])PHP
use League\CommonMark\CommonMarkConverter;
$converter = new CommonMarkConverter();
$html = $converter->convert($content['body']);Filteren op titel
Zoek content op titel met de filter queryparameter:
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:
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:
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.