LifeAstroAPILifeAstroAPI

← Docs home

Add Tamil astrology readings to your app

Kundli readings, the daily panchang and horoscope text in Tamil with one lang=ta parameter, using curl, fetch or the Node SDK.

Your app already has users who read Tamil. This guide shows how to give them three things in Tamil script: a kundli (birth chart) reading, today's panchang and a daily horoscope. You add one parameter, lang=ta. The endpoints, the JSON keys and the credit cost stay the same as in English. The three calls below cost 40 credits together.

The sample person is Arjun Mehta, born 15 January 1990 at 10:30 in Mumbai. Every response on this page is real output, trimmed by removing whole fields.

1. One parameter

Every Vedic endpoint whose response has names or text accepts lang. The older name locale works the same way. When the parameter is absent the answer is in English.

export LIFEASTRO_API_KEY=dv_live_...

curl -H "Authorization: Bearer $LIFEASTRO_API_KEY" \
  "https://api.lifeastroapi.com/v1/vedic/narrative/lagna?date=1990-01-15&time=10:30&tz=Asia/Kolkata&lat=19.076&lon=72.8777&lang=ta"

2. A lagna reading in Tamil

The lagna, also called the ascendant, is the zodiac sign that was rising on the eastern horizon at the moment of birth. /v1/vedic/narrative/lagna (10 credits) returns a written reading for it. The request above returns this:

{
  "sections": [
    {
      "rule_id": "vedic.L1.lagna.aquarius",
      "heading": "கும்ப லக்னம்: சனி தரும் கொள்கைப் பிடிப்பும் மனிதநேயமும்",
      "bullets": [
        "உங்கள் லக்னாதிபதி சனி, கொள்கைப் பிடிப்புள்ள, மனிதநேயமுள்ள, சிந்தனை சார்ந்த காற்று இயல்பைத் தருகிறார்",
        "உங்கள் பலங்கள்: கொள்கை அர்ப்பணிப்பு, மனிதநேயப் போக்கு, விசுவாசம், அமைப்புச் சிந்தனை",
        "கவனம்: உணர்வு விலகல், வித்தியாசத்தைக் கேடயமாக்குவது, மனிதர்களுக்குப் பதில் லட்சியங்களை வைப்பது",
        "பொருத்தமான துறைகள்: அறிவியல், தொழில்நுட்பம், சமூக அமைப்புகள், லாப நோக்கற்ற பணி, பொறியியல்",
        "உங்களுக்கு அறிவுரை: உங்கள் உறவுகளை நோக்கங்களைப் போலவே கவனமாகப் பிடியுங்கள், கொள்கையோடு அரவணைப்பும்"
      ],
      "resolved_locale": "ta"
    }
  ],
  "narrative_meta": {
    "engine": "vedic-N1",
    "locale": "ta"
  }
}
  • Each section also has a body field with the full reading. It is cut here for space. In this response it holds four paragraphs separated by a blank line (\n\n).
  • rule_id is in English in every language. Use it as the key in your code and your database.
  • resolved_locale tells you which language the text of that section is in.
  • The response also carries a remedies object of reference ids. It is cut here too.

3. Today's panchang in Tamil

A panchang is the Hindu daily calendar. It lists five elements for the day: tithi (lunar day), nakshatra (the Moon's star group), yoga, karana and the weekday. /v1/panchang/basic (20 credits) returns them with their end times and with sunrise and sunset. It needs a date, a latitude, a longitude and a timezone. This is Chennai on 15 January 2027:

GET https://api.lifeastroapi.com/v1/panchang/basic?date=2027-01-15&tz=Asia/Kolkata&lat=13.0827&lon=80.2707&lang=ta
{
  "date": "2027-01-15",
  "tz": "Asia/Kolkata",
  "sunrise_local": "2027-01-15 06:34:52",
  "sunset_local": "2027-01-15 18:01:33",
  "tithi": {
    "index": 6,
    "name": "சப்தமி",
    "paksha": "சுக்லா",
    "end_local": "2027-01-15 14:13:59"
  },
  "nakshatra": {
    "index": 26,
    "name": "ரேவதி",
    "pada": 2,
    "end_local": "2027-01-15 23:50:58"
  },
  "yoga": {
    "index": 19,
    "name": "சிவம்",
    "end_local": "2027-01-15 16:17:39"
  },
  "vara": {
    "weekday": "வெள்ளிக்கிழமை",
    "weekday_index": 5,
    "lord": "சுக்கிரன்",
    "hindi_name": "शुक्रवार"
  }
}
  • The names are in Tamil. Times, dates and numbers do not change with the language.
  • index is the same number in every language (tithi 0 to 29, nakshatra 0 to 26). Use it in code and show name to the user.
  • vara.hindi_name is a fixed Hindi field. It is in Hindi whatever lang you send.
  • The API has no "today" default. Send the date as it is where the user is.

4. The daily horoscope in Tamil

A rashi is a zodiac sign. In Vedic astrology the daily horoscope is read from the person's Moon sign, the rashi the Moon was in at birth. /v1/horoscope/daily (10 credits) takes the rashi name and a date. Mesha is Aries.

GET https://api.lifeastroapi.com/v1/horoscope/daily?rashi=Mesha&date=2027-01-15&lang=ta
{
  "rashi": "மேஷம்",
  "period": "daily",
  "period_key": "2027-01-15",
  "language": "ta",
  "headline": "குரு கோசாரம் (சிம்மம்): இன்று நல்ல அறிகுறிகள் உள்ளன",
  "slow_movers": [
    {
      "planet": "குரு",
      "current_sign": "சிம்மம்",
      "heading": "மேஷ ராசிக்கு குருவின் கோசாரம்: புரிதல், நம்பிக்கை"
    }
  ],
  "lucky": {
    "color": "சிவப்பு",
    "number": 9,
    "direction": "தெற்கு",
    "time": "05:24-06:36"
  }
}

slow_movers has seven entries in this response, one per planet. One is shown, and its body text is cut. Note that rashi and planet come back as Tamil names here. Keep the rashi value you sent as your own key, and do not match on these two fields.

5. All three with the Node SDK

npm install [email protected]

Every Vedic method takes lang.

import { LifeAstro } from 'lifeastroapi';

const astro = new LifeAstro({ apiKey: process.env.LIFEASTRO_API_KEY });

const birth = { date: '1990-01-15', time: '10:30', tz: 'Asia/Kolkata', lat: 19.076, lon: 72.8777 };
const chennai = { lat: 13.0827, lon: 80.2707, tz: 'Asia/Kolkata' };
const lang = 'ta';

const [lagna, day, horoscope] = await Promise.all([
  astro.narrative.lagna({ ...birth, lang }),                           // 10 credits
  astro.panchang.basic({ ...chennai, date: '2027-01-15', lang }),      // 20 credits
  astro.horoscope.daily({ rashi: 'Mesha', date: '2027-01-15', lang }), // 10 credits
]);

console.log(lagna.sections[0].heading);
console.log(day.tithi.name, '|', day.nakshatra.name, '|', day.vara.weekday);
console.log(horoscope.headline);

Output:

கும்ப லக்னம்: சனி தரும் கொள்கைப் பிடிப்பும் மனிதநேயமும்
சப்தமி | ரேவதி | வெள்ளிக்கிழமை
குரு கோசாரம் (சிம்மம்): இன்று நல்ல அறிகுறிகள் உள்ளன

Keep the API key on your server. Do not ship it inside a browser or mobile bundle.

6. The same with fetch

No SDK is needed. This helper adds the language to any request.

const BASE = 'https://api.lifeastroapi.com';

async function astro(path, params, lang = 'en') {
  const q = new URLSearchParams({ ...params, lang });
  const res = await fetch(`${BASE}${path}?${q}`, {
    headers: { Authorization: `Bearer ${process.env.LIFEASTRO_API_KEY}` },
  });
  if (!res.ok) throw new Error(`HTTP ${res.status}`);
  return res.json();
}

const horoscope = await astro('/v1/horoscope/daily', { rashi: 'Mesha', date: '2027-01-15' }, 'ta');
console.log(horoscope.lucky.color, horoscope.lucky.direction);

Output:

சிவப்பு தெற்கு

7. Keys and ids stay in English

Switching language changes values that a person reads. It does not change the shape of the response. Here is the Sun from /v1/chart/planets with lang=ta for the same birth:

{
  "id": "sun",
  "name": "சூரியன்",
  "sign_index": 9,
  "house": 12,
  "nak_lord": "சூரியன்",
  "is_retro": false
}
  • JSON keys such as tithi, name and end_local are the same in every language.
  • Ids such as sun and vedic.L1.lagna.aquarius stay in English.
  • Numbers, indexes, dates and times are the same.
  • Display fields such as name, heading, body and bullets change.

So the code that reads the response does not change. Only the text on screen does.

8. Switch language per user

Store a language code with each user and pass it on every call. Fall back to English when the user has no language or one you do not offer.

import { LifeAstro } from 'lifeastroapi';

const astro = new LifeAstro({ apiKey: process.env.LIFEASTRO_API_KEY });

const COMPLETE = ['en', 'hi', 'mr', 'gu', 'te', 'ta', 'kn', 'ml'];
const langFor = (user) => (COMPLETE.includes(user.lang) ? user.lang : 'en');

const users = [{ id: 1, lang: 'ta' }, { id: 2, lang: 'hi' }, { id: 3 }];

for (const user of users) {
  const day = await astro.panchang.basic({
    lat: 13.0827, lon: 80.2707, tz: 'Asia/Kolkata', date: '2027-01-15',
    lang: langFor(user),
  });
  console.log(user.id, day.tithi.index, day.tithi.name, day.vara.weekday);
}

Output:

1 6 சப்தமி வெள்ளிக்கிழமை
2 6 सप्तमी शुक्रवार
3 6 Saptami Friday

The tithi index is 6 for all three users. Only the names differ. If you cache responses, add the language to the cache key. When we sent a code the API does not know (lang=fr), it answered in English with HTTP 200, so check the code on your side as above.

9. Show Tamil script correctly

  • Use a font that covers Tamil. Current Android, iOS, macOS and Windows have a system Tamil font. If you load a web font for Latin text only, add one with Tamil coverage, for example Noto Sans Tamil, so the browser does not fall back to a mismatched face.
  • Set lang="ta" on the element. Browsers use it to choose the font and line breaking, and screen readers use it to choose the voice.
  • Give lines more room. Tamil has vowel signs above, below and beside the consonant. A line height of about 1.7 keeps lines from touching.
  • Do not cut text by character count. A vowel sign is its own code point, and slice() can separate it from its consonant. Use CSS text-overflow: ellipsis or Intl.Segmenter.
  • Keep the paragraph breaks. Split body on \n\n and render one paragraph per part.
  • Expect longer payloads. A Tamil letter takes three bytes in UTF-8. The horoscope response above is about 25 KB in Tamil and about 8 KB in English.
/* CSS */
.reading {
  font-family: "Noto Sans Tamil", system-ui, sans-serif;
  line-height: 1.7;
}

// React: one <p> per paragraph, language set on the container.
function Reading({ section, lang }) {
  return (
    <section lang={lang} className="reading">
      <h3>{section.heading}</h3>
      {section.body.split('\n\n').map((para, i) => <p key={i}>{para}</p>)}
      <ul>
        {section.bullets.map((b, i) => <li key={i}>{b}</li>)}
      </ul>
    </section>
  );
}

10. What stays in English

  • Western astrology endpoints (/v1/western/...) answer in English with lang=ta.
  • Tarot endpoints (/v1/tarot/...) answer in English.
  • Place search and the endpoint catalog are in English.
  • Endpoints that return only times, numbers or ids have nothing to translate.

11. The same code for other languages

Ten languages: English (en), Hindi (hi), Marathi (mr), Gujarati (gu), Bengali (bn), Telugu (te), Tamil (ta), Kannada (kn), Malayalam (ml) and Punjabi (pa). Change the code and nothing else. An endpoint costs the same credits in every language, and the free tier (7,500 welcome credits, then 1,500 a month) includes all of them.

Next steps