Skip to content

Commit 4d35c6f

Browse files
committed
docs: add human design and forecast examples, fix endpoint count to 148
1 parent 9e97d3e commit 4d35c6f

4 files changed

Lines changed: 97 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $result = $roxy->location->searchCities(q: 'Mumbai');
5252
| `$roxy->languages` | 1 | List the response languages accepted by the `lang` query parameter on every i18n-aware endpoint |
5353
<!-- END:DOMAINS -->
5454

55-
131 endpoints across 10 product domains plus usage and languages. Counts auto-sync from `specs/openapi.json` at release time.
55+
148 endpoints across 12 product domains plus usage and languages. Counts auto-sync from `specs/openapi.json` at release time.
5656

5757
## Critical patterns
5858

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Packagist](https://img.shields.io/packagist/v/roxyapi/sdk.svg)](https://packagist.org/packages/roxyapi/sdk)
1010
[![PHP Version](https://img.shields.io/packagist/php-v/roxyapi/sdk.svg)](https://packagist.org/packages/roxyapi/sdk)
1111

12-
Official PHP SDK for [RoxyAPI](https://roxyapi.com): Western and Vedic astrology, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, location geocoding, and more. 131 endpoints across 12 domains, one API key, one dependency (Saloon).
12+
Official PHP SDK for [RoxyAPI](https://roxyapi.com): Western and Vedic astrology, Human Design, forecast timelines, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, location geocoding, and more. 148 endpoints across 12 domains, one API key, one dependency (Saloon).
1313

1414
## Install
1515

@@ -131,6 +131,8 @@ $result = $roxy->astrology->getDailyHoroscope(sign: 'aries');
131131

132132
- `examples/vanilla-php.php` - raw PHP, prints a horoscope
133133
- `examples/laravel.php` - Laravel service provider snippet
134+
- `examples/human-design.php` - full Human Design bodygraph, prints type, strategy, and profile
135+
- `examples/forecast.php` - cross-domain forecast timeline, prints the event count and a sample event
134136
- `examples/render-with-ui.html` - server-side fetch + browser render via `@roxyapi/ui`
135137

136138
## Documentation

examples/forecast.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* Cross-domain forecast timeline example.
7+
*
8+
* ROXY_API_KEY=your-key php examples/forecast.php
9+
*/
10+
11+
require __DIR__ . '/../vendor/autoload.php';
12+
13+
use RoxyAPI\Sdk\RoxyApiException;
14+
15+
use function RoxyAPI\Sdk\createRoxy;
16+
17+
$apiKey = getenv('ROXY_API_KEY') ?: '';
18+
if ('' === $apiKey) {
19+
fwrite(STDERR, "Set ROXY_API_KEY before running this example.\n");
20+
exit(1);
21+
}
22+
23+
$roxy = createRoxy($apiKey);
24+
25+
try {
26+
// birthData is one object, never an array of subjects. timezone is decimal hours or an IANA name.
27+
$timeline = $roxy->forecast->generateTimeline(
28+
birthData: [
29+
'date' => '1990-07-04',
30+
'time' => '10:12:00',
31+
'timezone' => 5.5,
32+
'latitude' => 28.6139,
33+
'longitude' => 77.209,
34+
],
35+
startDate: '2026-06-01',
36+
endDate: '2026-06-30',
37+
);
38+
39+
echo "=== Forecast timeline (2026-06-01 to 2026-06-30) ===\n";
40+
echo 'Events: ' . ($timeline['count'] ?? 0) . "\n";
41+
42+
$first = $timeline['events'][0] ?? null;
43+
if (null !== $first) {
44+
echo 'First: [' . ($first['date'] ?? '?') . '] ' . ($first['description'] ?? '?') . "\n";
45+
echo 'Domain: ' . ($first['domain'] ?? '?') . ', significance ' . ($first['significance'] ?? '?') . "\n";
46+
}
47+
} catch (RoxyApiException $e) {
48+
fwrite(STDERR, "[{$e->statusCode}] {$e->errorCode}: {$e->error}\n");
49+
exit(3);
50+
}

examples/human-design.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* Human Design bodygraph example.
7+
*
8+
* ROXY_API_KEY=your-key php examples/human-design.php
9+
*/
10+
11+
require __DIR__ . '/../vendor/autoload.php';
12+
13+
use RoxyAPI\Sdk\RoxyApiException;
14+
15+
use function RoxyAPI\Sdk\createRoxy;
16+
17+
$apiKey = getenv('ROXY_API_KEY') ?: '';
18+
if ('' === $apiKey) {
19+
fwrite(STDERR, "Set ROXY_API_KEY before running this example.\n");
20+
exit(1);
21+
}
22+
23+
$roxy = createRoxy($apiKey);
24+
25+
try {
26+
// Full bodygraph in one call. timezone is decimal hours (5.5 = IST) or an IANA name.
27+
$chart = $roxy->humanDesign->generateBodygraph(
28+
date: '1990-07-04',
29+
time: '10:12:00',
30+
timezone: 5.5,
31+
latitude: 28.6139,
32+
longitude: 77.209,
33+
);
34+
35+
echo "=== Human Design bodygraph (1990-07-04 10:12 IST) ===\n";
36+
echo 'Type: ' . ($chart['type'] ?? '?') . "\n";
37+
echo 'Strategy: ' . ($chart['strategy'] ?? '?') . "\n";
38+
echo 'Profile: ' . ($chart['profile'] ?? '?') . "\n";
39+
echo 'Definition: ' . ($chart['definition'] ?? '?') . "\n";
40+
} catch (RoxyApiException $e) {
41+
fwrite(STDERR, "[{$e->statusCode}] {$e->errorCode}: {$e->error}\n");
42+
exit(3);
43+
}

0 commit comments

Comments
 (0)