A clean, service-oriented PHP SDK for the AstrologyAPI.com / SkyVedic API. Covers all endpoints: Horoscope, Dasha, Panchang, MatchMaking, KP, Lal Kitab, Varshaphal, Numerology, Dosha/Remedies, and more.
| Component | Version |
|---|---|
| PHP | 7.3 – 8.2 |
| Laravel | 7.x – 12.x |
| Guzzle | ^6.5 or ^7.0 |
composer require lt-25/astrology-apiThe service provider and facade are registered automatically via Laravel's package auto-discovery (extra.laravel in composer.json).
php artisan vendor:publish --tag=skyledic-astrology-api-configThis creates config/astrology-api.php.
Add these keys to your .env:
ASTROLOGY_API_BASE_URL=https://json.astrologyapi.com
ASTROLOGY_API_VERSION=v1
ASTROLOGY_API_USER_ID=your_user_id
ASTROLOGY_API_KEY=your_api_key
ASTROLOGY_API_LANGUAGE=en
ASTROLOGY_API_TIMEOUT=30
ASTROLOGY_API_VERIFY_SSL=true
# For SkyVedic local mirror:
# ASTROLOGY_API_BASE_URL=http://localhost:3000use SkyVedic\AstrologyApi\Facades\AstrologyApi;
use SkyVedic\AstrologyApi\BirthData;
$bd = new BirthData(27, 6, 2000, 15, 30, 25.7464, 82.6837, 5.5);
// Planets
$planets = AstrologyApi::horoscope()->planets($bd);
// Birth details
$birth = AstrologyApi::horoscope()->birthDetails($bd);
// Current dasha
$dasha = AstrologyApi::dasha()->currentVdashaAll($bd);
// Panchang
$panchang = AstrologyApi::panchang()->basicPanchang($bd);use SkyVedic\AstrologyApi\AstrologyApi;
use SkyVedic\AstrologyApi\BirthData;
class AstrologyController extends Controller
{
protected $api;
public function __construct(AstrologyApi $api)
{
$this->api = $api;
}
public function planets()
{
$bd = new BirthData(27, 6, 2000, 15, 30, 25.7464, 82.6837, 5.5);
return $this->api->horoscope()->planets($bd);
}
}use SkyVedic\AstrologyApi\AstrologyApi;
use SkyVedic\AstrologyApi\BirthData;
$api = new AstrologyApi('your_user_id', 'your_api_key');
$bd = new BirthData(27, 6, 2000, 15, 30, 25.7464, 82.6837, 5.5);
$planets = $api->horoscope()->planets($bd);$api->geo()->geoDetails('Mumbai', 6);
$api->geo()->timezoneWithDst($day, $month, $year, $hour, $min, $lat, $lon, $tzone);$api->horoscope()->birthDetails($bd);
$api->horoscope()->astroDetails($bd);
$api->horoscope()->planets($bd);
$api->horoscope()->planetsExtended($bd, '#FF0000', '#00FF00', '#0000FF', 'north');
$api->horoscope()->planetNature($bd);
$api->horoscope()->horoChart($bd, 'D9'); // D1, D2, D3, D7, D9, D10, D12...
$api->horoscope()->horoChartImage($bd, 'D9');
$api->horoscope()->horoChartExtended($bd);
$api->horoscope()->ayanamsha($bd);
$api->horoscope()->bhavMadhya($bd);
$api->horoscope()->ghatChakra($bd);
$api->horoscope()->panchadaMaitri($bd);
$api->horoscope()->planetAshtak($bd, 'mars'); // sun,moon,mars,mercury,venus,jupiter,saturn
$api->horoscope()->sarvashtak($bd);
$api->horoscope()->biorhythm($bd);
$api->horoscope()->moonBiorhythm($bd);$api->dasha()->currentVdasha($bd);
$api->dasha()->currentVdashaAll($bd);
$api->dasha()->majorVdasha($bd);
$api->dasha()->subVdasha($bd, 'jupiter');
$api->dasha()->subSubVdasha($bd, 'mars', 'mars');
$api->dasha()->subSubSubVdasha($bd, 'mars', 'jupiter', 'rahu');
$api->dasha()->subSubSubSubVdasha($bd, 'mars', 'jupiter', 'rahu', 'venus');
$api->dasha()->majorYoginiDasha($bd);
$api->dasha()->currentYoginiDasha($bd);
$api->dasha()->subYoginiDasha($bd, 1, 'ulka');
$api->dasha()->currentCharDasha($bd);
$api->dasha()->majorCharDasha($bd);
$api->dasha()->subCharDasha($bd, 'aries');$api->panchang()->basicPanchang($bd);
$api->panchang()->basicPanchangSunrise($bd);
$api->panchang()->advancedPanchang($bd);
$api->panchang()->advancedPanchangSunrise($bd);
$api->panchang()->planetPanchang($bd);
$api->panchang()->planetPanchangSunrise($bd);
$api->panchang()->panchangChartSunrise($bd);
$api->panchang()->monthlyPanchang($bd);
$api->panchang()->tamilPanchang($bd);
$api->panchang()->tamilMonthPanchang($bd);
$api->panchang()->panchangFestival($bd);
$api->panchang()->horaMuhurta($bd);
$api->panchang()->horaMuhurtaDinman($bd);
$api->panchang()->chaughadiyaMuhurta($bd);$male = new BirthData(25, 12, 1988, 4, 0, 25.123, 82.34, 5.5);
$female = new BirthData(9, 12, 1990, 12, 56, 25.123, 82.34, 5.5);
$api->matchMaking()->matchBirthDetails($male, $female);
$api->matchMaking()->matchObstructions($male, $female);
$api->matchMaking()->matchAstroDetails($male, $female);
$api->matchMaking()->matchPlanetDetails($male, $female);
$api->matchMaking()->matchManglikReport($male, $female);
$api->matchMaking()->matchAshtakootPoints($male, $female);
$api->matchMaking()->matchDashakootPoints($male, $female);
$api->matchMaking()->matchPercentage($male, $female);
$api->matchMaking()->matchMakingReport($male, $female);
$api->matchMaking()->matchMakingDetailedReport($male, $female);
$api->matchMaking()->simpleManglik($bd);$api->numerology()->numeroTable(10, 5, 1990, 'Rahul');
$api->numerology()->numeroReport(10, 5, 1990, 'Rahul');
$api->numerology()->numeroFavTime(10, 5, 1990, 'Rahul');
$api->numerology()->numeroPlaceVastu(10, 5, 1990, 'Rahul');
$api->numerology()->numeroFastsReport(10, 5, 1990, 'Rahul');
$api->numerology()->numeroFavLord(10, 5, 1990, 'Rahul');
$api->numerology()->numeroFavMantra(10, 5, 1990, 'Rahul');
$api->numerology()->numeroPredictionDaily(10, 5, 1990, 'Rahul');$api->dosha()->kalsarpaDetails($bd);
$api->dosha()->sadhesatiCurrentStatus($bd);
$api->dosha()->sadhesatiLifeDetails($bd);
$api->dosha()->sadhesatiRemedies($bd);
$api->dosha()->pitraDosha($bd);
$api->dosha()->gemSuggestion($bd);
$api->dosha()->pujaSuggestion($bd);
$api->dosha()->rudrakshaSuggestion($bd);$api->prediction()->dailyNakshatraPrediction($bd);
$api->prediction()->dailyNakshatraPredictionNext($bd);
$api->prediction()->dailyNakshatraPredictionPrevious($bd);
$api->prediction()->generalAscendantReport($bd);
$api->prediction()->generalNakshatraReport($bd, 'male');
$api->prediction()->generalHouseReport($bd, 'sun');
$api->prediction()->generalRashiReport($bd, 'moon');$api->kp()->kpPlanets($bd);
$api->kp()->kpHouseCusps($bd);
$api->kp()->kpBirthChart($bd);
$api->kp()->kpHouseSignificator($bd);
$api->kp()->kpPlanetSignificator($bd);
$api->kp()->kpHoroscope($bd, 'major');$api->lalKitab()->horoscope($bd);
$api->lalKitab()->debts($bd);
$api->lalKitab()->remedies($bd, 'sun');
$api->lalKitab()->houses($bd);
$api->lalKitab()->planets($bd);$api->varshaphal()->yearChart($bd);
$api->varshaphal()->monthChart($bd);
$api->varshaphal()->details($bd);
$api->varshaphal()->planets($bd);
$api->varshaphal()->muntha($bd);
$api->varshaphal()->muddaDasha($bd);
$api->varshaphal()->panchavargeeya($bd);
$api->varshaphal()->harshaBala($bd);
$api->varshaphal()->yoga($bd);
$api->varshaphal()->sahamPoints($bd);$api->transit()->upcomingHouseChanges($bd, 'Delhi', 'LAHIRI', 'P', '2024-08-21T14:00:00', 30, true);use SkyVedic\AstrologyApi\BirthData;
$bd = new BirthData(
day: 27,
month: 6,
year: 2000,
hour: 15,
min: 30,
lat: 25.7464,
lon: 82.6837,
tzone: 5.5
);| Value | System |
|---|---|
LAHIRI |
Default — Lahiri (Chitrapaksha) |
KP_OLD |
KP Old |
KP_NEW |
KP New (recommended for KP system) |
YUKTESHWAR |
Yukteshwar |
RAMAN |
Raman |
JN_BHASIN |
JN Bhasin |
FAGAN_BRADLEY |
Fagan Bradley (Western Sidereal) |
use SkyVedic\AstrologyApi\Exceptions\AstrologyApiException;
use SkyVedic\AstrologyApi\Exceptions\AuthenticationException;
use SkyVedic\AstrologyApi\Exceptions\ValidationException;
try {
$result = AstrologyApi::horoscope()->planets($bd);
} catch (AuthenticationException $e) {
// Invalid API key or user ID
} catch (ValidationException $e) {
// Invalid request parameters
} catch (AstrologyApiException $e) {
// Other API errors
}// Set Hindi response language
AstrologyApi::setLanguage('hi');
// Or at construction time (standalone)
$api = new AstrologyApi($userId, $apiKey);
$api->setLanguage('hi');MIT