You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit edfc7e1
Browse filesBrowse the repository at this point in the historyBrowse files
docs: most-used endpoints across all 18 domains composed from one location lookup and verified against production, AGENTS task table in catalog order with the error table and gotchas in sync, llms-full error codes aligned
Copy file name to clipboardExpand all lines: AGENTS.md
+72-37Lines changed: 72 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,25 +22,26 @@ var roxy = new RoxyClient(Environment.GetEnvironmentVariable("ROXY_API_KEY")!);
22
22
23
23
Get these and the generated types do the rest.
24
24
25
-
-**The fluent path mirrors the URL.**`GET /astrology/horoscope/{sign}/daily` is `roxy.Astrology.Horoscope["aries"].Daily.GetAsync()`. Each path segment is a property; each `{param}` is an indexer. Type `roxy.` and let IntelliSense walk the tree. Never invent a method name.
25
+
-**The fluent path mirrors the URL.**`GET /astrology/horoscope/{sign}/daily` is `roxy.Astrology.Horoscope["aries"].Daily.GetAsync()`. Each path segment is a property; each `{param}` is an indexer. Type `roxy.` and let IntelliSense walk the tree. Never invent a method name, and never derive one from the `operationId` in the spec: this SDK is path-fluent, not operation-named.
26
26
-**Request bodies use a target-typed `new()`.**`await roxy.Astrology.NatalChart.PostAsync(new() { Date = new Date(1990, 1, 15), ... })`. The type is inferred from the method, so you never need to name it; IntelliSense shows every field on `new() {`.
-**Always `await`, and catch `RoxyError`.** There is no result-wrapper object. The call returns the typed response directly and throws `RoxyError` (a subclass of `ApiException`) on failure. Switch on `e.Code`, not `e.Message`.
29
-
-**Never hand-roll HttpClient.**`new RoxyClient(key)` injects auth, base URL, retries, and typed responses.
29
+
-**Never hand-roll HttpClient.**`new RoxyClient(key)` injects auth, the base URL, typed responses, and a retry with backoff on a 429 or 503. Response field names come from the response schema of the spec and are PascalCase properties; the compiler catches any invented field, so if the build fails on a property, the field does not exist.
30
30
31
31
## Critical rule: geocode before any chart endpoint
32
32
33
33
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.** Call `roxy.Location.Search` first.
// city.Timezone is the IANA string ("America/New_York"). Pass it straight into any chart
39
+
// endpoint and the server resolves it to the DST-correct decimal offset using the Date of
40
+
// the chart itself, so a January 1990 New York chart picks EST (-5) even when you looked
41
+
// the city up in July. city.UtcOffset (5.5, -5, 9, ...) also works and produces identical charts.
41
42
```
42
43
43
-
`Q` accepts a bare city (`"Paris"`), city plus country (`"Berlin Germany"`), or comma-qualified (`"Springfield, Illinois"`). Use the qualified form to disambiguate.
44
+
`Q` accepts a bare city (`"Paris"`), city plus country (`"Berlin Germany"`), or comma-qualified (`"Springfield, Illinois"`). Use the qualified form to disambiguate same-named cities.
44
45
45
46
## Domains
46
47
@@ -74,19 +75,23 @@ var city = search!.Cities![0];
74
75
### Two-step pattern for coordinate-dependent endpoints
One lookup feeds every domain. Request bodies are distinct generated types, so capture the five values once as locals and assign them into each body. The same `Date`, `Time`, `Latitude`, `Longitude` and `Timezone` are the body for `Astrology.NatalChart`, `VedicAstrology.BirthChart`, `VedicAstrology.Dasha.Current`, `Ayurveda.Constitution` and the `BirthData` of `Forecast.Transits`; the instant alone (`Date`, `Time`, `Timezone`) is the body for `HumanDesign.Bodygraph`, `ChineseAstrology.Bazi.Chart` and `Kabbalah.BirthProfile`. Never look the city up twice for one person.
94
+
90
95
### GET endpoints: path params are indexers, query params use the lambda
91
96
92
97
```csharp
@@ -102,8 +107,8 @@ Most valuable endpoints (charts, spreads, calculations) are POST:
Calls throw `RoxyError` (extends `ApiException`) on a 4xx or 5xx. `Message` is human-readable and may change; `Code` is stable, switch on it.
131
+
Calls throw `RoxyError` (in `RoxyApi.Models`, extends `ApiException`) on a 4xx or 5xx. `Message` is human-readable and may change; `Code` is stable, switch on it.
| 401 |`invalid_api_key`| Key format invalid or tampered |
148
151
| 401 |`subscription_not_found`| Key references a non-existent subscription |
149
152
| 401 |`subscription_inactive`| Subscription cancelled, expired, or suspended |
153
+
| 401 |`api_key_revoked`| Key was deleted from the account |
150
154
| 404 |`not_found`| Resource not found |
155
+
| 4xx |`bad_request` and other status-derived codes | A client error the endpoint itself detected, such as a date window whose `endDate` precedes `startDate`|
-**Natal chart**: `Planets`, `Houses`, `Aspects`, `Ascendant`, `Midheaven`, `Summary`. Each planet has `Name`, `Sign`, `Degree`, `House`, `IsRetrograde`. The `Planets` list has more than ten entries (classical bodies plus nodes and key points).
165
+
-**Maps keyed by name** arrive in `AdditionalData`, not as properties. The Vedic kundli `Meta` (one entry per planet: `rashi`, `nakshatra`, `longitude`) and the biorhythm reading `Cycles` (one entry per cycle: `value`, `rawValue`, `phase`) are objects whose keys the spec leaves open, so the generated class has no fields of its own: read `kundli.Meta!.AdditionalData["Moon"]`, which is an `UntypedObject` from `Microsoft.Kiota.Abstractions.Serialization`, and call `GetValue()` on it for the inner dictionary.
Ordered by domain priority (Western, Vedic, Forecast, Human Design, Chinese Astrology, Feng Shui, Numerology, Tarot, Biorhythm, I Ching, Crystals, Dreams, Angel Numbers, Location).
175
+
In the catalog order (Western astrology, Vedic astrology, forecast, Human Design, Chinese astrology, feng shui, Mesoamerican astrology, Vastu, numerology, Kabbalah, tarot, biorhythm, Ayurveda, I Ching, crystals, dreams, angel numbers, location, usage, languages). `Date, Time, Latitude, Longitude, Timezone` are the five values from the two-step pattern above; `Person1`, `Person2`, `PersonA`, `PersonB` and `BirthData` are nested bodies built from them.
| Enum fields (`Gender`, `Facing`, `Unit`, room `Type`) | The generated enum, which lives in the namespace of its request body |`KuaPostRequestBody_gender.Female` after `using RoxyApi.FengShui.Kua;`|`"female"`, `Gender = "Female"`|
220
252
221
253
### Timezone cheat sheet (decimal offsets)
222
254
223
255
| Region | Decimal | Region | Decimal |
224
256
|--------|---------|--------|---------|
225
-
| UTC / London (winter) |`0`| Delhi / Kolkata (IST) |`5.5`|
257
+
| UTC / London (winter) |`0`| Delhi (IST) |`5.5`|
226
258
| Berlin / Paris |`1` (winter) / `2` (summer) | Kathmandu |`5.75`|
227
259
| Istanbul / Moscow |`3`| Dhaka |`6`|
228
260
| Dubai |`4`| Bangkok |`7`|
229
261
| New York (EST / EDT) |`-5` / `-4`| Singapore / Beijing |`8`|
230
262
| Chicago (CST / CDT) |`-6` / `-5`| Tokyo |`9`|
231
263
| Los Angeles (PST / PDT) |`-8` / `-7`| Sydney |`10` / `11` (summer) |
232
264
233
-
DST matters for Western charts: use the summer offset if the birth date falls in a daylight-saving window, or pass the IANA name and let the server resolve it. Vedic endpoints default to IST (`5.5`), which is DST-free.
265
+
DST matters. If the birth date falls inside a daylight-saving window, use the summer / DST offset, or pass the IANA string from the location lookup and let the server resolve it. India observes no DST, so a fixed `5.5` is always right there; anywhere else, a natal chart must carry the offset in force at the time of birth.
234
266
235
267
## Astrology domain gotchas
236
268
@@ -257,10 +289,13 @@ Use the SDK for typed .NET apps. Use MCP for AI agents (Claude, Cursor, ChatGPT)
257
289
## Gotchas
258
290
259
291
-**Geocode first.** Any chart, panchang, synastry, compatibility, or natal endpoint needs coordinates. Call `roxy.Location.Search` before the chart method.
260
-
-**Path params are indexers, query params are a lambda.**`roxy.Astrology.Horoscope["aries"].Daily.GetAsync(c => c.QueryParameters.Date = new Date(2026, 4, 3))`.
261
-
-**Do not guess method names.** Type `roxy.Domain.` and let IntelliSense show the fluent tree. It mirrors the URL path.
292
+
-**Path params are indexers, query params are a lambda.**`roxy.Astrology.Horoscope["aries"].Daily.GetAsync(c => c.QueryParameters.Date = new Date(2026, 4, 3))`. An indexer is typed from the spec: a numeric path param takes a number (`Birthstone[1]`, `Hexagrams[1]`), a string one takes a string (`Numbers["1111"]`, `Calendar.Day["2026-10-01"]`).
293
+
-**Do not guess method names.** Type `roxy.Domain.` and let IntelliSense show the fluent tree. It mirrors the URL path, not the `operationId`.
262
294
-**Responses are nullable.** Use `result!.Field` or null checks; the success body is non-null only on a 2xx (errors throw).
263
295
-**`Timezone` is a union wrapper, never a bare number.** Use `new() { Double = -5 }` or `new() { String = "America/New_York" }`.
296
+
-**Switch on `e.Code`, not `e.Message`.** The message may change; the code is stable.
297
+
-**List endpoints return a paginated envelope**, `Total`, `Limit`, `Offset` plus a named list (`Cities`, `Crystals`, `Hexagrams`, `Symbols`), never a bare list. Pass `c => c.QueryParameters.Limit = 64` to widen a page; `Iching.Hexagrams` defaults to 20 of 64.
298
+
-**Enums live beside their request body.**`Gender`, `Facing`, `Unit` and room `Type` are generated enums in the namespace of the body that uses them (`using RoxyApi.FengShui.Kua;`, `using RoxyApi.Vastu.Rooms;`), so the same member name can exist in several namespaces; the one the body expects is the one to use.
264
299
-**Do not expose API keys client-side.** Call Roxy from server, API, or backend code only.
0 commit comments