tutorial

Localizing astrology readings into Indic languages

A developer guide to localizing astrology API readings into Indic languages: native generation versus translation, script handling, caching, and quality checks.

To localize astrology readings into Indic languages with the Vedika API, send a language parameter on POST /api/v1/astrology/query (for example "hi" for Hindi or "ta" for Tamil). The reading is generated natively in that language rather than machine-translated from English, while the underlying chart math stays identical across all 30 supported languages. This guide walks through the request shape, the native-generation versus translation trade-off, script and font handling, transliteration of technical terms, caching, and how to verify quality.

Why localization is harder for astrology than for most content

Astrology text is unusually dense with domain terminology: planet names, sign and house names, dasha periods, yogas, nakshatras, and classical citations. A generic translation pipeline that treats the reading as ordinary prose tends to produce three recurring failures.

For these reasons the cleaner approach is to generate the narrative in the target language from the start, rather than translate an English draft after the fact.

Native generation versus translation

There are two ways to deliver a reading in Hindi, Tamil, or Bengali, and they are not equivalent.

ApproachHow it worksTrade-offs
Translate-after Generate the reading in English, then pass it through a translation step. Extra latency and an extra failure point; terminology and tone degrade; citations can break.
Native generation The reading is produced directly in the requested language from the computed chart facts. Terminology, register, and citations stay coherent; one round-trip instead of two.

The Vedika API uses native generation for its supported languages, including the 14 Indic languages, so the language you request is the language the reading is composed in. The astronomical layer is shared: the same computed positions feed every language, which is what keeps a Hindi reading and an English reading of the same chart factually consistent.

What stays constant across languages

The chart itself never changes with language. Planetary longitudes, ascendant and house cusps, divisional charts, dasha timelines, and yoga detection are computed by the XALEN Ephemeris engine, Vedika's own open-source engine validated against reference astronomical data to within sub-arcminute precision. Localization touches only the narrative and the labels. If you request the same birth details in five languages, the numbers underneath are byte-for-byte the same; only the words differ.

Making a localized request

The AI query endpoint accepts a question, birth details, and a language. Birth details use a nested object with datetime, latitude, longitude, and timezone.

curl -X POST https://api.vedika.io/api/v1/astrology/query \
  -H "x-api-key: vk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What does my career look like this year?",
    "language": "hi",
    "birthDetails": {
      "datetime": "1990-05-15T08:30:00",
      "latitude": 28.6139,
      "longitude": 77.2090,
      "timezone": "Asia/Kolkata"
    }
  }'

The response narrative comes back in Hindi (Devanagari), with sign, planet, and house names rendered in the conventions of that language. Switch "language" to "ta", "bn", "te", or any other supported code to get the same chart explained in that language.

A reusable client helper

If you serve users in several languages, wrap the call so language is just a parameter. The example below uses a generic HTTP client and an environment-supplied key.

async function getReading({ question, language, birth }) {
  const res = await fetch("https://api.vedika.io/api/v1/astrology/query", {
    method: "POST",
    headers: {
      "x-api-key": process.env.VEDIKA_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ question, language, birthDetails: birth }),
  });
  if (!res.ok) throw new Error(`Reading failed: ${res.status}`);
  return res.json();
}

// Same chart, two languages
const birth = {
  datetime: "1990-05-15T08:30:00",
  latitude: 28.6139,
  longitude: 77.2090,
  timezone: "Asia/Kolkata",
};
const hi = await getReading({ question: "Career this year?", language: "hi", birth });
const ta = await getReading({ question: "Career this year?", language: "ta", birth });

For long readings, prefer the streaming variant POST /api/v1/astrology/query/stream (Server-Sent Events) so localized text renders progressively instead of making the user wait for the full paragraph. The language behavior is identical; only the transport differs.

Script and rendering: the part that actually breaks

Most "the Hindi text is broken" bug reports are not API problems. They are encoding or font issues in the consuming application. Indic scripts use combining characters, conjuncts, and reordering that a careless pipeline will corrupt. Get these four things right and rendering problems mostly disappear.

  1. UTF-8 end to end. Set Content-Type: application/json; charset=utf-8, decode the response as UTF-8, and never pass the bytes through a Latin-1 step.
  2. UTF-8 storage. If you persist readings, use a column type that stores the full Unicode range (for example utf8mb4 in MySQL or a UTF-8 text column in Postgres). The older 3-byte "utf8" in some databases silently truncates.
  3. The right lang attribute. Tag the rendering element, for example <div lang="hi"> or lang="ta", so the browser and screen readers pick correct shaping and line-breaking.
  4. A font that covers the script. A font missing Tamil or Odia glyphs renders boxes regardless of correct bytes. Ship a webfont that covers your target scripts.

Transliteration of technical terms

Some applications want a Latin-script transliteration alongside or instead of native script, for example a user who speaks Hindi but reads Roman text more comfortably. Decide this at the product level and request the language that matches: native script for an audience that reads it, a romanized variant where you offer one. Keep the mapping of technical terms stable across your UI: if your interface labels a planet "Mangal" in one place, do not let it become "Mars" two screens later. Consistency of terminology is a localization decision your app owns, not something to leave to chance per request.

Caching localized responses

Localization multiplies your cache key space. The same chart and the same question in three languages are three distinct responses, so language must be part of the cache key.

The /v2/astrology/* endpoints take flat parameters (datetime, latitude, longitude, timezone) and return computed data you can render in any language yourself, which is useful when you want full control over the wording.

Verifying localization quality

Treat localized output like any other contract you depend on and test it.

You can run all of these against the free sandbox before spending a single paid query. The sandbox needs no key and returns realistic shapes for every supported language.

Key facts

Where to go next

Preview localized output for your own birth charts in the free sandbox, check the full request and response shapes in the API docs, and review plans (Starter $12/mo through Enterprise $240/mo, with per-query usage from $0.01) on the pricing page. If you are building an assistant or agent integration, the same localization parameter flows through there too.

Frequently asked questions

How do I get an astrology reading in Hindi instead of English? Send a language parameter such as "hi" on POST /api/v1/astrology/query; the reading is generated natively in that language.

Are chart calculations affected by the language I request? No. Positions, houses, dashas, and yogas are computed once and shared across all languages; only the text changes.

Which scripts and languages are supported? 30 languages including 14 Indic languages, each in its native script.

Should I translate readings myself or request them in the target language? Request them in the target language so terminology and citations stay coherent.

How do I keep Indic text from breaking in my app? Serve and store everything as UTF-8, set the correct lang attribute, and load a font that covers the target script.

Build on the Vedika astrology API

700+ operations, Vedic + Western + KP, 30 languages, an open-source XALEN ephemeris, and a built-in LLM. Free sandbox — no signup.

Try the free sandbox