By topic / React and Next.js
Integrations
Astrology API for React and Next.js
In Next.js, call the API from a route handler or a server component, where the key stays on the server, and render the JSON in your components. For a ready-made panel in any React app, add a widget: one script tag and a div.
Ideas
What people build with it
A kundli page in a Next.js site
A panchang widget on a React landing page
A matching form with server-side scoring
Reference
The endpoints
- Planet PositionsSidereal longitude, sign and sign lord, nakshatra, nakshatra lord and pada, house, speed, retrograde and combust flags for the Ascendant, the nine grahas and Uranus, Neptune and Pluto.POST/v1/vedic-charts/planet-positions 3 credits
- Chart Image StylesChart drawings as SVG in one style per call (north, south, east or western) for the charts you name (D1 to D300, chalit, chandra_kundali, kp, karakamsha, swamsha).POST/v1/vedic-charts/chart-image-styles 3 credits
- Daily PanchangThe full panchang for one day at one place: limbs, Sun and Moon times, calendar, auspicious and inauspicious periods, choghadiya, hora, festivals, balas, sunrise chart, doshas and more.POST/v1/panchang/daily-panchang 1 credit
- Kundli Matching (Ayu Milan)Ashtakoot matching from two births: koota scores and total, Manglik for both with cancellations, Papasamya, Rajju and Vedha, and classical longevity (Ayurdaya) spans for each.POST/v1/matching/ayu-milan 3 credits
- AI Reading: Chat answerAn AI answer to a question about a birth chart, with earlier turns as history; grounded in chart data the service computes from the birth (or in one report named in `context`).POST/v1/ai/ai-chat Metered, from 15 credits
Code
Your first call
export async function POST(request: Request) {
const birth = await request.json(); // { datetime, timezone, latitude, longitude }
const res = await fetch("https://api.96astroapi.com/v1/vedic-charts/planet-positions", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.ASTRO_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify(birth),
});
return Response.json(await res.json(), { status: res.status });
}Start building with React and Next.js
5,000 free trial credits. No card required.

