Ashtakavarga API with Swift Ui

Integrate Ashtakavarga API in Swift Ui. Complete code examples and SDK documentation.

Operation

POST /v2/astrology/ashtakavarga

Bhinnashtakavarga bindu scores for one planet or all 7 planets (BPHS Ch.66)

Parameters

NameInTypeDescription
datetimebodystring—
latitudebodynumber—
longitudebodynumber—
timezonebodystring—
planetbodystring—
planetquerystringOptional (body or query): sun, moon, mars, mercury, jupiter, venus, saturn. Omitted = all

Request example for SwiftUI

Authenticate with Authorization: Bearer YOUR_API_KEY. This code runs on your users’ devices, so it must not hold your API key. Call a route on your own backend that adds the Authorization: Bearer YOUR_API_KEY header and forwards the request.

import Foundation

// Runs on the device: call your own backend, not api.vedika.io.
func load() async throws -> Data {
    let url = URL(string: "https://your-backend.example.com/vedika/ashtakavarga")!
    let (data, _) = try await URLSession.shared.data(from: url)
    return data
}

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/ashtakavarga \
  -H "Content-Type: application/json" \
  -d '{"datetime":"1990-05-15T10:30:00","latitude":19.07,"longitude":72.87,"timezone":"+05:30","planet":"jupiter"}'

Sandbox response from POST /sandbox/astrology/ashtakavarga, 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": {
    "averageBindus": 28.083333333333332,
    "bhinnashtakavarga": {
      "Jupiter": {
        "planet": "Jupiter",
        "points": [
          5
        ],
        "strongSigns": [
          {
            "points": 7,
            "sign": "Leo",
            "signIndex": 4
          }
        ],
        "total": 56
      },
      "Mars": {
        "interpretation": "Mars gives its most favorable transit results in Taurus, Libra, Virgo, Aquarius (5+ bindus); low-bindu signs are weaker Mars transit periods.",
        "planet": "Mars",
        "points": [
          4
        ],
        "strongSigns": [
          {
            "points": 6,
            "sign": "Taurus",
            "signIndex": 1
          }
        ],
        "total": 39
      },
      "Mercury": {
        "planet": "Mercury",
        "points": [
          5
        ],
        "strongSigns": [
          {
            "points": 6,
            "sign": "Virgo",
            "signIndex": 5
          }
        ],
        "total": 54
      },
      "Moon": {
        "planet": "Moon",
        "points": [
          3
        ],
        "strongSigns": [
          {
            "points": 6,
            "sign": "Taurus",
            "signIndex": 1
          }
        ],
        "total": 49
      },
      "Saturn": {
        "interpretation": "Saturn gives its most favorable transit results in Libra (5+ bindus); low-bindu signs are weaker Saturn transit periods.",
        "planet": "Saturn",
        "points": [
          3
        ],
        "strongSigns": [
          {
            "points": 6,
            "sign": "Libra",
            "signIndex": 6
          }
        ],
        "total": 39
      },
      "Sun": {
        "interpretation": "Sun gives its most favorable transit results in Taurus, Virgo, Leo, Libra, Aquarius (5+ bindus); low-bindu signs are weaker Sun transit periods.",
        "planet": "Sun",
        "points": [
          4
        ],
        "strongSigns": [
          {
            "points": 6,
            "sign": "Taurus",
            "signIndex": 1
          }
        ],
        "total": 48
      }
    },
    "interpretation": "Libra is the most fortified sign in this chart (37 total bindus, vs the ~28-bindu average) — the area it rules tends to support the native most.",
    "meta": {
      "ayanamsa": 23.79065,
      "calculator": "vedika-ephemeris",
      "houseSystem": "whole-sign"
    },
    "prashtarashtakavarga": [
      {
        "bindus": [
          4
        ],
        "planet": "Sun",
        "total": 48
      }
    ],
    "sarvashtakavarga": [
      29
    ]
  },
  "meta": {
    "contentMode": "fixture",
    "engine": "vedika-intelligence",
    "fixtureId": "demo-birth-1995-new-delhi",
    "inputUsage": "ignored",
    "mode": "sandbox",
    "sample": true
  },
  "success": true
}

Related

Last updated: 22 November 2026

Start 14-day trial