RepositoryC
teal33t

teal33t/jyotish-api

Jyotish API, Self-Hosted Vedic Astrology Calculations REST API

88stars
48forks
0issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: jyotish

#1 Repository of the month

1
TINIX TRENDING·Topic: vedic-astrology

#1 Repository of the month

Jyotish API

A REST API for Jyotish (Vedic Astrology) calculations, built on top of the kunjara/jyotish library. Jyotish API containerized and provides a wide range of Vedic astrology calculations, including planetary positions, Dashas, Yogas, and more.

Features

Chart Calculations

  • Varga (Divisional) Charts: D1, D2, D3, D4, D7, D9, D10, D12, D16, D20, D24, D27, D30, D40, D45, D60
  • Planetary Positions: Detailed positions of planets, Surya (Sun), Chandra (Moon), Mangal (Mars), Buddha (Mercury), Guru (Jupiter), Shukra (Venus), Shani (Staurn), Rahu and Ketu.
  • Lagna (Ascendant) Calculations.
  • Nakshatra Positions: Lunar mansions.

Advanced Calculations

Basic Information

  • Astangata (Combustion): Analysis of planets combust due to proximity to the Sun.
  • Rashi Avastha (Planetary Dignity): Calculation of planetary dignity in different signs.
  • Vargottama: Identification of planets occupying the same sign in both Rashi and Navamsa charts.
  • Planetary War (Yuddha): Detection of planetary wars when planets are within 1 degree of each other.

Panchanga Elements

  • Tithi: Lunar day calculation.
  • Nakshatra: Determination of the current lunar mansion.
  • Yoga: Calculation of the Yoga formed by the positions of the Sun and Moon.
  • Karana: Half of a Tithi, used in muhurta (electional astrology).
  • Vara: Day of the week.

Strength Calculations

  • Ashtakavarga: Point-based system to analyze planetary strengths.
  • Graha Bala (Planetary Strength): Comprehensive strength analysis of planets.
  • Rashi Bala (Sign Strength): Strength of the zodiac signs.

Yoga Calculations

  • Dhana Yoga: Wealth-producing combinations.
  • Mahapurusha Yoga: Great person yogas formed by certain planetary positions.
  • Nabhasha Yoga: Yogas based on planetary patterns.
  • Parivarthana Yoga: Mutual exchange of signs between planets.
  • Raja Yoga: Combinations indicating power and authority.
  • Sannyasa Yoga: Combinations indicating renunciation.

Additional Features

  • Automatic Timezone Detection: Adjusts calculations based on the provided location. [DISABLED]
  • DST Handling: Accounts for Daylight Saving Time shifts.
  • Ayanamsha Calculations: Adjustments for the precession of the equinoxes.
  • Dasha Calculations (Vimshottari): Planetary periods analysis.
  • Supported Ayanamshas: Deluce ,Djwhalkhul ,Fagan ,Jnbhasin ,Krishnamurti ,Lahiri ,Raman ,Sassanian ,Ushashashi ,Yukteshwar

Literature

Most of the calculations are based on the following classical texts:

Installation

To install and run the Vedic Astrology API locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/teal33t/jyotish-api.git
    cd jyotish-api
    
  2. Build and start the Docker container:

    docker-compose up --build -d
    
  3. Compile the Swiss Ephemeris library inside the container:

    docker-compose exec jyotish_api bash -c "cd swetest/src && make clean && make && chmod 777 swetest/src && chmod +x swetest/src/swetest"
    
  4. Verify the API is running:

    Visit http://localhost:9393/api/ping to check if the API is up and running.

API Documentation

The API documentation is available via Swagger UI:

Swagger

API Endpoints

Health Check

GET /api/ping

Verifies if the API is running.

Response:

{
    "pong": "success"
}

Calculate Chart

GET /api/calculate

Calculates chart based on provided parameters.

Request

http://localhost:9393/api/calculate?latitude=28.6139&longitude=77.209&year=2023&month=12&day=25&hour=12&min=0&sec=0&time_zone=%2B03%3A30&dst_hour=0&dst_min=0&nesting=0&varga=D1%2CD9&infolevel=basic%2Cpanchanga%2Ctransit

Query Parameters:

ParameterTypeRequiredDescriptionExample
latitudefloatYesLocation latitude28.6139
longitudefloatYesLocation longitude77.2090
yearintegerYesYear for calculation2023
monthintegerYesMonth for calculation (1-12)12
dayintegerYesDay for calculation (1-31)25
hourintegerYesHour for calculation (0-23)12
minintegerYesMinute for calculation (0-59)0
secintegerYesSecond for calculation (0-59)0
time_zonestringNoTimezone for calculation,+03:30
dst_hourintegerNoDST hours offset0
dst_minintegerNoDST minutes offset0
nestingintegerNoNesting level for calculations0
vargastringNoVarga divisions (comma-separated)D1,D9
infolevelstringNoInfo levels to includebasic,ashtakavarga,grahabala,rashibala,yogas,panchanga,transit
  • You should specify timezone, for example if you are living in Iran you can put that on +03:30.

Timezones:

Please consider time_zone should pad with zero with two digit length and have sign:

Correct: "+01:00", "-01:00"

Incorrect: 1:00, +1:00, 1:0, -1:0, 1, +1, -1

TimezoneCityCountry
-03:00Rio de JaneiroBrazil
-05:00New York (EST)USA
-04:00New York (EDT)USA
+00:00London (GMT)UK
+01:00London (BST)UK
+09:00TokyoJapan
+10:00Sydney (AEST)Australia
+11:00Sydney (AEDT)Australia
+04:00DubaiUAE
+03:00MoscowRussia
+08:00BeijingChina
+05:30DelhiIndia
+01:00Paris (CET)France
+02:00Paris (CEST)France
-08:00Los Angeles (PST)USA
-07:00Los Angeles (PDT)USA
-06:00Chicago (CST)USA
-05:00Chicago (CDT)USA
+02:00JohannesburgSouth Africa
+02:00CairoEgypt
+03:00IstanbulTurkey
+08:00SingaporeSingapore
+07:00BangkokThailand
+09:00SeoulSouth Korea
+07:00Jakarta (WIB)Indonesia
+08:00Jakarta (WITA)Indonesia
+09:00Jakarta (WIT)Indonesia
+08:00ManilaPhilippines
+01:00Berlin (CET)Germany
+02:00Berlin (CEST)Germany
+02:00Helsinki (EEST)Finland
+03:00Helsinki (EET)Finland
+02:00Tel Aviv (IDT)Israel
+03:00Tel Aviv (IST)Israel
+03:00RiyadhSaudi Arabia
+03:00DohaQatar
+03:00Abu DhabiUAE
+03:30TehranIran
-03:00Buenos AiresArgentina
-05:00TorontoCanada
+01:00RomeItaly
+02:00AthensGreece
+01:00MadridSpain
+00:00LisbonPortugal
+01:00AmsterdamNetherlands
+01:00BrusselsBelgium
+01:00ViennaAustria
+01:00ZurichSwitzerland
+08:00Hong KongHong Kong
+08:00Kuala LumpurMalaysia
+12:00AucklandNew Zealand
-06:00Mexico CityMexico
-03:00SantiagoChile
+05:00KarachiPakistan

Response:


{
  "chart": {
    "user": {
      "datetime": "2023-12-25 12:00:00",
      "timezone": "+03:30",
      "longitude": 49.583057,
      "latitude": 37.28077,
      "altitude": 0
    },
    "graha": {
      "Su": {
        "longitude": 248.983163,
        "latitude": 0.0001772,
        "speed": 1.0183709,
        "ascension": 273.4600331,
        "declination": -23.3978588,
        "rashi": 9,
        "degree": 8.98316299999999,
        "nakshatra": {
          "anga": "nakshatra",
          "key": 19,
          "ratio": 1,
          "abhijit": false,
          "left": 32.62627750000016,
          "name": "Moola",
          "pada": 3
        },
        "astangata": null,
        "rashiAvastha": "friend",
        "vargottama": false,
        "yuddha": null,
        "gocharastha": 0,
        "bhavaCharacter": "mishra",
        "tempRelation": {
          "Mo": -1,
          "Ma": 1,
          "Me": -1,
          "Ju": -1,
          "Ve": 1,
          "Sa": 1,
          "Ra": 1,
          "Ke": 1
        },
        "relation": {
          "Mo": 0,
          "Ma": 2,
          "Me": -1,
          "Ju": 0,
          "Ve": 0,
          "Sa": 0,
          "Ra": 0,
          "Ke": 0,
          "Su": null
        },
        "yogakaraka": false,
        "mrityu": false,
        "pushkaraNavamsha": 0,
        "pushkaraBhaga": false,
        "avastha": {
          "baladi": "kumara",
          "jagradi": "swapna",
          "deeptadi": [
            "shanta"
          ]
        },
        "dispositor": "Ju"
      },
      "Mo": {},
      "Ma": {},
      "Me": {},
      "Ju": {},
      "Ve": {},
      "Sa": {},
      "Ra": {},
      "Ke": {},
    },
    "bhava": {
      "1": {
        "longitude": 327.9252867,
        "ascension": 330.1017467,
        "declination": -12.1928517,
        "rashi": 11,
        "degree": 27.925286700000015
      },
      "2": {},
      "3": {},
      "4": {},
      "5": {},
      "6": {},
      "7": {},
      "8": {},
      "9": {},
      "10": {},
      "11": {},
      "12": {},
    },
    "lagna": {
      "Lg": {
        "longitude": 327.9252867,
        "ascension": 330.1017467,
        "declination": -12.1928517,
        "rashi": 11,
        "degree": 27.925286700000015,
        "nakshatra": {
          "anga": "nakshatra",
          "key": 25,
          "ratio": 1,
          "abhijit": false,
          "left": 40.56034975,
          "name": "Purva Bhadrapada",
          "pada": 3
        }
      },
      "MLg": {
        "longitude": 240.7308939,
        "ascension": 238.5809717,
        "declination": -20.3009012,
        "rashi": 9,
        "degree": 0.7308939000000123
      }
    },
    "varga": {
      "D9": {
        "bhava": {
          "1": {
            "rashi": 3,
            "degree": 11.327580300000125,
            "longitude": 71.32758030000012
          },
          "2": {},
          "3": {},
          "4": {},
          "5": {},
          "6": {},
          "7": {},
          "8": {},
          "9": {},
          "10": {},
          "11": {},
          "12": {},
        },
        "graha": {
          "Su": {
            "rashi": 3,
            "degree": 20.84846699999991,
            "speed": 1.0183709,
            "longitude": 80.84846699999991
          },
          "Mo": {},
          "Ma": {},
          "Me": {},
          "Ju": {},
          "Ve": {},
          "Sa": {},
          "Ra": {},
          "Ke": {},
        },
        "lagna": {
          "Lg": {
            "rashi": 3,
            "degree": 11.327580300000125,
            "longitude": 71.32758030000012
          },
          "MLg": {
            "rashi": 1,
            "degree": 6.578045100000111,
            "longitude": 6.578045100000111
          }
        }
      }
    },
    "panchanga": {
      "tithi": {
        "anga": "tithi",
        "key": 14,
        "name": "Chaturdashi",
        "paksha": "shukla",
        "left": 75.43356083333303
      },
      "nakshatra": {
        "anga": "nakshatra",
        "key": 4,
        "ratio": 1,
        "abhijit": false,
        "left": 40.51648225000003,
        "name": "Rohini",
        "pada": 3
      },
      "yoga": {
        "anga": "yoga",
        "key": 23,
        "name": "Shubha",
        "left": 73.14275974999997
      },
      "vara": {
        "anga": "vara",
        "left": 81.29129302863754,
        "key": "Mo",
        "week": "1",
        "name": "Somavar"
      },
      "karana": {
        "anga": "karana",
        "key": 5,
        "name": "Gara",
        "left": 50.867121666666065
      }
    },
    "rising": {
      "Su": [
        {
          "rising": "2023-12-24 07:30:04",
          "setting": "2023-12-24 17:40:54"
        },
        {
          "rising": "2023-12-25 07:30:31",
          "setting": "2023-12-25 17:41:27"
        },
        {
          "rising": "2023-12-26 07:30:56",
          "setting": "2023-12-26 17:42:02"
        }
      ]
    },
    "kala": {
      "hora": {
        "number": 7,
        "key": "Me",
        "interval": 3054.6666666666665,
        "left": 47.173723264949835,
        "type": "yama",
        "end": "2023-12-25 13:26:54"
      }
    },
    "dasha": {
      "nesting": 0,
      "type": "vimshottari",
      "key": "",
      "duration": 3786834240,
      "start": "2018-01-12 22:49:09",
      "end": "2138-01-13 01:13:09",
      "periods": {
        "Mo": {
          "nesting": 1,
          "type": "mahadasha",
          "key": "Mo",
          "duration": 315569520,
          "start": "2018-01-12 22:49:09",
          "end": "2028-01-13 09:01:09"
        },
        "Ma": {},
        "Ra": {},
        "Ju": {},
        "Sa": {},
        "Me": {},
        "Ke": {},,
        "Ve": {},,
        "Su": {},
      }
    }
  },
  "duration_of_response": 0.12,
  "created_at": "2025-02-08 23:55:46"
}

Current Time Chart

GET /api/now

Calculates chart for the current moment.

Query Parameters:

ParameterTypeRequiredDescriptionDefault
latitudefloatNoLocation latitude35.7219
longitudefloatNoLocation longitude51.3347

Response:

{
    "chart": { /* Chart data */ },
    "duration_of_response": 0.123,
    "created_at": "2023-12-25 12:00:00"
}

Error Handling

In case of errors, the API returns a JSON response with an error message and appropriate HTTP status code:

{
    "status": 400,
    "message":"No route found for GET http://localhost:9393/api/not_registered_route/"
}

Support

For issues, feature requests, or questions, please open an issue in the GitHub repository.

License

It's free. Om Tat Sat

Similar Projects

Discover other similar projects and AI models.

Dataset
OurNakshatra/ournakshatra-vedic-astrology-core

OurNakshatra Vedic Astrology Core Dataset Dataset Summary The ournakshatra-vedic-astrology-core dataset is a highly structured, expert-curated collection of 602 Q&A pairs covering foundational and advanced concepts in Vedic Astrology (Jyotish). It was developed by the team at OurNakshatra to address the severe lack of high-quality, hallucination-free Vedic astrology training data available to the open-source AI community. Modern language models frequently struggle… See the full description on the dataset page: https://huggingface.co/datasets/OurNakshatra/ournakshatra-vedic-astrology-core.

♥0
73
Jun 27, 2026
RepositoryRust
vedika-io/xalen-ephemeris

Pure-Rust astronomical ephemeris for astrology — Vedic, Western, Chinese, and 9 world traditions

832
Nov 30, 2026
RepositoryPython
VedAstro/VedAstro.Python

A Python Libray for Vedic Astrology calculations.

81
Nov 15, 2026
RepositoryJupyter Notebook
diliprk/VedicAstro

A python package for Vedic Astrology, with a particular focus on the Krishnamurthi Paddhati system

69
Jan 7, 2026
RepositoryMarkdown
codecrafters-io/build-your-own-x

Master programming by recreating your favorite technologies from scratch.

567.0k
Nov 19, 2026
Repository
sindresorhus/awesome

😎 Awesome lists about all kinds of interesting topics [NOTE: Pull requests are temporarily disabled until I have a chance to catch up with the existing ones]

546.4k
Sep 2, 2026
RepositoryPython
public-apis/public-apis

A collective list of free APIs

502.6k
Nov 30, 2026
RepositoryTypeScript
morluto/rea

Reverse engineer anything with agents, from app behavior down to native binaries.

487.0k
Dec 2, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026