roxyapi/sdk
Composer 安装命令:
composer require roxyapi/sdk
包简介
Official PHP SDK for RoxyAPI: Western and Vedic astrology, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, location, usage, and languages.
关键字:
README 文档
README
roxyapi/sdk
Official PHP SDK for RoxyAPI: natal charts, daily horoscopes, synastry, Vedic kundli, tarot spreads, human design bodygraphs, and transit forecasts across Western and Vedic astrology, numerology, tarot, human design, forecast, biorhythm, I Ching, crystals, dreams, angel numbers, and location geocoding. 160+ endpoints across 12+ domains, one API key, one dependency (Saloon).
Install
composer require roxyapi/sdk
Requires PHP 8.2+.
Quick start
<?php require __DIR__ . '/vendor/autoload.php'; use function RoxyAPI\Sdk\createRoxy; $roxy = createRoxy(getenv('ROXY_API_KEY')); // Daily horoscope $horoscope = $roxy->astrology->getDailyHoroscope(sign: 'aries'); echo $horoscope['overview'], PHP_EOL; // Geocode first, then chart $cities = $roxy->location->searchCities(q: 'London'); ['latitude' => $lat, 'longitude' => $lon, 'timezone' => $tz] = $cities['cities'][0]; $chart = $roxy->astrology->generateNatalChart( date: '1990-01-15', time: '14:30:00', latitude: $lat, longitude: $lon, timezone: $tz, );
Get an API key at roxyapi.com/pricing. All endpoints take an API key via the X-API-Key header (set automatically by the SDK).
What is exposed
createRoxy($apiKey) returns a Roxy connector that lazy-loads one resource per OpenAPI tag:
| Property | What it covers |
|---|---|
$roxy->astrology |
Western astrology API for natal birth charts, daily, weekly, and monthly horoscopes with unique content per sign, syn... |
$roxy->vedicAstrology |
Vedic astrology (Jyotish) and KP API for kundli generation with 15 divisional charts (D1-D60), Ashtakoot Gun Milan ku... |
$roxy->numerology |
Numerology API to calculate life path, expression, soul urge, personality, and maturity numbers, with Pinnacle and Ch... |
$roxy->tarot |
Tarot reading API with the complete 78-card Rider-Waite-Smith deck and card meanings for love, career, health, and sp... |
$roxy->humanDesign |
Generate the full Human Design bodygraph from a birth moment: type, strategy, inner authority, profile, definition, i... |
$roxy->forecast |
Merge upcoming transit aspects, sign ingresses, retrograde stations, new and full moons, biorhythm critical days, and... |
$roxy->biorhythm |
The most complete biorhythm API: 10 cycle types across 3 primary (physical, emotional, intellectual), 4 secondary (in... |
$roxy->iching |
I-Ching oracle API with all 64 hexagrams, 384 changing lines, 8 trigrams, and modern interpretations for love, career... |
$roxy->crystals |
Crystal healing API covering the most popular and widely-searched healing crystals and gemstones, from Amethyst and R... |
$roxy->dreams |
Dream interpretation API with a 2,000+ symbol dream dictionary and psychological meanings covering animals, objects,... |
$roxy->angelNumbers |
Angel numbers API with meanings for 111, 222, 333, 444, 555, 666, 777, 888, 999, 1111, and 75+ sequences covering eve... |
$roxy->location |
City search and geocoding API with 23,000+ cities across 240+ countries, returning latitude, longitude, IANA timezone... |
$roxy->usage |
Monitor your API usage, check rate limits, and track request consumption |
$roxy->languages |
List the response languages accepted by the lang query parameter on every i18n-aware endpoint |
Every method returns array<string, mixed> decoded from JSON, or throws RoxyAPI\Sdk\RoxyApiException on 4xx/5xx.
Error handling
use RoxyAPI\Sdk\RoxyApiException; try { $roxy->astrology->getDailyHoroscope(sign: 'invalid'); } catch (RoxyApiException $e) { // $e->statusCode (int) - HTTP status, e.g. 400 // $e->errorCode (string) - machine-readable, e.g. 'validation_error' (switch on this) // $e->error (string) - human-readable message error_log("[{$e->statusCode}] {$e->errorCode}: {$e->error}"); }
Stable codes: validation_error, api_key_required, invalid_api_key, subscription_inactive, not_found, rate_limit_exceeded, internal_error.
Multi-language responses
Pass lang (ISO 639-1) on supported endpoints. Defaults to English. Eight languages: en, tr, de, es, fr, hi, pt, ru.
$roxy->tarot->getDailyCard(seed: 'user-42', lang: 'es'); $roxy->numerology->calculateLifePath(year: 1990, month: 1, day: 15, lang: 'hi');
$roxy->languages->listLanguages() returns the canonical list at runtime.
Rendering with @roxyapi/ui
This SDK fetches JSON. For HTML rendering, hand the JSON to @roxyapi/ui web components in the browser.
examples/render-with-ui.html shows the full pattern: PHP endpoint backed by the SDK, browser fetches JSON and assigns it to a <roxy-natal-chart> element. No PHP-side templating.
Testing your integration
Saloon's MockClient lets you mock requests by class:
use RoxyAPI\Sdk\Generated\Requests\GetDailyHoroscopeRequest; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; use function RoxyAPI\Sdk\createRoxy; $roxy = createRoxy('test-key'); $roxy->withMockClient(new MockClient([ GetDailyHoroscopeRequest::class => MockResponse::make([ 'sign' => 'aries', 'overview' => 'fixture', ]), ])); $result = $roxy->astrology->getDailyHoroscope(sign: 'aries');
Examples
examples/vanilla-php.php- raw PHP, prints a horoscopeexamples/laravel.php- Laravel service provider snippetexamples/human-design.php- full Human Design bodygraph, prints type, strategy, and profileexamples/forecast.php- cross-domain forecast timeline, prints the event count and a sample eventexamples/render-with-ui.html- server-side fetch + browser render via@roxyapi/ui
Documentation
- API reference: https://roxyapi.com/api-reference
- Agent guide (
AGENTS.md): bundled in the package, optimised for AI coding agents - MCP setup for AI agents: https://roxyapi.com/docs/mcp
- Sibling SDKs: TypeScript, Python
License
MIT
roxyapi/sdk 适用场景与选型建议
roxyapi/sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 39 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sdk」 「horoscope」 「astrology」 「numerology」 「saloon」 「tarot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 roxyapi/sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roxyapi/sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 roxyapi/sdk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Zodiac Sign Calculator
A Bundle for displaying the zodiac for a Date
Custom horoscope module
Complete 100% 1:1 PHP FFI Wrapper for the Swiss Ephemeris C Library - Direct C function calls with zero abstraction for maximum astronomical precision
Drawing component for Jyotish Library
Authentic Vedic Panchanga calculation engine powered by the JPL Moshier Ephemeris FFI wrapper
统计信息
- 总下载量: 39
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 39
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-11