FreeAstroAPI LogoFreeAstroAPI
Back to Guides
Integration

AstroSage API: Build an AstroSage-Like Astrology Chat App or Bot

Learn how to build an AstroSage-like astrology chat app or bot with FreeAstroAPI, including Vedic, Western, horoscope, compatibility, Panchang, and chart endpoints.

If you are searching for an AstroSage API, you are usually trying to build one of three products:

  1. An astrology chat app that answers birth chart questions.
  2. A WhatsApp, Telegram, Discord, or website astrology bot.
  3. A full astrology platform with Vedic chart, dasha, Panchang, match making, horoscope, and compatibility features.

FreeAstroAPI is not affiliated with AstroSage. The useful point for builders is architectural: our Vedic and astrology endpoints were calibrated to return production-grade structured results, with quality and coverage suitable for AstroSage-like user experiences.

That means you do not need to make an LLM invent chart math. Use the API for deterministic astrology data, then use your AI layer to explain that data in a conversational voice.

Why an AstroSage-like app needs structured astrology data

Astrology chat products fail when the bot tries to calculate everything from a prompt. The model may sound confident while getting the ascendant, Moon Nakshatra, Vimshottari dasha, Panchang, or compatibility details wrong.

A better production pattern is:

  1. Resolve the user's city, timezone, latitude, and longitude.
  2. Call astrology endpoints for chart, dasha, Panchang, transit, or compatibility data.
  3. Store the structured response as the source of truth.
  4. Let the chat model explain only what the API returned.
  5. Keep citations or internal references to the exact endpoint payload used.

This gives your app the feeling of an intelligent astrology assistant while keeping calculations deterministic and repeatable.

Best endpoints for an AstroSage-style chat app

For an AstroSage-like Vedic bot, start with these endpoints:

Use caseEndpoint
Resolve city inputGET /api/v2/geo/search
Generate a Vedic birth chartPOST /api/v2/vedic/chart
Generate full Vedic data in one requestPOST /api/v2/vedic/calculate
Get Vimshottari dasha periodsPOST /api/v2/vedic/dasha
Get dasha facts for AI interpretationPOST /api/v1/vedic/dasha/insights
Build Gochar timeline featuresPOST /api/v2/vedic/gochar/timeline
Turn Gochar into AI-ready factsPOST /api/v2/vedic/gochar/timeline/insights
Detect yogasPOST /api/v2/vedic/yogas
Calculate Shadbala and AshtakavargaPOST /api/v2/vedic/strength
Generate divisional chartsPOST /api/v2/vedic/vargas
Generate PanchangPOST /api/v2/vedic/panchang
Match two people from birth detailsPOST /api/v2/vedic/match
Run compatibility from birth details or Moon detailsPOST /api/v2/vedic/compatibility

Use POST /api/v2/vedic/calculate when you want one compact onboarding payload. Use the specialized endpoints when a chat turn needs one focused answer, such as "What dasha am I in?" or "Is today good for starting something?"

Recommended MCP chat pipeline

If you are building the app as an AI agent, use the hosted MCP layer or your own tool-calling layer instead of wiring every endpoint directly into the prompt.

The pipeline should look like this:

  1. Analyze the user's question and decide what astrology fact is needed.
  2. Check whether the needed JSON already exists in cache.
  3. If not cached, choose the right MCP tool or API endpoint.
  4. Call the tool with the user's stored birth data and the current question context.
  5. Cache the raw JSON response with the endpoint, input hash, user id, and generated timestamp.
  6. Give the AI the user's question plus only the relevant cached JSON.
  7. Ask the AI to write the final answer from that JSON, without inventing missing chart facts.

In practice, the first AI pass is a router. It should not answer the user yet. It should return a small tool plan:

{
  "intent": "current_dasha_question",
  "needs_tool": true,
  "tool": "vedic_dasha",
  "cache_key": "user_123:vedic_dasha:2026-04-24:lahiri",
  "reason": "The user asked which dasha is active today."
}

Then your backend executes the tool call, stores the JSON, and makes a second AI call to write the user-facing response.

User question:
{question}

Tool JSON:
{cached_or_fresh_json}

Instruction:
Answer only from the Tool JSON. If the JSON does not contain the requested fact, say what additional tool or birth detail is needed.

This design is more reliable than asking the model to decide, calculate, and explain in one pass.

Cache strategy

Cache by user, endpoint, normalized input, and date or date range.

Data typeSuggested cache behavior
Birth chart, vargas, yogas, strengthCache permanently unless birth data changes.
Dasha timelineCache permanently, but recompute active selection for a new reference date when needed.
Panchang, daily horoscope, today pillarsCache per date and location.
Gochar or transit timelineCache by date range, planets, and settings.
Compatibility or matchCache by both user profiles and relationship settings.

Always store the full raw JSON. You can also store a smaller "facts" object for retrieval, but keep the original response for debugging and answer audits.

Follow-up handling

Follow-up messages should reuse context before calling another tool. A good router checks the previous user question, the last tool JSON, and the new message.

Follow-upWhat to do
"Why is that?"Reuse the previous JSON and explain the evidence more clearly.
"What about tomorrow?"Keep the same birth profile, call the date-sensitive Panchang, horoscope, transit, or Gochar endpoint for tomorrow.
"And for my partner?"Ask for the partner's missing birth data, or call compatibility if both profiles are already saved.
"Show me the chart"Call a chart rendering endpoint or render the cached chart data in your UI.
"Explain it more simply"Do not call a new astrology endpoint; rewrite the same answer at a simpler level.
"Use Western astrology instead"Switch systems deliberately and call the relevant Western endpoint.

The key is to separate three things: conversation memory, cached astrology facts, and fresh tool calls. Follow-ups often need memory and cached facts, not another API request.

All public astrology endpoints

These are the main endpoints you can combine when building an astrology assistant, horoscope bot, chart app, or AstroSage-like experience.

Vedic astrology endpoints

MethodPathUse
POST/api/v2/vedic/chartVedic D1 chart with ascendant, planets, houses, Nakshatra context, and metadata.
POST/api/v2/vedic/calculateFull Vedic bundle with optional vargas, dasha, yogas, Panchang, Shadbala, and Ashtakavarga.
POST/api/v2/vedic/dashaCalibrated Vimshottari dasha timeline and active periods.
POST/api/v1/vedic/dasha/insightsAI-ready dasha fact extraction.
POST/api/v2/vedic/gochar/timelineVedic transit and Gochar timeline windows.
POST/api/v2/vedic/gochar/timeline/insightsGochar facts for search, RAG, and chat interpretation.
POST/api/v2/vedic/yogasYoga detection with evidence and strength.
POST/api/v2/vedic/strengthShadbala, Sarvashtakavarga, Bhinnashtakavarga, and strength data.
POST/api/v2/vedic/vargasDivisional charts such as D1, D9, D10, D30, and D60.
POST/api/v2/vedic/panchangTithi, Nakshatra, Yoga, Karana, weekday, Rahu Kalam, sunrise, and sunset.
POST/api/v2/vedic/matchBirth-detail compatibility matching.
POST/api/v2/vedic/compatibilityCompatibility from birth details or manual Moon details.

Western astrology endpoints

MethodPathUse
POST/api/v1/natal/calculateWestern natal chart calculation and optional report job creation.
GET/api/v1/natal/report/{job_id}Poll generated psychological report jobs.
POST/api/v1/western/natal/insightsMachine-readable natal facts for AI products.
POST/api/v1/western/natal/insights/index-documentsSearch-index documents for natal facts.
POST/api/v1/transits/calculateTransit chart calculation.
POST/api/v1/western/transits/timelineLong-range transit-to-natal timeline.
POST/api/v1/western/transits/timeline/index-documentsSearch-index documents for transit timelines.
POST/api/v1/western/transits/insightsHigher-level transit insight windows.
POST/api/v1/western/transits/searchSearch long windows for exact transit passes.
POST/api/v1/western/synastryFull western synastry.
POST/api/v1/western/synastry/simplifiedLighter synastry payload.
POST/api/v1/western/synastry/summarySynastry summary scoring.
POST/api/v1/western/synastrycardsMobile-friendly synastry card output.
POST/api/v1/western/synastry/horoscopeDaily or timing-aware relationship horoscope.
POST/api/v1/western/solar/calculateSolar return calculation.
POST/api/v1/western/returns/calculateGeneric planetary return calculation.
POST/api/v1/western/profections/annualAnnual profection timing.
POST/api/v1/western/progressions/secondarySecondary progressions.
POST/api/v1/western/progressions/converse-secondaryConverse secondary progressions.
POST/api/v1/western/progressions/tertiaryTertiary progressions.
POST/api/v1/western/progressions/quotidianQuotidian progressions.
POST/api/v1/western/progressions/quaternaryQuaternary progressions.
POST/api/v1/western/progressions/{system}/exact-ingressesExact ingress search for progression systems.
POST/api/v1/western/progressions/{system}/exact-aspectsExact aspect search for progression systems.
POST/api/v1/western/progressions/{system}/calendarProgression calendar output.

Chart rendering and visual endpoints

MethodPathUse
POST/api/v1/natal/chart/Render a natal chart SVG or PNG.
POST/api/v1/natal/chart/transitsRender a natal plus transit chart.
POST/api/v1/natal/chart/compositeRender a composite relationship chart.
POST/api/v1/natal/chart/synastryRender a synastry chart.
POST/api/v1/svg/kerykeionKerykeion-compatible SVG rendering.

Astrocartography endpoints

MethodPathUse
POST/api/v1/western/astrocartography/linesPlanetary line geometry for maps.
POST/api/v1/western/astrocartography/paransParan geometry and crossing bands.
POST/api/v1/western/astrocartography/recommendationsRanked place recommendations.
POST/api/v1/western/astrocartography/city-checkScore one city for a chart.
POST/api/v1/western/astrocartography/relocationRelocated chart and angular context.

Horoscope and simple sign endpoints

MethodPathUse
GET/api/v1/horoscope/daily/signDaily horoscope for one sign.
GET/api/v1/horoscope/daily/bulkDaily horoscopes for all signs.
POST/api/v1/horoscope/daily/personalPersonalized daily horoscope from birth data.
GET/api/v2/horoscope/daily/signV2 sign horoscope.
POST/api/v2/horoscope/daily/personalV2 personalized horoscope.
POST/api/v3/horoscope/daily/personalLatest personalized horoscope generation route.
POST/api/v1/western/signs/sunCalculate Sun sign.
POST/api/v1/western/signs/moonCalculate Moon sign.
POST/api/v1/western/signs/risingCalculate rising sign.
POST/api/v1/western/signs/midheavenCalculate Midheaven sign.

Chinese astrology endpoints

MethodPathUse
POST/api/v1/chinese/baziBaZi Four Pillars.
POST/api/v1/chinese/bazi/flowAnnual and monthly BaZi flow.
GET/api/v1/chinese/bazi/dictionaryBaZi interaction and star dictionary.
GET/api/v1/chinese/todayCurrent pillars for now.
POST/api/v1/chinese/bazi/time-correctionTrue solar time correction.
POST/api/v1/chinese/bazi/synastryBaZi compatibility.
POST/api/v1/chinese/bazi/lifespanNeijing life curve.
POST/api/v1/chinese/bazi/healthConstitution and health tendencies.

Utility and platform endpoints

MethodPathUse
GET/api/v2/geo/searchAuthenticated city search.
GET/api/v1/geo/searchLegacy city search.
POST/api/v1/ephemeris/calculatePOST ephemeris calculation.
GET/api/v1/ephemerisQuery-string ephemeris calculation.
GET/api/v1/moon/phaseMoon phase, zodiac, visuals, and interpretation.
GET/api/v1/moon/monthMonthly Moon phase timeline.
POST/api/v1/ai/generateAtomic AI report generation.
GET/mcpHosted MCP endpoint.
POST/mcpHosted MCP tool calls.
POST/api/v1/auth/keysCreate API key.
GET/api/v1/auth/keysList API keys.
DELETE/api/v1/auth/keys/{key_id}Delete API key.
GET/api/v1/auth/logsFetch API usage logs.
GET/api/v1/billing/plansList billing plans.
POST/api/v1/billing/checkoutCreate checkout session.
POST/api/v1/billing/portalCreate customer portal session.
POST/api/v1/contactSend contact message.
POST/api/v1/contact/suggestionSend product suggestion.

Step-by-step: build the chat app

Step 1: collect birth data once

Your onboarding form should collect:

  • Name
  • Date of birth
  • Time of birth
  • Birth city
  • Latitude and longitude when available
  • Timezone, or AUTO

For production, coordinates are better than city names because many cities share the same name. Use city search to help users choose the right place.

curl -G "https://api.freeastroapi.com/api/v2/geo/search" \
  -H "x-api-key: YOUR_API_KEY" \
  --data-urlencode "q=Mumbai" \
  --data-urlencode "country=IN" \
  --data-urlencode "limit=5"

Step 2: create the user's core Vedic profile

Call the full calculate endpoint after onboarding. Store the response in your database as the user's astrological profile.

curl -X POST "https://api.freeastroapi.com/api/v2/vedic/calculate" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "year": 1994,
    "month": 8,
    "day": 11,
    "hour": 6,
    "minute": 42,
    "city": "Mumbai",
    "lat": 19.0760,
    "lng": 72.8777,
    "tz_str": "AUTO",
    "ayanamsha": "lahiri",
    "vargas": [1, 9, 10],
    "include_yogas": true,
    "include_panchang": true,
    "include_shadbala": true,
    "include_ashtakavarga": true,
    "dasha_levels": 3
  }'

This gives the chat app enough structured data for common questions like:

  • "What is my Lagna?"
  • "What is my Moon Nakshatra?"
  • "Which dasha am I running?"
  • "Do I have strong career yogas?"
  • "What does my D9 say about marriage?"

Step 3: route each user question to the right endpoint

Do not call every endpoint on every chat message. Classify the intent first.

User asksAPI call
"Tell me about my birth chart"Use stored /api/v2/vedic/calculate data.
"What dasha am I in?"POST /api/v2/vedic/dasha or stored dasha data.
"What is happening this month?"POST /api/v2/vedic/gochar/timeline/insights.
"Is today auspicious?"POST /api/v2/vedic/panchang.
"Are we compatible?"POST /api/v2/vedic/match or /api/v2/vedic/compatibility.
"Make me a daily horoscope"POST /api/v3/horoscope/daily/personal.
"Show my chart wheel"POST /api/v1/natal/chart/ or a Vedic table UI built from /api/v2/vedic/chart.

This keeps latency and cost under control.

Step 4: pass structured facts into the LLM

The prompt should tell the LLM to explain the API payload, not recalculate it.

You are an astrology assistant for a Vedic astrology app.
Use only the structured API facts below.
Do not invent planetary positions, dashas, Nakshatras, yogas, or compatibility scores.
If the needed fact is missing, ask for the missing input or say that this endpoint was not called.

User question:
{user_message}

FreeAstroAPI facts:
{json_from_relevant_endpoint}

For better answers, use fact endpoints such as dasha insights and Gochar timeline insights. These payloads are already shaped for retrieval, ranking, and explanation.

Step 5: add memory without changing the chart

Separate permanent chart facts from conversation memory.

  • Permanent facts: birth data, chart positions, dasha timeline, vargas, Panchang at birth.
  • Session memory: preferred language, tone, current goal, relationship context, recent questions.
  • Fresh facts: today's Panchang, current dasha, current Gochar, daily horoscope.

This avoids a common bug where the assistant starts treating a previous interpretation as if it were a new chart fact.

Step 6: build safe answer templates

For user trust, every chat answer should have a predictable shape:

  1. Direct answer in one or two sentences.
  2. Evidence from the API payload.
  3. Practical interpretation.
  4. Optional next question or action.

Example:

You are currently in Moon Mahadasha and Saturn Antardasha.
The API dasha payload shows Moon as the active Mahadasha lord and Saturn as the active sub-period lord for the selected reference date.
This usually focuses the reading on emotional security, home, responsibility, and long-term discipline.
If you want, I can compare this dasha with your current Gochar timeline.

Suggested app architecture

Use a small backend between your frontend and FreeAstroAPI.

User interface
  -> Your backend chat route
  -> Intent classifier
  -> FreeAstroAPI endpoint call
  -> Structured payload store
  -> LLM response generation
  -> Chat answer with endpoint-backed facts

Never expose your API key directly in browser JavaScript. Keep x-api-key on your server and call your own backend from the client.

Minimal Node.js server example

const API_BASE = "https://api.freeastroapi.com";

async function getVedicProfile(birthData: Record<string, unknown>) {
  const response = await fetch(`${API_BASE}/api/v2/vedic/calculate`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.FREEASTROAPI_KEY || "",
    },
    body: JSON.stringify({
      ...birthData,
      tz_str: "AUTO",
      ayanamsha: "lahiri",
      vargas: [1, 9, 10],
      include_yogas: true,
      include_panchang: true,
      include_shadbala: true,
      include_ashtakavarga: true,
      dasha_levels: 3,
    }),
  });

  if (!response.ok) {
    throw new Error(`FreeAstroAPI request failed: ${response.status}`);
  }

  return response.json();
}

SEO title and content strategy for your astrology bot

If you are publishing your app publicly, create landing pages around real search intent:

  • "AstroSage API alternative"
  • "Vedic astrology API"
  • "Kundli API for developers"
  • "Dasha API"
  • "Panchang API"
  • "Astrology chatbot API"
  • "Build an astrology bot"

Each page should explain the exact feature, show a live example, list the endpoint used, and link to the relevant documentation. Avoid vague AI astrology claims. Users and search engines both respond better to concrete features.

Common mistakes to avoid

  1. Do not let the LLM calculate charts from raw birth data.
  2. Do not ignore timezone and historical location handling.
  3. Do not call expensive endpoints on every message.
  4. Do not mix Western and Vedic concepts without labeling the system.
  5. Do not present generated interpretation as deterministic chart data.
  6. Do not store only the final text response. Store the API payload too.

Start building your AstroSage-like app

FreeAstroAPI gives you the calculation layer for Vedic charts, dasha, Panchang, compatibility, Gochar, horoscopes, Western charts, synastry, moon data, and chart rendering.

Start with the Vedic calculate endpoint, add dasha and Panchang chat intents, then expand into compatibility, Gochar, and daily horoscope features.

Free developer tier

Start for free with 80 requests per day

Create your API key and start testing Vedic charts, dasha, Panchang, compatibility, horoscope, and chart endpoints without a credit card.

Start for free

Read next

All guides