PHPackages                             astroinsightapi/astroinsight-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. astroinsightapi/astroinsight-php-sdk

ActiveLibrary

astroinsightapi/astroinsight-php-sdk
====================================

Official PHP SDK for the Astro Insight API - Astrology, Numerology, Panchang, Tarot, and Divination services.

v1.0.1(yesterday)04↓50%MITPHPPHP &gt;=8.1

Since Aug 16Pushed yesterdayCompare

[ Source](https://github.com/AstroInsightApi/astroinsight-php-sdk)[ Packagist](https://packagist.org/packages/astroinsightapi/astroinsight-php-sdk)[ RSS](/packages/astroinsightapi-astroinsight-php-sdk/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

Astro Insight PHP SDK
=====================

[](#astro-insight-php-sdk)

[![Latest Stable Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://packagist.org/packages/astro-insight/php-sdk)[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

Official, strongly-typed **PHP 8.1+ SDK** for the **Astro Insight API**. Easily integrate comprehensive Vedic Astrology, Western Astrology, Matchmaking, Panchang, Muhurta, Tarot, Numerology, Chinese Astrology, and Geolocation calculations into your PHP applications.

---

Features
--------

[](#features)

- 🪐 **Vedic Astrology**: Ashtakvarga, Vimshottari / Char / Yogini Dashas, KP System, Jaimini, Lal Kitab, Varshaphal, Ghat Chakra, Horoscope Charts &amp; Doshas.
- 💍 **Matchmaking**: Guna Milan, Kundali Compatibility, Manglik Matching.
- 🗓️ **Panchang &amp; Muhurta**: Daily Panchang, Choghadiya, Hora, Shubh Muhurta timing.
- 🔮 **Western Astrology &amp; Tarot**: Natal Charts, Solar Return, Daily/Weekly/Monthly Transits, Synastry, Tarot spreads (One-card, Three-card, Celtic Cross, Love, Career).
- 🔢 **Numerology**: Vedic &amp; Western Numerology (Life Path, Destiny, Soul Urge).
- ☯️ **Chinese Astrology &amp; Biorhythm**: Zodiac sign compatibility &amp; biorhythm calculations.
- 🌍 **Geo Utilities**: Place search, timezone lookup by coordinates or ID.
- 🛡️ **Strongly Typed DTOs**: Clean `BirthDetails`, `MatchInput`, and `GeoLocation` objects.
- ⚡ **PSR-4 Compliant &amp; Guzzle Powered**: Exception handling for authentication, validation (422), rate limits (429), and server errors.

---

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require astroinsightapi/astroinsight-php-sdk
```

---

Quick Start
-----------

[](#quick-start)

### 1. Initialize the Client

[](#1-initialize-the-client)

```
use AstroInsight\AstroClient;

$astro = new AstroClient(
    clientId: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
    baseUrl: 'https://json.astroinsightapi.com/api/v1', // Optional
    language: 'en',                             // Optional (e.g. 'hi', 'es')
    ayanamsha: 'lahiri'                         // Optional (e.g. 'raman', 'kp')
);
```

### 2. Using Data Transfer Objects (DTOs)

[](#2-using-data-transfer-objects-dtos)

Create a `BirthDetails` object for birth chart calculations:

```
use AstroInsight\DTO\BirthDetails;

$birth = new BirthDetails(
    day: 15,
    month: 8,
    year: 1995,
    hour: 10,
    min: 30,
    sec: 0,
    tzone: 5.5,
    lat: 28.6139,
    lon: 77.2090
);
```

---

Code Examples
-------------

[](#code-examples)

### 🪐 Vedic Astrology &amp; Dashas

[](#-vedic-astrology--dashas)

```
// 1. Get Sun Bhinnashtakavarga
$sunAshtak = $astro->vedic->ashtakvarga->getPlanetAshtak('sun', $birth);

// 2. Fetch Major Vimshottari Dasha
$vimshottari = $astro->vedic->vimshottariDasha->getMajorDasha($birth);

// 3. Get Gemstone & Rudraksha Remedies
$gemstones = $astro->vedic->suggestions->getGemstoneSuggestions($birth);

// 4. Check Manglik Dosha
$manglik = $astro->vedic->horoscopeDosha->getManglikDosha($birth);
```

### 💍 Matchmaking (Guna Milan)

[](#-matchmaking-guna-milan)

```
use AstroInsight\DTO\MatchInput;

$maleBirth = new BirthDetails(15, 8, 1995, 10, 30, lat: 28.6139, lon: 77.2090);
$femaleBirth = new BirthDetails(20, 11, 1997, 14, 15, lat: 19.0760, lon: 72.8777);

$matchInput = new MatchInput($maleBirth, $femaleBirth);

// Calculate Guna Milan
$gunaScore = $astro->vedic->matchMaking->getGunaMilan($matchInput);
```

### 🗓️ Daily Panchang &amp; Muhurta

[](#️-daily-panchang--muhurta)

```
// Daily Panchang
$panchang = $astro->vedic->panchang->getDailyPanchang($birth);

// Choghadiya Timings
$choghadiya = $astro->vedic->muhurta->getChoghadiya($birth);
```

### 🔮 Tarot Readings

[](#-tarot-readings)

```
// One Card Tarot Reading
$oneCard = $astro->tarot->getOneCardReading();

// Three Card Tarot Reading
$threeCard = $astro->tarot->getThreeCardReading();

// Yes / No Tarot Reading
$yesNo = $astro->tarot->getYesNoReading();
```

### 📊 Horoscope Predictions

[](#-horoscope-predictions)

```
// Daily Horoscope for Leo
$leoDaily = $astro->horoscope->getDailyHoroscope('leo');

// Monthly Horoscope for Aries
$ariesMonthly = $astro->horoscope->getMonthlyHoroscope('aries');
```

---

Dynamic Configuration &amp; Headers
-----------------------------------

[](#dynamic-configuration--headers)

You can update the default language or Ayanamsha dynamically on the client:

```
// Switch language to Hindi
$astro->setLanguage('hi');

// Switch Ayanamsha calculation system
$astro->setAyanamsha('raman');
```

---

Exception Handling
------------------

[](#exception-handling)

All API errors throw domain-specific exceptions extending `AstroInsight\Exceptions\AstroException`:

```
use AstroInsight\Exceptions\AuthenticationException;
use AstroInsight\Exceptions\ValidationException;
use AstroInsight\Exceptions\RateLimitException;
use AstroInsight\Exceptions\AstroException;

try {
    $response = $astro->vedic->panchang->getDailyPanchang($birth);
} catch (AuthenticationException $e) {
    echo "Invalid Client ID or Secret: " . $e->getMessage();
} catch (ValidationException $e) {
    echo "Validation failed: " . $e->getMessage();
    print_r($e->getErrors());
} catch (RateLimitException $e) {
    echo "Rate limit exceeded. Try again later.";
} catch (AstroException $e) {
    echo "API Error: " . $e->getMessage();
}
```

---

Running Tests
-------------

[](#running-tests)

To run the unit test suite using PHPUnit:

```
php composer.phar install
./vendor/bin/phpunit
```

---

License
-------

[](#license)

This SDK is open-sourced software licensed under the [MIT License](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/99c79b3437e13abe4bb660eb341e4871628b6b57b9dc26ae8692f7d4f738f448?d=identicon)[AstroInsightApi](/maintainers/AstroInsightApi)

---

Top Contributors

[![AstroInsightApi](https://avatars.githubusercontent.com/u/267749309?v=4)](https://github.com/AstroInsightApi "AstroInsightApi (6 commits)")

---

Tags

sdkhoroscopeastrologyvedic astrologynumerologytarotpanchangastro-insight

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/astroinsightapi-astroinsight-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/astroinsightapi-astroinsight-php-sdk/health.svg)](https://phpackages.com/packages/astroinsightapi-astroinsight-php-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k54](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
