Download the PHP package astroway/sdk without Composer
On this page you can find all versions of the php package astroway/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdk
Short Description Official PHP SDK for the AstroWay API — natal, synastry, transits, Vedic, Human Design, Tarot, Numerology, AI horoscopes. Type-safe, retry-aware, OpenAPI 3.1 generated.
License MIT
Homepage https://api.astroway.info/docs/
Informations about the package sdk
astroway/sdk
Official PHP SDK for the AstroWay API — natal charts, synastry, transits, Vedic dashas, Tarot, Numerology, Human Design, AI horoscopes. Type-safe, retry-aware, PSR-18 compatible.
700+ endpoints. Pure PSR-18 / PSR-17 — bring your own HTTP client (Guzzle, Symfony, Buzz, …) or let auto-discovery pick one. Built-in retry on 408/409/429/5xx with exponential backoff. Stainless-style error hierarchy (AuthenticationError / RateLimitError / BadRequestError / …). PHP 8.1+.
Install
The SDK requires a PSR-18 HTTP client. If you don't already have one, the simplest path is:
Already using Symfony's HTTP client, Buzz, or another PSR-18 implementation? php-http/discovery (a transitive dep of this SDK) auto-finds it. Or pass it explicitly:
Get an API key at https://api.astroway.info/dashboard/sign-up — 10 000 credits/month free, no card required. Each endpoint costs 5–500 credits depending on what it computes (pricing).
Quick start
The SDK exposes 103 typed service namespaces / 623 methods auto-generated from the OpenAPI spec — $aw->synastry()->aspectGrid([...]), $aw->bazi()->dayMaster([...]), $aw->vedic()->dashasVimshottariMaha([...]), etc. The { ok, data, error } envelope is unwrapped for you. Service objects are memoized per Astroway instance.
Need a raw response or an endpoint not yet covered by services? $aw->request('POST', $path, ['json' => $body]) and $aw->post($path, body: …) remain available as escape hatches.
Common workflows
Synastry
Transits to natal
Vedic Vimshottari Mahadasha
Tarot daily card
Human Design
Error handling
The SDK throws typed subclasses of Astroway\Errors\ApiError. Catch order matters — most specific first:
Full hierarchy under Astroway\Errors:
ApiError(extends\RuntimeException)APIConnectionErrorAPITimeoutErrorBadRequestError(400)AuthenticationError(401)PermissionDeniedError(403)NotFoundError(404)UnprocessableEntityError(422)RateLimitError(429) — carriesretryAfterSecondsInternalServerError(5xx)
errorCode(notcode) is the AstroWay-specific error code property. The base\Exception::$codewould conflict.
Configuration
Default retry honors Retry-After (seconds or HTTP-date) on 429 responses.
Set retry: ['maxRetries' => 0] to disable retries entirely.
Authentication
Two equivalent auth schemes — pick whichever your stack prefers:
- Header (default):
X-Api-Key: aw_live_...— same convention ascurl/Postman examples. - Bearer:
Authorization: Bearer aw_live_...— same convention as Stripe/OpenAI/Anthropic SDKs.
Set via 'authScheme' => 'bearer' in the constructor options.
Privacy
The SDK does not phone home. There is no telemetry, no analytics, no usage reporting. The only network traffic the SDK originates is the AstroWay API calls you ask it to make.
Outgoing requests carry two identifying headers so the AstroWay backend can distinguish SDK traffic from raw HTTP traffic in its own logs:
User-Agent: astroway-sdk-php/<version> (PHP/<php-version>; <os>)X-Astroway-Channel: sdk-php
Neither carries a session ID, machine fingerprint, or anything personal.
Stability
Since 1.0.0 (2026-05-11) this package follows strict SemVer:
- Public
Astrowaysurface stable inside1.x— constructor$optionsshape,request/get/post/put/delete/concurrentmethods, 100+ namespace accessors (chart(),synastry(), ...),ApiErrorpublic properties (status/errorCode/requestId/creditsRemaining/retryAfterSeconds/body). Removing or renaming any of them requires2.0.0with deprecation period. - Error subclass tree stable inside
1.x— 9 classified*Errorsubtypes are part of the contract. - Body shape stable inside
1.minor. Tightening (constraints, enums) ships in patches; new required keys require a minor bump. - API version vs SDK version are independent. SDK
1.xfollows its own semver; the API itself sits at/v1/. - PHP 8.2+ required since
1.0.0. Need 8.1? Stay on0.x(will receive critical security patches).
Migration from 0.1.0-alpha.x / 0.1.0-beta.x / 0.1.0-rc.1 to 0.1.0
0.1.0 freezes the public surface. No breaking changes vs 0.1.0-rc.1 — every export, namespace, error class, and option added across alphas / betas / RC ships unchanged. The freeze means future 0.1.x patches will not narrow types, remove classes, or rename methods; that level of change requires a 0.2.0 minor bump.
| Coming from | Action |
|---|---|
0.1.0-alpha.1 (hard Guzzle dependency) |
Now PSR-18 — bring your own client ('httpClient' => $client) or rely on auto-discovery via php-http/discovery. |
0.1.0-alpha.2 … alpha.4 (no service classes / DTOs) |
Switch to typed services ($aw->chart()->compute($body), etc.) and DTO classes (new NatalChartRequest(...)). The escape hatch ($aw->post('/chart', $body)) still works. |
0.1.0-alpha.5 … alpha.6 (no error refinement / idempotency) |
Catch RateLimitException / QuotaExceededException separately; $exception->requestId / creditsRemaining / retryAfterSeconds available. Auto Idempotency-Key on POSTs. |
0.1.0-beta.1 … beta.3 (no helpers / cache / concurrent) |
BirthDateTime::fromCity(...) helpers; PSR-16 cache via 'cache' => $cache; $aw->concurrent(10)->all([...]) for parallel batches. |
0.1.0-beta.4 (no mock client) |
use Astroway\Testing\MockAstroway; for PHPUnit — drop-in for Astroway. |
0.1.0-rc.1 (no logger / metrics) |
Optional: pass 'logger' => $monolog and 'metrics' => fn($e) => ... for PSR-3 + observability. |
A surface-lock test suite (tests/SurfaceLockTest.php) uses Reflection to assert public method signatures, error subclass tree, and namespace accessor presence — any future PR that breaks the public surface fails CI before reaching Packagist. phpstan analyse is also clean at level 6.
Links
- 📦 Packagist: https://packagist.org/packages/astroway/sdk
- 📘 API docs: https://api.astroway.info/docs/api/
- 🔑 Sign up & dashboard: https://api.astroway.info/dashboard/
- 💰 Pricing: https://api.astroway.info/pricing/
- 🟦 TypeScript SDK:
@astroway/sdk - 🐍 Python SDK:
astroway - 🤖 MCP server:
@astroway/mcp - 🌐 Website: https://astroway.info
License
MIT — see LICENSE.
All versions of sdk with dependencies
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/http-factory Version ^1.0
psr/simple-cache Version ^1.0 || ^2.0 || ^3.0
psr/log Version ^1.1 || ^2.0 || ^3.0
php-http/discovery Version ^1.19