Build with AI
Pick your AI and copy one prompt.
4. Copy the prompt
Build this with BestAstroAPI (an astrology API: Vedic, Western, horoscopes, tarot): [write what you want, for example a kundli website] 1. Read https://bestastroapi.in/llms.txt first. Use only the endpoints and fields written there. 2. Base URL: https://api.bestastroapi.in. Send my key in the x-api-key header. 3. Keep the key on the server as BESTASTRO_KEY. Never put it in browser code, a mobile app or Git. 4. Birth place: let the user search and pick a place (GET /v1/places/search), then send its id as place_id. 5. Show only what the API returns. Do not calculate or invent astrology. 6. On an error, show error.message next to the field. On 429, wait for Retry-After. 7. Make it work well on a phone and with a keyboard. 8. Test with 18 May 2004, 10:30, New Delhi: lagna Cancer, Moon in Aries, Bharani nakshatra. 9. Work in this project. Run it and test it before you say it is done.
Optional: let Claude Code call the API itself.
claude mcp add --transport http bestastroapi https://api.bestastroapi.in/mcp \ --header "x-api-key: YOUR_API_KEY"
- You need a key: get one free.
- Your AI reads one file: llms.txt, with every endpoint, field and error.
- Want it to call the API itself? Connect your AI tool.
What the API covers
- Charts7Kundli, planets, houses, all 16 divisional charts, chart images
- Dasha5Vimshottari to 5 levels, yogini and chara dasha
- Panchang & timing11Daily and monthly panchang, festivals, muhurta, transits
- Matching & doshas10Ashtakoot, South Indian dashakoot, bulk matching, doshas
- Advanced12Yogas, shadbala, ashtakavarga, KP, jaimini, varshaphal, numerology
- Western7Tropical chart, wheel image, aspects, transits, synastry
- Horoscopes & tarot7Daily to yearly horoscopes, biorhythm, tarot
- Places & time zones4Place search, nearest place, time zone with DST
- Migration & utility2Compare with your old vendor, health
Moving from another API? The migration guide keeps your code as it is.
Quickstart without AI
1. Get a key
- Sign in with your phone number.
- Open API keys and create one. It is shown once.
- Save it as an environment variable:
export BESTASTRO_KEY="paste-your-key"2. Make the first call
A full kundli for 18 May 2004, 10:30, New Delhi:
curl -X POST "https://api.bestastroapi.in/v1/kundli" \
-H "x-api-key: $BESTASTRO_KEY" \
-H "content-type: application/json" \
-d '{"datetime":"2004-05-18T10:30","lat":28.6139,"lon":77.209,"tz":"Asia/Kolkata"}'- curl: macOS, Linux or Git Bash.
- JavaScript: save as
first.mjs, runnode first.mjs(Node 18 or newer). - Python:
pip install requestsfirst.
3. Read the result
summary
{
"gana": "Manushya",
"lagna": "Cancer",
"nadi": "Madhya",
"nakshatra": "Bharani",
"pada": 3,
"rashi": "Aries",
"sun_sign": "Taurus",
"varna": "Kshatriya",
"yoni": "Elephant"
}summary: lagna, rashi and nakshatra in short.planets: every planet with sign, house and nakshatra.dasha.current: mahadasha, antardasha, pratyantardasha.- All fields: Kundli bundle. Error codes: Errors.
Base URL
https://api.bestastroapi.in
Birth input
Most endpoints take the same fields:
| Field | What to send |
|---|---|
| datetime | Local birth time, like 2004-05-18T10:30. Do not convert to UTC. |
| place | A name, like Gorakhpur, Uttar Pradesh. We add coordinates and time zone. |
| or place_id | The id the user picked in place search. |
| or lat, lon, tz | Degrees (north and east positive) and a zone like Asia/Kolkata. |
| optional | ayanamsa, node, house_system, outer_planets |
If several places share a name, you get ambiguous_place with the choices.
Conventions
- Dates: 1850 to 2149.
- Ayanamsa: Lahiri (true) by default. Nodes: mean by default. Houses: whole sign.
- Sunrise: upper limb of the Sun, with refraction.
- Vara: from sunrise to sunrise.
- Vimshottari year: 365.2425 days.
- Times: local with offset, like
2026-11-22T06:48:52+05:30. - Signs: 1 = Aries to 12 = Pisces.
- A missing or null field means it does not apply.
Accuracy
Largest difference in our own tests. Not audited by a third party.
- Planets 0.7″, Moon 1.5″, ascendant 0.2″.
- Sunrise 0.03 seconds up to 60° latitude, 2.5 seconds nearer the poles.
Files
- llms.txt: all docs in one file for your AI.
- openapi.json: for Postman, Insomnia or a code generator.