Skip to content

Commit 0fcd4bd

Browse files
committed
docs: sync README and AGENTS with canonical domain order, drop unused author email
Reorder domains to Western, Vedic, Numerology, Tarot, Biorhythm, I Ching, Crystals, Dreams, Angel Numbers, Location, Usage. Add Location-first rule for any coordinate dependent endpoint. AGENTS gains a Field formats that trip agents table covering timezone decimal hours (5.5 IST, 5.75 NPT), date and time formats, latitude longitude decimals, enum values, slugs, and nested person dicts. Timezone cheat sheet covers 24 regions with DST offsets. Common tasks table reordered by domain priority. MCP equivalents section added linking REST paths to per domain MCP tools. Drop unused authors block from pyproject.toml. PyPI does not require it and the placeholder email was wrong.
1 parent ac64385 commit 0fcd4bd

3 files changed

Lines changed: 284 additions & 102 deletions

File tree

AGENTS.md

Lines changed: 151 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# roxy-sdk (Python) Agent Guide
1+
# roxy-sdk (Python) - Agent Guide
22

3-
Python SDK for RoxyAPI. Multi-domain spiritual and metaphysical intelligence API. One API key, 11 domains, sync and async support.
3+
Python SDK for RoxyAPI. Eleven domains (Western astrology, Vedic astrology, numerology, tarot, biorhythm, I Ching, crystals, dreams, angel numbers, location, usage). One API key, sync and async.
44

55
## Install and initialize
66

@@ -16,26 +16,47 @@ roxy = create_roxy("your-api-key")
1616

1717
`create_roxy` sets the base URL (`https://roxyapi.com/api/v2`) and auth header automatically. Returns a `Roxy` instance with namespaced domain properties.
1818

19+
## Critical rule: geocode before any chart endpoint
20+
21+
Every chart, horoscope, panchang, dasha, dosha, navamsa, KP, synastry, compatibility, and natal endpoint needs `latitude`, `longitude`, and (for Western) `timezone`. **Never ask the user for coordinates.** Always call `roxy.location.search_cities` first.
22+
23+
```python
24+
cities = roxy.location.search_cities(q="Mumbai")
25+
lat, lng, tz = cities[0]["latitude"], cities[0]["longitude"], cities[0]["timezone"]
26+
```
27+
1928
## Domains
2029

21-
Type `roxy.` to see all available namespaces:
30+
Type `roxy.` to see all available namespaces. Type `roxy.{domain}.` in an IDE with a Python LSP to see every method.
2231

2332
| Namespace | What it covers |
2433
|-----------|----------------|
25-
| `roxy.astrology` | Western astrology: natal charts, horoscopes, synastry, moon phases, transits, compatibility |
26-
| `roxy.vedic_astrology` | Vedic/Jyotish: birth charts, dashas, nakshatras, panchang, KP system, doshas, yogas |
27-
| `roxy.tarot` | Rider-Waite-Smith deck: spreads, daily pulls, yes/no, Celtic Cross, custom layouts |
28-
| `roxy.numerology` | Life path, expression, soul urge, personal year, karmic analysis, compatibility |
29-
| `roxy.crystals` | Crystal healing properties, zodiac/chakra pairings, birthstones, search |
30-
| `roxy.iching` | I Ching: hexagrams, trigrams, coin casting, daily readings |
31-
| `roxy.angel_numbers` | Angel number meanings, pattern analysis, daily guidance |
32-
| `roxy.dreams` | Dream symbol dictionary and interpretations |
33-
| `roxy.biorhythm` | Physical, emotional, intellectual cycles, forecasts, compatibility |
34-
| `roxy.location` | City geocoding for birth chart coordinates |
34+
| `roxy.astrology` | Western astrology: natal charts, daily / weekly / monthly horoscopes, synastry, compatibility score, transits, moon phases |
35+
| `roxy.vedic_astrology` | Vedic / Jyotish: kundli, panchang, Vimshottari dasha, nakshatras, Mangal / Kaal Sarp / Sade Sati doshas, Guna Milan, navamsa, KP chart and ruling planets |
36+
| `roxy.numerology` | Life path, expression, soul urge, personal year, full chart, compatibility, karmic lessons |
37+
| `roxy.tarot` | Daily card, custom draws, three-card, Celtic Cross, yes / no, love spread, 78-card catalog |
38+
| `roxy.biorhythm` | Daily check-in, multi-day forecast, critical days, couples compatibility, phases |
39+
| `roxy.iching` | Daily hexagram, three-coin cast, 64 hexagrams, trigrams |
40+
| `roxy.crystals` | By zodiac, by chakra, birthstone, search, daily, pairings |
41+
| `roxy.dreams` | Dream symbol dictionary (3,000+ interpretations), daily prompt |
42+
| `roxy.angel_numbers` | Number meanings, universal digit-root lookup, daily |
43+
| `roxy.location` | City search with coordinates and timezone, countries |
3544
| `roxy.usage` | API usage stats and subscription info |
3645

3746
## Critical patterns
3847

48+
### Two-step pattern for coordinate-dependent endpoints
49+
50+
```python
51+
cities = roxy.location.search_cities(q="Delhi")
52+
lat, lng, tz = cities[0]["latitude"], cities[0]["longitude"], cities[0]["timezone"]
53+
54+
chart = roxy.astrology.generate_natal_chart(
55+
date="1990-01-15", time="14:30:00",
56+
latitude=lat, longitude=lng, timezone=tz,
57+
)
58+
```
59+
3960
### Sync calls (default)
4061

4162
```python
@@ -55,36 +76,40 @@ card = await roxy.tarot.draw_cards_async(count=3)
5576

5677
### POST endpoints (charts, spreads, calculations)
5778

58-
Most chart and calculation endpoints require date, time, and coordinates:
79+
Most valuable endpoints are POST:
5980

6081
```python
61-
chart = roxy.astrology.generate_natal_chart(
62-
date="1990-01-15",
63-
time="14:30:00",
64-
latitude=28.6139,
65-
longitude=77.209,
82+
natal = roxy.astrology.generate_natal_chart(
83+
date="1990-01-15", time="14:30:00",
84+
latitude=28.6139, longitude=77.209, timezone=5.5,
6685
)
6786

68-
vedic = roxy.vedic_astrology.generate_birth_chart(
69-
date="1990-01-15",
70-
time="14:30:00",
71-
latitude=28.6139,
72-
longitude=77.209,
87+
kundli = roxy.vedic_astrology.generate_birth_chart(
88+
date="1990-01-15", time="14:30:00",
89+
latitude=28.6139, longitude=77.209,
7390
)
7491

7592
celtic = roxy.tarot.cast_celtic_cross(question="What should I focus on?")
7693

7794
numerology = roxy.numerology.generate_numerology_chart(
78-
full_name="John Doe",
79-
year=1990,
80-
month=1,
81-
day=15,
95+
full_name="John Doe", year=1990, month=1, day=15,
8296
)
8397
```
8498

99+
### Multi-language via `lang` kwarg
100+
101+
Eight languages: `en`, `tr`, `de`, `es`, `fr`, `hi`, `pt`, `ru`. Defaults to `en`.
102+
103+
```python
104+
card = roxy.tarot.get_daily_card(date="2026-04-22", lang="es")
105+
life_path = roxy.numerology.calculate_life_path(year=1990, month=1, day=15, lang="hi")
106+
```
107+
108+
Supported: `astrology`, `vedic_astrology`, `numerology`, `tarot`, `biorhythm`, `iching`, `crystals`, `angel_numbers`. English-only: `dreams`, `location`, `usage`.
109+
85110
### Error handling
86111

87-
Errors raise `RoxyAPIError` with `error` (message), `code` (machine-readable), and `status_code` attributes:
112+
Errors raise `RoxyAPIError` with `error` (message), `code` (machine-readable), and `status_code`:
88113

89114
```python
90115
from roxy_sdk import create_roxy, RoxyAPIError
@@ -97,50 +122,123 @@ except RoxyAPIError as e:
97122
print(e.status_code) # 400
98123
```
99124

100-
Error codes: `validation_error`, `api_key_required`, `invalid_api_key`, `subscription_not_found`, `subscription_inactive`, `not_found`, `rate_limit_exceeded`, `internal_error`.
125+
| Status | Code | When |
126+
|--------|------|------|
127+
| 400 | `validation_error` | Missing or invalid parameters |
128+
| 401 | `api_key_required` | No API key provided |
129+
| 401 | `invalid_api_key` | Key format invalid or tampered |
130+
| 401 | `subscription_not_found` | Key references non-existent subscription |
131+
| 401 | `subscription_inactive` | Subscription cancelled, expired, or suspended |
132+
| 404 | `not_found` | Resource not found |
133+
| 429 | `rate_limit_exceeded` | Monthly quota reached |
134+
| 500 | `internal_error` | Server error |
101135

102136
## Common tasks
103137

138+
Ordered by domain priority (Western, Vedic, Numerology, Tarot, Biorhythm, I Ching, Crystals, Dreams, Angel Numbers, Location, Usage).
139+
104140
| Task | Code |
105141
|------|------|
106142
| Daily horoscope | `roxy.astrology.get_daily_horoscope(sign="aries")` |
107-
| Birth chart (Western) | `roxy.astrology.generate_natal_chart(date, time, latitude, longitude)` |
108-
| Birth chart (Vedic) | `roxy.vedic_astrology.generate_birth_chart(date, time, latitude, longitude)` |
143+
| Natal chart (Western) | `roxy.astrology.generate_natal_chart(date, time, latitude, longitude, timezone)` |
144+
| Synastry | `roxy.astrology.calculate_synastry(person1, person2)` |
109145
| Compatibility score | `roxy.astrology.calculate_compatibility(person1, person2)` |
110-
| Tarot daily card | `roxy.tarot.get_daily_card()` |
111-
| Celtic Cross reading | `roxy.tarot.cast_celtic_cross(question="...")` |
112-
| Draw tarot cards | `roxy.tarot.draw_cards(count=3)` |
113-
| Life Path number | `roxy.numerology.calculate_life_path(year, month, day)` |
114-
| Full numerology chart | `roxy.numerology.generate_numerology_chart(full_name=, year=, month=, day=)` |
146+
| Current moon phase | `roxy.astrology.get_current_moon_phase()` |
147+
| Transits | `roxy.astrology.calculate_transits(natal_chart=...)` |
148+
| Kundli (Vedic birth chart) | `roxy.vedic_astrology.generate_birth_chart(date, time, latitude, longitude)` |
149+
| Panchang (detailed) | `roxy.vedic_astrology.get_detailed_panchang(date, latitude, longitude)` |
150+
| Choghadiya | `roxy.vedic_astrology.get_choghadiya(date, latitude, longitude)` |
151+
| Current dasha | `roxy.vedic_astrology.get_current_dasha(date, time, latitude, longitude)` |
152+
| Mangal Dosha | `roxy.vedic_astrology.check_manglik_dosha(date, time, latitude, longitude)` |
153+
| Guna Milan (matching) | `roxy.vedic_astrology.calculate_gun_milan(person1, person2)` |
154+
| Navamsa (D9) | `roxy.vedic_astrology.generate_navamsa(date, time, latitude, longitude)` |
155+
| KP chart | `roxy.vedic_astrology.generate_kp_chart(date, time, latitude, longitude)` |
156+
| Nakshatra detail | `roxy.vedic_astrology.get_nakshatra(id="ashwini")` |
157+
| Life path number | `roxy.numerology.calculate_life_path(year, month, day)` |
158+
| Full numerology chart | `roxy.numerology.generate_numerology_chart(full_name, year, month, day)` |
159+
| Personal year | `roxy.numerology.calculate_personal_year(month, day)` |
160+
| Daily tarot card | `roxy.tarot.get_daily_card(seed="user-123")` |
161+
| Three-card spread | `roxy.tarot.cast_three_card(question="...")` |
162+
| Celtic Cross | `roxy.tarot.cast_celtic_cross(question="...")` |
163+
| Yes / no tarot | `roxy.tarot.cast_yes_no(question="...")` |
164+
| Daily biorhythm | `roxy.biorhythm.get_daily_biorhythm(seed="user-123")` |
165+
| Biorhythm forecast | `roxy.biorhythm.get_forecast(birth_date="1990-01-15")` |
166+
| Biorhythm compatibility | `roxy.biorhythm.calculate_bio_compatibility(person1, person2)` |
167+
| Daily hexagram | `roxy.iching.get_daily_hexagram(seed="user-123")` |
168+
| Cast I Ching reading | `roxy.iching.cast_reading()` |
169+
| Hexagram detail | `roxy.iching.get_hexagram(number=1)` |
115170
| Crystal by zodiac | `roxy.crystals.get_crystals_by_zodiac(sign="aries")` |
116-
| Crystal search | `roxy.crystals.search_crystals(q="amethyst")` |
117-
| I Ching reading | `roxy.iching.cast_reading()` |
118-
| Angel number meaning | `roxy.angel_numbers.get_angel_number(number="1111")` |
171+
| Crystal by chakra | `roxy.crystals.get_crystals_by_chakra(chakra="heart")` |
119172
| Dream symbol lookup | `roxy.dreams.get_dream_symbol(id="flying")` |
120-
| Daily biorhythm | `roxy.biorhythm.get_daily_biorhythm(date="1990-01-15")` |
121-
| Biorhythm forecast | `roxy.biorhythm.get_biorhythm_forecast(date="1990-01-15", days=30)` |
173+
| Angel number meaning | `roxy.angel_numbers.get_angel_number(number="1111")` |
174+
| Universal number lookup | `roxy.angel_numbers.analyze_number_sequence(number="1234")` |
122175
| Find city coordinates | `roxy.location.search_cities(q="Mumbai")` |
123176
| Check API usage | `roxy.usage.get_usage_stats()` |
124177

125-
## Location helper
126-
127-
Most chart endpoints need `latitude` and `longitude`. Use the location API to geocode:
128-
129-
```python
130-
result = roxy.location.search_cities(q="Mumbai, India")
131-
city = result["cities"][0]
132-
# Use city["latitude"] and city["longitude"] in chart requests
133-
```
178+
## Field formats that trip agents
179+
180+
These are the fields AI agents most often get wrong. Copy the format column exactly.
181+
182+
| Field | Format | Good | Bad |
183+
|-------|--------|------|-----|
184+
| `timezone` | Decimal hours from UTC (float) | `5.5` (India IST, GMT+5:30), `5.75` (Nepal NPT, GMT+5:45), `-5` (NY EST), `9.5` (Adelaide), `0` (UTC) | `"5:30"`, `"5:45"`, `5.45`, `"GMT-5"`, `"Asia/Kolkata"`, `"+0530"` |
185+
| `date` | ISO date string | `"1990-01-15"` | `"Jan 15 1990"`, `datetime.now()`, `"15/01/1990"`, `"1990-1-15"` |
186+
| `time` | 24-hour string | `"14:30:00"`, `"09:00:00"` | `"2:30 PM"`, `"14:30"` (no seconds), `"9:0:0"` (no leading zeros) |
187+
| `latitude` | Decimal degrees (float) | `28.6139` (Delhi), `-33.8688` (Sydney), `40.7128` (NYC) | `"28°36'N"`, `"28 36 50"`, strings |
188+
| `longitude` | Decimal degrees (float) | `77.209` (Delhi), `-74.006` (NYC), `139.6917` (Tokyo) | Same as latitude - no DMS strings |
189+
| `sign` (horoscope kwarg) | Lowercase zodiac name | `"aries"`, `"taurus"`, `"gemini"`, ... `"pisces"` | `"Aries"`, `"♈"`, `"1"`, `"ARIES"` (case-insensitive but prefer lowercase) |
190+
| `full_name` (numerology) | Birth-certificate name | `"John William Smith"`, `"Priya Rajesh Sharma"` | Nickname, married name, partial name - affects all letter-based calcs |
191+
| `seed` | Any string (deterministic) | `"user-42"`, `"session-abc-123"`, email hash | Numbers, objects - must be string |
192+
| `number` (angel numbers) | String | `"1111"`, `"777"`, `"1234"` | `1111` (int) fails path validation |
193+
| `id` (nakshatra / dream / tarot) | Slug | `"ashwini"`, `"flying"`, `"the-fool"`, `"three-of-cups"` | Display names, uppercase, spaces |
194+
| `house_system` | Enum string | `"placidus"` (default), `"whole-sign"`, `"equal"`, `"koch"` | `"Placidus"`, `"whole_sign"`, `"WS"` |
195+
| `ayanamsa` (KP) | Enum string | `"kp-newcomb"` (default), `"kp-old"`, `"lahiri"`, `"custom"` | `"KP"`, `"New Comb"`, `"Lahiri"` |
196+
| `node_type` | Enum string | `"true-node"`, `"mean-node"` | `"true"`, `"mean"`, `"True Node"` |
197+
| `count` (tarot draw) | Integer 1 to 78 | `3`, `10`, `78` | `0`, `79`, strings, floats |
198+
| `mahadasha` (path) | Planet name | `"Ketu"`, `"Venus"`, `"Sun"`, `"Moon"`, `"Mars"`, `"Rahu"`, `"Jupiter"`, `"Saturn"`, `"Mercury"` | `"KETU"` (works, case-insensitive), `"ke"`, `"Ke-tu"` |
199+
| `person1` / `person2` | Dict with full birth data | `{"date": ..., "time": ..., "latitude": ..., "longitude": ..., "timezone": ...}` (Western) or same without timezone (Vedic) | Separate top-level kwargs, missing time, partial dict |
200+
| `question` (tarot / iching) | Optional string | `"Should I accept the job offer?"`, `"What should I focus on this week?"` | Omit for general reading. More specific = better interpretation. |
201+
| `year` / `month` / `day` (numerology) | Integer | `1990`, `1`, `15` | Zero-padded strings `"01"`, floats, full dates |
202+
203+
### Timezone cheat sheet (most-asked locations)
204+
205+
| Region | Decimal | Region | Decimal |
206+
|--------|---------|--------|---------|
207+
| UTC / London (winter) | `0` | Dubai | `4` |
208+
| London (summer, BST) | `1` | Karachi | `5` |
209+
| Berlin / Paris | `1` (winter) / `2` (summer) | Delhi / Mumbai (IST) | `5.5` |
210+
| Istanbul | `3` | Kathmandu (NPT) | `5.75` |
211+
| Moscow | `3` | Dhaka | `6` |
212+
| Tehran | `3.5` (winter) / `4.5` (summer) | Bangkok | `7` |
213+
| Adelaide | `9.5` (winter) / `10.5` (summer) | Singapore / Beijing | `8` |
214+
| New York (EST / EDT) | `-5` / `-4` | Tokyo | `9` |
215+
| Chicago (CST / CDT) | `-6` / `-5` | Sydney | `10` (winter) / `11` (summer) |
216+
| Denver (MST / MDT) | `-7` / `-6` | Auckland | `12` (winter) / `13` (summer) |
217+
| Los Angeles (PST / PDT) | `-8` / `-7` | Honolulu | `-10` |
218+
219+
DST matters. If the birth date falls inside a daylight-saving window, use the summer / DST offset. For Vedic endpoints this is rarely an issue (most users are in India, fixed 5.5), but Western natal charts must respect DST at the time of birth.
220+
221+
## MCP equivalents
222+
223+
Every method has a matching MCP tool. MCP server per domain is at `https://roxyapi.com/mcp/{domain}-api`. Tool names follow `{method}_{path_snake_case}`, for example:
224+
225+
- `POST /astrology/natal-chart` -> `post_astrology_natal_chart` on `/mcp/astrology-api`
226+
- `GET /astrology/horoscope/{sign}/daily` -> `get_astrology_horoscope_sign_daily` on `/mcp/astrology-api`
227+
- `POST /vedic-astrology/birth-chart` -> `post_vedic_astrology_birth_chart` on `/mcp/vedic-astrology-api`
228+
- `POST /tarot/spreads/celtic-cross` -> `post_tarot_spreads_celtic_cross` on `/mcp/tarot-api`
229+
230+
Use the SDK for typed Python apps. Use MCP for AI agents (Claude Desktop, Cursor MCP, OpenAI agents) where the agent selects tools based on user intent.
134231

135232
## Gotchas
136233

234+
- **Geocode first.** Any chart, panchang, synastry, compatibility, or natal endpoint needs coordinates. Call `roxy.location.search_cities` before the chart method.
137235
- **All parameters are keyword arguments.** Use `sign="aries"` not positional `"aries"`.
138236
- **Async methods end with `_async`.** Every sync method has a matching async variant.
139237
- **Do not expose API keys client-side.** Call Roxy from server code only.
140-
- **Chart endpoints need coordinates.** Use `roxy.location.search_cities()` to get lat/lng.
141238
- **Date format is `YYYY-MM-DD`, time is `HH:MM:SS`.** Both are strings.
239+
- **Western `timezone` is required** (decimal hours, `-5` for EST, `5.5` for IST, `0` for UTC). Vedic endpoints accept an optional `timezone` that defaults to `5.5` (IST).
142240
- **Errors raise `RoxyAPIError`.** Catch it and check `e.code`, `e.error`, and `e.status_code`.
143-
- **Switch on `code`, not `error`.** The `code` field is stable. The `error` message may change.
241+
- **Switch on `code`, not `error`.** Codes are stable. Messages may change.
144242

145243
## Links
146244

0 commit comments

Comments
 (0)