Use case
Astrology API for astrologer consultation platforms
Updated
How it works
- 1An astrologer opens a client's page on a consultation platform a few minutes before the session.
- 2The platform asks the API for the client's chart, the planetary periods and the rules that apply, and shows them side by side.
- 3Each answer comes with the id of the rule behind it, so the astrologer can check it. A report goes to the client after the call.
POST /v1/dosha/pitra200 OK{
"dosha": "pitra",
"present": true,
"rule": "Sun, Rahu or Ketu afflicting the 9th house or its lord, or the 9th lord placed in a dusthana",
"answer": {
"status": "present",
"headline": "Pitra dosha is present, because Ketu sits with the ruler of your 9th house."
}
}How to build an astrology consultation platform on the API
Each step is one call, linked to its page in the API reference. Where a card shows values, they are real API output. Planet positions come from NASA JPL planet data (DE440). We check them against NASA JPL Horizons. On 25,571 positions from 1850 to 2149, the Sun and planets agree within 0.001 arc seconds. The Moon agrees within 0.011. An arc second is 1/3,600 of a degree. See how we test accuracy. A practicing astrologer reviews the rules behind these answers. Each rule has an ID in the public rulebook.
- 01
Open the client's chart
POST /v1/planetsEvery planet's sign, house, degree and nakshatra (star group), plus the rising sign, for the chart the astrologer reads from.
- ascendant.sign
- "Virgo"
- ascendant.degree_dms
- "19 : 56 : 03"
- ascendant.nakshatra
- "Hast"
- ascendant.pada
- 3
Real output from the example in the API reference.
- 02
Add the divisional charts
POST /v1/chart/{division}The navamsa (D9) for marriage, the dasamsa (D10) for career, or any other of the 16 charts, from the same birth details.
- varga
- "D9"
- ascendant.sign
- "Gemini"
- positions.0.name
- "Sun"
- positions.0.sign
- "Pisces"
Real output from the example in the API reference.
- 03
Show the running periods
POST /v1/dasha/vimshottariMain periods and sub-periods with exact dates, so the astrologer sees which period is running on the day of the call.
- starting_lord
- "Mars"
- balance_at_birth_years
- 6.348728
- periods.0.periods.1.lord
- "Rahu"
- periods.0.periods.1.start
- "1990-05-18T16:54:09.380502"
Real output from the example in the API reference.
- 04
List the yogas
POST /v1/yogasThe yogas the chart forms and the ones it misses, each with the rule tested and the placement that decided it.
- formed.0.name
- "Sarala"
- formed.0.rule
- "lord of house 8 placed in a dusthana (6,8,12); free of conjunction or aspect from a natural benefic or a kendra/trikona lord (1,4,5,7,9,10), and the lagna lord stronger in shadbala"
- not_formed.0.name
- "Ruchaka"
- not_formed.0.reason
- "Mars is dignified but house 8 is not a kendra"
Real output from the example in the API reference.
- 05
See the rule behind each reading
POST /v1/reading/rulesEvery rule that applies to the chart, each with an id such as lord_house:4:11 and the houses it is about. Also which rule leads for each house.
- rules.0.id
- "lord_house:4:11"
- rules.0.title
- "Lord of the 4th (Jupiter) in the 11th house"
- rules.0.score
- 7
Real output from the example in the API reference.
- 06
Read a question chart for a client
POST /v1/prashnaFor a client with no birth details: a chart for the moment and place they ask, read for one topic. Each verdict names the condition and the reasons that decided it.
- answer.verdict
- "possible_with_effort"
- verdict.case
- "malefic_interference"
- verdict.decided_by.0
- "lords_applying"
- tajika.state
- "applying"
Real output from the example in the API reference.
- 07
Send a report after the session
POST /v1/reportThe whole reading as one printable HTML page, with your own title, ready for the client to save as a PDF.
What you send, what you get, what it costs
| You send | The client's birth date, time and place, and the session date as as_of where an endpoint takes it. |
|---|---|
| You get | The chart, any of the 16 divisional charts, dated periods, the yogas formed and missed, the rules behind each reading and a printable report. |
| It costs | Steps 1, 2, 3, 4 and 5: 1 call each.Step 6: 5 reading credits.Step 7: 25 reading credits (40 with the topic chapters). |
Costs are for a live key, and failed requests are free. The Free plan includes 2,000 calls and 150 reading credits a month.
Step 1 in code: open the client's chart
Send the details as JSON, with your API key in the Authorization header. The other steps work the same way, and each one links to its page in the API reference.
POST /v1/planets
# John Doe, born Aug 15, 1990, 10:30 AM, New York
curl -X POST "https://apiforastrology.com/api/astrology/v1/planets" \
-H "Authorization: Bearer $ASTROLOGY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"year":1990,"month":8,"day":15,"hour":10,"minute":30,"second":0,"latitude":40.7128,"longitude":-74.006,"timezone":"America/New_York"}'{
"meta": {
"ayanamsa": "lahiri",
"ayanamsa_value": 23.7260727,
"julian_day": 2448119.10483,
"ephemeris": "JPL DE440s",
"node": "true",
"timezone": {
"source": "zone",
"offset_hours": -4,
"zone": "America/New_York",
"abbreviation": "EDT",
"dst": true,
"dst_hours": 1,
"ambiguous_resolved_by_fold": null,
"note": "read from the IANA tz database at this instant, so daylight saving and historical offset changes are included"
}
},
"ascendant": {
"name": "Ascendant",
"longitude": 169.934155,
"sign": "Virgo",
"sign_number": 6,
"degree_in_sign": 19.934155,
"degree_dms": "19 : 56 : 03",
"house": 1,
"nakshatra": "Hast",
"nakshatra_lord": "Moon",
"pada": 3,
"speed": 0,
"retrograde": false,
"combust": false,
"dignity": "n/a",
"vargottama": false,
"pushkara": {
"navamsa": false,
"navamsa_number": 6,
"bhaga": false,
"bhaga_degree": 9,
"bhaga_by_element": false,
"bhaga_degree_by_element": 14,
"sources_agree": true,
"orb_degrees": 1
}
},
"positions": [
{
"name": "Sun",
"longitude": 118.7753409,
"sign": "Cancer",
"sign_number": 4,
"degree_in_sign": 28.7753409,
"degree_dms": "28 : 46 : 31",
"house": 11,
"nakshatra": "Ashlesha",
"nakshatra_lord": "Mercury",
"pada": 4,
"speed": 0.9610665,
"retrograde": false,
"combust": false,
"dignity": "friend",
"vargottama": false,
"pushkara": {
"navamsa": false,
"navamsa_number": 9,
"bhaga": false,
"bhaga_degree": 8,
"bhaga_by_element": false,
"bhaga_degree_by_element": 7,
"sources_agree": true,
"orb_degrees": 1
}
},
{
"name": "Moon",
"longitude": 54.5750352,
"sign": "Taurus",
"sign_number": 2,
"degree_in_sign": 24.5750352,
"degree_dms": "24 : 34 : 30",
"house": 9,
"nakshatra": "Mrigashira",
"nakshatra_lord": "Mars",
"pada": 1,
"speed": 14.258194,
"retrograde": false,
"combust": false,
"dignity": "mulatrikona",
"vargottama": false,
"pushkara": {
"navamsa": false,
"navamsa_number": 8,
"bhaga": false,
"bhaga_degree": 14,
"bhaga_by_element": false,
"bhaga_degree_by_element": 14,
"sources_agree": true,
"orb_degrees": 1
}
},
{
"name": "Mars",
"longitude": 27.7149328,
"sign": "Aries",
"sign_number": 1,
"degree_in_sign": 27.7149328,
"degree_dms": "27 : 42 : 54",
"house": 8,
"nakshatra": "Krittika",
"nakshatra_lord": "Sun",
"pada": 1,
"speed": 0.5753266,
"retrograde": false,
"combust": false,
"dignity": "own sign",
"vargottama": false,
"pushkara": {
"navamsa": true,
"navamsa_number": 9,
"bhaga": false,
"bhaga_degree": 21,
"bhaga_by_element": false,
"bhaga_degree_by_element": 21,
"sources_agree": true,
"orb_degrees": 1
}
}
],
"planetary_war": []
}Tips for going live
- Ask for the birth time from a birth certificate where you can. The rising sign moves through a whole sign in about two hours, so a guessed time can move every house.
- Send the session date as as_of where an endpoint takes it, so periods and readings match the day of the call.
- Keep the API key on your backend. The astrologer's screen and the client's app get chart data from your server, never the key itself.
- The scores in /v1/reading/rules are the API's own stated weights, not classical ones. Show them as the order of the reading, not as a verdict.
- Reports use reading credits, not calls, so plan your credits around the number of sessions you expect each month.

What it costs
A consultation platform that sends a full report after each of 150 sessions a month uses 3,750 reading credits for the reports. Growth.
Every plan can call every endpoint: calls for calculations, reading credits for written readings. Test keys are free on every plan, with 1,000 calls a month. Paid plans start at $29 a month, and failed requests are free.
See pricingTry it free
See an answer first
Free kundli
Your Vedic birth chart: the rising sign and all nine planets, with sign, house and nakshatra.
Make my kundli
Features used here
- Kundli and birth chartsPlanets, rising sign and D1 to D60 charts
- Dashas (planetary periods)Vimshottari, Yogini and Ashtottari dates
- Transits and forecastsGochar, sign changes and retrograde dates
- Yogas and doshasManglik, kaal sarp and pitra dosha checks
- Planetary strengthShadbala and ashtakavarga
- Jaimini astrologyChara karakas, arudha and chara dasha
- Readings and reportsTopic readings and a printable kundli report
- Prashna (horary)One question, read from the moment asked
Read next
From the blog
Common questions
All questionsCan our astrologers see the rules behind each API answer?
Yes. POST /v1/reading/rules lists every rule that applies to a chart. Each has an id such as lord_house:4:11, the houses it is about, its themes and its score. Each yoga and dosha carries the rule it tested. The public rulebook explains every rule under its own ID, such as YG-07 for Sarala yoga.
Browse the rulebookAre the scores in the rules list classical?
No. No classical text gives rules a number. The API uses its own stated weights only to decide which rule leads a reading when two rules speak about the same house. Leading never means the other rule is wrong, and the rulebook says how the weights work.
How rules are weightedCan we send clients a report under our own brand?
Yes. POST /v1/report builds one printable HTML page from the client's full reading, and nothing on it names us. Pass title to put your platform's name or the client's name at the top. Clients print it to PDF from their own browser, and each report is paid for in reading credits, not calls.
See a sample reportWhat else can an astrologer's screen show?
POST /v1/chart/{division} gives any of the 16 divisional charts, and POST /v1/shadbala the six-part planet strength. POST /v1/ashtakavarga gives the point tables, and POST /v1/jaimini the Jaimini karakas (planet roles) and chara dasha (periods counted in signs). All of them take the same birth details, so one client form covers every screen.
See all featuresCan astrologers read a question chart for a client with no birth details?
Yes. POST /v1/prashna reads a question chart (prashna, or horary) from the moment and place the client asks, for one topic from GET /v1/prashna/topics. POST /v1/prashna/kp is the KP way, where the client also picks a number from 1 to 249. Each verdict comes with the rule that decided it. Some questions, such as lifespan or a medical diagnosis, get a 422 error and no reading.
How a question's answer is decidedHow is an astrology API different from kundli software?
Desktop kundli software runs on the computer it is installed on. The API does the same chart math on a server and returns JSON. So your platform can show each client's chart in a browser or a phone app, and every astrologer sees the same chart with the same settings. Each answer also names the rule behind it.
About the kundli APIWhich settings does the API use for every chart?
The sidereal zodiac (measured from the fixed stars) with whole-sign houses. The Lahiri ayanamsa (zodiac offset) is used unless you send another (KP or Raman). Every client's chart is worked out the same way, with the same settings. So two astrologers on your platform always see the same chart for the same client.
Read the conventionsCan our platform say a reading is certain?
No. Our terms treat astrology as a traditional practice, and nothing the API returns may be presented as medical, legal, financial or psychological advice. Your platform and its astrologers are responsible for what is said to a client.
Read the astrology disclaimerAstrology API
Start with a free test key
Create an account and a test key, then try each step above. Need more than the largest plan? Write to us.
Your first answer
John Doe, New York
- RisingVirgoHast
- SunCancerAshlesha
- MoonTaurusMrigashira
- MarsAriesKrittika
Real API output. A free test key gets the same answer.
01
Test key: 1,000 test calls a month to build with
02
Free plan: 2,000 live calls a month, no card needed
03
Open rules: every rule is published, so you can check any answer
