Building an Astrology App
This guide covers the most common Asterwise integration patterns for consumer astrology apps — daily horoscopes, natal charts, and dasha timelines.
Daily horoscope feed
The simplest integration — no birth data required. Serve Moon-sign horoscopes using the GET endpoints:
curl -X GET \
"https://api.asterwise.com/v1/horoscope/daily/libra" \
-H "Authorization: Bearer YOUR_API_KEY"
Content is pre-generated and served from the database — response time is under 100ms. Generate horoscopes for all 12 signs and cache them client-side for the day.
Natal chart with SVG
For personalised chart display, use two endpoints together:
# 1. Get chart data (planets, houses, aspects)
curl -X POST https://api.asterwise.com/v1/astro/natal \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "1985-11-12",
"time": "06:45",
"lat": 19.0760,
"lon": 72.8777,
"timezone": "Asia/Kolkata"
}'
# 2. Get rendered SVG charts
curl -X POST https://api.asterwise.com/v1/astro/chart \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "1985-11-12",
"time": "06:45",
"lat": 19.0760,
"lon": 72.8777,
"timezone": "Asia/Kolkata"
}'
The chart endpoint returns lagna_north, lagna_south,
navamsa_north, navamsa_south as inline SVG strings.
Render them with dangerouslySetInnerHTML in React or v-html in Vue.
Dasha timeline
Show the user's active and upcoming planetary periods:
curl -X POST https://api.asterwise.com/v1/astro/dasha \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"date": "1985-11-12",
"time": "06:45",
"lat": 19.0760,
"lon": 72.8777,
"timezone": "Asia/Kolkata",
"levels": 2
}'
Use levels: 2 for Mahadasha + Antardasha. Use levels: 3 for
Pratyantar. The response includes current_mahadasha and
current_antardasha so you can highlight the active period.
Recommended integration order
| Feature | Endpoint |
|---|---|
| Sign horoscope | GET /v1/horoscope/daily/{moon_sign} |
| Natal chart data | POST /v1/astro/natal |
| Chart SVG | POST /v1/astro/chart |
| Dasha timeline | POST /v1/astro/dasha |
| Yogas | POST /v1/astro/yoga |
| Doshas | POST /v1/astro/dosha |
| Transit analysis | POST /v1/astro/gochar |