// sdk · PHP
PHP SDK pentru AstroWay API
Oficial `astroway/sdk` pe Packagist — construit pe Guzzle 7 + PSR-18. PHP 8.1+ (proprietăți doar pentru citire, promovare constructor). Ierarhie de erori în stil Stainless, middleware de retry încorporat pe 408/409/429/5xx, două scheme de autentificare (X-Api-Key implicit sau Bearer).
// 01 / install
Instaleaz
composer require astroway/sdk import: use Astroway\Astroway;
Vezi n registru → astroway/sdk
// 02 / highlights
Caracteristici
- PHP 8.1+
- Guzzle 7 + PSR-18
- Middleware de retry încorporat
- Erori în stil Stainless
- Auto-oglindă pe Packagist
// 03 / first request
Primul request
<?php
use Astroway\Astroway;
$aw = new Astroway(['apiKey' => getenv('ASTROWAY_API_KEY')]);
$chart = $aw->post('/chart', body: [
'date' => '1990-07-14',
'time' => '14:30:00',
'timezoneOffset' => 3,
'latitude' => 50.4501,
'longitude' => 30.5234,
'houseSystem' => 'P',
]);
echo $chart['angles']['asc']['sign']; Start cu PHP
10 000 de credite gratuite pe lun. SDK open-source, generat din OpenAPI 3.1, mereu sincronizat cu backend-ul.