aijatak
Vedic Astrology Engine

🧩 JavaScript / IFrame Embed

Drop-in JavaScript embed for any website. Auto-discovers widgets, programmatic API, postMessage auto-resize. No WordPress required.

Any Website No Dependencies 2KB Script Free

On This Page

Quick Start Auto-Discovery Mode Programmatic API Data Attributes Auto-Resize Raw IFrame (No SDK) Embed API Endpoints CSP & Security Examples

Quick Start

Add this to any HTML page — that's it:

<div class="aijatak-widget" data-widget="panchang" data-lang="hi"></div>
<script src="https://www.aijatak.com/static/embed.js" async></script>

The script auto-discovers .aijatak-widget elements and renders responsive iframes.

Auto-Discovery Mode

Add class="aijatak-widget" to any <div> and configure with data-* attributes:

<!-- Today's Panchang in Hindi -->
<div class="aijatak-widget" data-widget="panchang" data-lang="hi"></div>

<!-- Daily Horoscope (dark theme) -->
<div class="aijatak-widget" data-widget="horoscope" data-theme="dark"></div>

<!-- Rahu Kaal for Mumbai -->
<div class="aijatak-widget" data-widget="rahukaal" data-city="Mumbai"></div>

<!-- Numerology Calculator -->
<div class="aijatak-widget" data-widget="numerology"></div>

<!-- Baby Names in Kannada -->
<div class="aijatak-widget" data-widget="babynames" data-lang="kn"></div>

<!-- Birth Chart Calculator -->
<div class="aijatak-widget" data-widget="chart"></div>

<!-- Load SDK once at bottom -->
<script src="https://www.aijatak.com/static/embed.js" async></script>

Programmatic API

For more control, use Aijatak.embed():

<div id="my-panchang"></div>
<div id="my-horoscope"></div>

<script src="https://www.aijatak.com/static/embed.js"></script>
<script>
  // Embed panchang in Tamil (dark theme)
  Aijatak.embed('#my-panchang', {
    widget: 'panchang',
    lang: 'ta',
    theme: 'dark',
    city: 'Chennai'
  });

  // Embed Aries horoscope in Hindi
  Aijatak.embed('#my-horoscope', {
    widget: 'horoscope',
    sign: 'aries',
    lang: 'hi'
  });
</script>

Aijatak.embed(selector, options)

ParameterTypeDescription
selectorstring | HTMLElementCSS selector or DOM element
options.widgetstringWidget type
options.langstringLanguage code
options.themestringlight or dark
options.citystringPre-fill city (Panchang/Rahu Kaal)
options.signstringZodiac sign (Horoscope)
options.refstringReferral tracking ID
options.widthstringCSS width (default: 100%)
options.heightnumberHeight in pixels

Aijatak.refresh()

Re-runs auto-discovery. Call after dynamically adding .aijatak-widget elements (e.g., in a SPA):

var div = document.createElement('div');
div.className = 'aijatak-widget';
div.setAttribute('data-widget', 'numerology');
document.body.appendChild(div);

Aijatak.refresh();

Aijatak.buildUrl(options)

Returns the embed URL without creating an iframe:

var url = Aijatak.buildUrl({widget: 'panchang', lang: 'hi', theme: 'dark'});
// → "https://www.aijatak.com/embed/panchang?lang=hi&theme=dark"

Data Attributes

AttributeValuesDefault
data-widgetchart, panchang, horoscope, rahukaal, numerology, babynameschart
data-lang28 language codesen
data-themelight, darklight
data-cityCity name(none)
data-signZodiac sign slug(none)
data-refReferral tracking ID(none)
data-widthCSS width value100%
data-heightHeight in pixels (number)Per-widget default

Default Heights

WidgetDefault Height
chart700px
panchang600px
horoscope500px
rahukaal450px
numerology550px
babynames500px

Auto-Resize

Embedded iframes automatically report their content height to the parent page via postMessage. The SDK handles this — no configuration needed.

postMessage Protocol

Embed pages send this message on load, DOM mutations, and window resize:

// Sent by embed → received by parent
{
  type: 'aijatak-resize',
  height: 842  // content height in pixels
}

Custom listener (if not using SDK)

window.addEventListener('message', function(e) {
  if (e.data && e.data.type === 'aijatak-resize') {
    var iframe = document.querySelector('iframe');
    if (iframe && iframe.contentWindow === e.source) {
      iframe.style.height = e.data.height + 'px';
    }
  }
});

Raw IFrame (No SDK)

If you prefer not to use the SDK, embed directly with an <iframe>:

<iframe
  src="https://www.aijatak.com/embed/panchang?lang=hi&theme=dark&city=Mumbai"
  width="100%"
  height="600"
  frameborder="0"
  style="border:none;border-radius:12px"
  loading="lazy"
></iframe>

You can add the postMessage listener above for auto-resize.

Embed API Endpoints

Lightweight HTML pages served by aijatak.com for iframe embedding:

EndpointWidget
GET /embed/chartBirth Chart Calculator
GET /embed/panchangToday's Panchang
GET /embed/horoscopeDaily Horoscope
GET /embed/rahukaalRahu Kaal Calculator
GET /embed/numerologyNumerology Calculator
GET /embed/babynamesBaby Names by Nakshatra

Query Parameters (all endpoints)

ParameterTypeDefaultDescription
langstringenLanguage code
themestringlightlight or dark
citystringPre-fill city (panchang, rahukaal)
signstringPre-select zodiac sign (horoscope)
refstringReferral tracking ID

Example URLs

https://www.aijatak.com/embed/panchang?lang=hi&theme=dark&city=Mumbai
https://www.aijatak.com/embed/horoscope?sign=aries&lang=ta
https://www.aijatak.com/embed/numerology?theme=dark
https://www.aijatak.com/embed/babynames?lang=kn
https://www.aijatak.com/embed/rahukaal?city=Bangalore
https://www.aijatak.com/embed/chart?lang=fr&theme=dark

Response

Rate Limits

API EndpointRate Limit
All /api/* endpoints30 requests/min per IP

CSP & Security

If your site has a strict Content Security Policy, add these directives:

frame-src https://www.aijatak.com;
script-src https://www.aijatak.com;

Full Page Example

<!DOCTYPE html>
<html>
<head>
  <title>My Astrology Page</title>
</head>
<body>
  <h1>Today's Panchang</h1>
  <div class="aijatak-widget"
       data-widget="panchang"
       data-lang="hi"
       data-theme="dark"
       data-city="Mumbai">
  </div>

  <h1>Daily Horoscope</h1>
  <div class="aijatak-widget"
       data-widget="horoscope"
       data-lang="hi">
  </div>

  <script src="https://www.aijatak.com/static/embed.js" async></script>
</body>
</html>