Skip to content
POST/api/astro/rag_conditional_mapping/1 credit

Conditional question scoring

A rule-scoring engine for yes/no life questions — "Will there be travel?", and questions about study, marriage, wealth and the rest. Each question in the catalogue carries a list of classical conditions grouped by the chart factor they test: what sign the ascendant is, where the ascendant lord sits, what occupies the third house, and so on. The engine builds the birth chart and the navamsa for the moment you supply, checks every condition, and reports which held and which did not. One key, `response`. Send `date_time`, `latitude`, `longitude` and `question_number`, plus `name` and `input_number`. The reply is `{question, confidence_score, confidence_scores, factors_matching, factors_not_matching, factors_required}`: the question text, an overall score between 0 and 1, the same score broken down per factor group, and three objects keyed by factor group listing the conditions met, the conditions missed, and the full requirement set. Questions are numbered 1 to 180. Anything outside that returns an object carrying an `error` or `message` field with HTTP 200 rather than a 400, so check for those before reading `confidence_score`. `input_number` is consulted only by the handful of questions that use a number supplied by the querent in the classical numeric-prashna manner; for the rest it is ignored, as is `name`. The score is a count of conditions met over conditions tested — a structured summary of the classical rules, not a probability.

https://yogataraapi.prahlad.app/api/astro/rag_conditional_mapping/
Test Request

Authentication

Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.

X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/json

Request fields

FieldTypeRequiredNotes
date_timestring (date-time)required

The moment to calculate for, ISO 8601. ALWAYS include an offset or a trailing Z - a value with no zone is read as Asia/Kolkata (UTC+05:30), not UTC, and can return the previous day's result with a 200. '2026-09-01T06:00:00Z' and '2026-09-01 06:00:00' are different instants and give different answers.

input_numberintegerrequired
keysarrayrequired

Which calculations to return, as a list of names. See the key table for this endpoint; an unrecognised name rejects the whole request. One call costs one credit however many keys you ask for, so request everything you need at once rather than making several calls.

latitudenumber (double)required

Latitude of the place, in decimal degrees. Positive is north, negative is south. Example: 26.9124 for Jaipur, 40.7128 for New York. Minutes and seconds are not accepted - convert first.

min -90 · max 90

longitudenumber (double)required

Longitude of the place, in decimal degrees. Positive is east, negative is west. Example: 75.7873 for Jaipur, -74.0060 for New York. Note the sign: a missing minus puts New York in China.

min -180 · max 180

namestringrequired
question_numberintegerrequired

Available keys (1)

Ask for exactly the calculations you want by listing them in keys. An unknown key rejects the whole request, and you are charged 1 credit however many you ask for — so batch them.

KeyExtra fields neededDescription
responsedate_time, longitude, latitude, question_number, name, input_numberWhich astrological factors for a numbered question are met by this chart: `{question, confidence_score, factors_matching, factors_not_matching, factors_required}`. `confidence_score` is a float and the three `factors_*` entries are objects. Questions outside 1-180 return the same shape with a score of 0.0 and a `message`; an unmapped number returns `{error}` instead. Unlike the `response` key on /api/astro/conditional_question/, this returns the reasoning rather than an answer.

Example request

curl -X POST https://yogataraapi.prahlad.app/api/astro/rag_conditional_mapping/ \
  -H "X-API-Key: $OCCULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_time":"2026-09-01 06:00:00","input_number":0,"keys":["response"],"latitude":26.9124,"longitude":75.7873,"name":"Rajesh Kumar","question_number":0}'

Response

{
  "data": {
    "response": {
      "error": "Question 0 not found in conditional mapping"
    }
  },
  "status": 200,
  "is_error": false,
  "message": "successful"
}

Captured from a real call using the exact request above. Results sit under data, keyed by what you requested.

Errors

Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.