Dasha Periods API with Rails

Integrate Dasha Periods API in Rails. Complete code examples and SDK documentation.

Operation

POST /v2/astrology/dasha-periods

Get the Vimshottari Dasha periods (Mahadasha/Antardasha ladder, optional depth 1-5) with the current running period and life-phase guidance.

Parameters

NameInTypeDescription
datetimebodystring—
latitudebodynumber—
longitudebodynumber—
timezonebodystring—
depthbodynumber—

Request example for Rails

Authenticate with Authorization: Bearer YOUR_API_KEY. Keep the key in the VEDIKA_API_KEY environment variable on your server and never in source control.

require 'net/http'
require 'json'

def call_vedika
  uri = URI('https://api.vedika.io/v2/astrology/dasha-periods')
  request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
  request['Authorization'] = "Bearer #{ENV.fetch('VEDIKA_API_KEY')}"
  request.body = <<~JSON
    {
      "datetime": "1990-05-15T10:30:00",
      "latitude": 19.07,
      "longitude": 72.87,
      "timezone": "+05:30",
      "depth": 3
    }
  JSON

  Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }
end

# config/routes.rb: get '/vedika/dasha-periods', to: 'vedika#show'
class VedikaController < ApplicationController
  def show
    upstream = call_vedika
    render json: upstream.body, status: upstream.code.to_i
  end
end

Try it in the keyless sandbox

The sandbox mirrors the production route and needs no API key:

curl -X POST https://api.vedika.io/sandbox/astrology/dasha-periods \
  -H "Content-Type: application/json" \
  -d '{"datetime":"1990-05-15T10:30:00","latitude":19.07,"longitude":72.87,"timezone":"+05:30","depth":3}'

Sandbox response from POST /sandbox/astrology/dasha-periods, abridged (billing block, long text fields and long lists trimmed). The sandbox answers with a fixed demo result and ignores your inputs; a production call computes the result for the details you send.

{
  "data": {
    "current_dasha": {
      "antar_dasha": {
        "end_date": "2027-03-24",
        "planet": "Mercury",
        "start_date": "2025-10-22",
        "vedic_name": "Budha"
      },
      "antar_interpretation": {
        "combined_theme": "Moon-Mercury Period",
        "primary_influence": "Moon",
        "secondary_influence": "Mercury"
      },
      "interpretation": {
        "advice": [
          "Practice emotional regulation techniques"
        ],
        "areas_of_focus": [
          "Emotional well-being"
        ],
        "challenges": [
          "Mood swings"
        ],
        "opportunities": [
          "Real estate gains"
        ],
        "remedies": [
          "Worship Divine Mother (Durga, Lakshmi)"
        ]
      },
      "maha_dasha": {
        "end_date": "2029-12-22",
        "planet": "Moon",
        "start_date": "2019-12-23",
        "vedic_name": "Chandra"
      },
      "pratyantar_dasha": {
        "end_date": "2026-12-31",
        "planet": "Jupiter",
        "start_date": "2026-10-23",
        "vedic_name": "Guru"
      }
    },
    "dasha_balance": {
      "days": 20,
      "elapsed_percentage": 5.13,
      "months": 11,
      "planet": "Venus",
      "vedic_name": "Shukra",
      "years": 18
    },
    "guidance": {
      "current_phase": "You are in Moon (Chandra) Maha Dasha",
      "key_advice": [
        "Practice emotional regulation techniques"
      ],
      "recommended_remedies": [
        "Worship Divine Mother (Durga, Lakshmi)"
      ],
      "theme": "Emotions, Mind, and Nurturing",
      "time_remaining": "3 years remaining"
    },
    "maha_dasha": [
      {
        "antar_dasha": [
          {
            "dignity": "neutral",
            "dignity_strength": 1,
            "duration_years": 2.31,
            "end_date": "1997-04-23",
            "is_current": false,
            "planet": "Venus",
            "start_date": "1995-01-01",
            "vedic_name": "Shukra"
          }
        ],
        "dignity": "neutral",
        "dignity_strength": 1,
        "duration_years": 18.97,
        "end_date": "2013-12-22",
        "is_current": false,
        "planet": "Venus",
        "start_date": "1995-01-01",
        "vedic_name": "Shukra"
      }
    ],
    "nakshatra": {
      "id": 20,
      "lord": "Venus",
      "name": "Purva Ashadha",
      "pada": 1
    }
  },
  "meta": {
    "contentMode": "fixture",
    "engine": "vedika-intelligence",
    "fixtureId": "demo-birth-1995-new-delhi",
    "inputUsage": "ignored",
    "mode": "sandbox",
    "sample": true,
    "version": "2.1.0"
  },
  "success": true
}

Related

The same endpoint in other stacks:

Last updated: 22 November 2026

Start 14-day trial