Skip to content
96Astro API

By topic / PHP and Laravel

Integrations

Astrology API for PHP and Laravel

Install the official PHP client from Packagist. It reads the key from `ASTRO_API_KEY`, retries rate limits for you, adds idempotency keys, and ships a Laravel service provider and an `Astro96` facade. Inside WordPress it uses the WordPress HTTP API.

Ideas

What people build with it

  • A kundli page in a Laravel app

  • A WordPress plugin with a daily panchang

  • Matching on a PHP matrimony site

Reference

The endpoints

Try them in API testing

Code

Your first call

Install
composer require 96astro/api
PHP
use Astro96\Api\Client;

$astro = new Client(); // reads ASTRO_API_KEY

$res = $astro->vedicCharts->planetPositions([
    'datetime' => '1990-10-18T14:30:00', 'timezone' => 'Asia/Kolkata',
    'latitude' => 28.6139, 'longitude' => 77.209,
]);
echo $res->data['ascendant']['sign'];
Laravel (facade)
use Astro96\Api\Laravel\Facades\Astro96;

$chart = Astro96::client()->vedicCharts->planetPositions($birth)->data;

FAQ

Common questions

Which PHP versions?

PHP 8.1 and later. It uses Guzzle when installed, otherwise ext-curl or any PSR-18 client.

Where does the key go?

In your server environment (ASTRO_API_KEY in .env), never in front-end code.

Guides

Read next

Start building with PHP and Laravel

5,000 free trial credits. No card required.

Send us feedback

What is it about?