Drop D1, D9, Bhava Chalit and Dasha into any page with a single script tag — powered by one API call.
The GrahaJyoti API gives you raw JSON. This guide adds a tiny,
dependency-free helper — grahajyoti-chart.js — that turns the default
POST /charts response into a ready-made chart: Rāśi (D1) and
Navāṁśa (D9) planet tables, Bhāva Chalit cusps, and the
Vimśottari mahādaśā timeline. One request, one script, zero build step.
Add a <div> with your birth details as data attributes, then the script. It auto-renders on load.
<div data-grahajyoti
data-api-key="mkc_live_…"
data-dob="1990-05-15"
data-birth-time="14:30"
data-latitude="12.9716"
data-longitude="77.5946"
data-timezone="Asia/Kolkata"
data-name="Sample Chart"></div>
<script src="https://grahajyoti.com/assets/grahajyoti-chart.js"></script>
For dynamic apps, render on demand and get a promise back:
GrahaJyoti.renderChart({
el: '#chart',
apiKey: 'mkc_live_…',
dob: '1990-05-15',
birth_time: '14:30',
latitude: 12.9716,
longitude: 77.5946,
timezone: 'Asia/Kolkata'
}).then(function (resp) {
console.log('rendered', resp.data);
});
Paste your own key (it stays in your browser) and render the sample below:
Everything above comes from a single POST /charts call — lean by default (D1 + D9, panchanga,
Bhava Chalit, and the mahādaśā timeline). Want more? Pass options straight through:
| Option | Type | Notes |
|---|---|---|
el | string / element | Container to render into (CSS selector or node). |
apiKey | string | Your mkc_live_… key. Sent as X-API-Key. |
dob, birth_time | string | YYYY-MM-DD and HH:MM (24h, local). |
latitude, longitude | number | Decimal degrees. |
timezone | string | IANA name, e.g. Asia/Kolkata. |
ayanamsha | string | Optional. Default Lahiri. |
charts | string / array | More vargas: "all" or ["D10","D24"]. |
dasha_depth | string | maha (default) · antar · pratyantar. |
baseUrl | string | Point at your own proxy (see below). |
An API key in client-side code is visible to anyone who opens dev tools. That's fine for prototypes, internal dashboards, or trusted users — and keys are rate-limited and quota-capped, so exposure is bounded. But for a public website, proxy the request through your own backend so the key never ships to the browser:
// your server: POST /astro-proxy → forwards to GrahaJyoti with the key
// then in the browser:
GrahaJyoti.renderChart({ el: '#chart', baseUrl: '/astro-proxy', /* no apiKey */
dob: '1990-05-15', birth_time: '14:30',
latitude: 12.9716, longitude: 77.5946, timezone: 'Asia/Kolkata' });
Your proxy just needs to accept the JSON body, add the X-API-Key header, and return the API's response verbatim at /astro-proxy/charts.