@roxyapi/sdk 1.2.85 → 1.2.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/AGENTS.md +51 -30
  2. package/README.md +252 -186
  3. package/dist/client/client.gen.d.ts +1 -1
  4. package/dist/client/client.gen.d.ts.map +1 -1
  5. package/dist/client/index.d.ts +10 -10
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/types.gen.d.ts +4 -4
  8. package/dist/client/types.gen.d.ts.map +1 -1
  9. package/dist/client/utils.gen.d.ts +2 -2
  10. package/dist/client/utils.gen.d.ts.map +1 -1
  11. package/dist/client.gen.d.ts +2 -2
  12. package/dist/client.gen.d.ts.map +1 -1
  13. package/dist/core/bodySerializer.gen.d.ts +1 -1
  14. package/dist/core/bodySerializer.gen.d.ts.map +1 -1
  15. package/dist/core/serverSentEvents.gen.d.ts +1 -1
  16. package/dist/core/serverSentEvents.gen.d.ts.map +1 -1
  17. package/dist/core/types.gen.d.ts +2 -2
  18. package/dist/core/types.gen.d.ts.map +1 -1
  19. package/dist/core/utils.gen.d.ts +1 -1
  20. package/dist/core/utils.gen.d.ts.map +1 -1
  21. package/dist/factory.cjs +34 -2
  22. package/dist/factory.d.ts +2 -2
  23. package/dist/factory.d.ts.map +1 -1
  24. package/dist/factory.js +34 -2
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/sdk.gen.d.ts +15 -3
  28. package/dist/sdk.gen.d.ts.map +1 -1
  29. package/dist/types.gen.d.ts +5975 -178
  30. package/dist/types.gen.d.ts.map +1 -1
  31. package/dist/version.d.ts +1 -1
  32. package/docs/llms-full.txt +72 -24
  33. package/package.json +23 -11
  34. package/src/client/client.gen.ts +5 -5
  35. package/src/client/index.ts +10 -10
  36. package/src/client/types.gen.ts +4 -4
  37. package/src/client/utils.gen.ts +6 -6
  38. package/src/client.gen.ts +2 -2
  39. package/src/core/bodySerializer.gen.ts +1 -1
  40. package/src/core/serverSentEvents.gen.ts +1 -1
  41. package/src/core/types.gen.ts +2 -2
  42. package/src/core/utils.gen.ts +2 -2
  43. package/src/factory.ts +4 -4
  44. package/src/index.ts +2 -2
  45. package/src/sdk.gen.ts +39 -5
  46. package/src/types.gen.ts +6273 -462
  47. package/src/version.ts +1 -1
package/README.md CHANGED
@@ -34,7 +34,8 @@ import { createRoxy } from '@roxyapi/sdk';
34
34
 
35
35
  const roxy = createRoxy(process.env.ROXY_API_KEY!);
36
36
 
37
- const { data } = await roxy.astrology.getDailyHoroscope({ path: { sign: 'aries' } });
37
+ const { data, error } = await roxy.astrology.getDailyHoroscope({ path: { sign: 'aries' } });
38
+ if (error) throw error;
38
39
  console.log(data.overview, data.love, data.luckyNumber);
39
40
  ```
40
41
 
@@ -47,38 +48,25 @@ import { createRoxy } from '@roxyapi/sdk';
47
48
 
48
49
  const roxy = createRoxy(process.env.ROXY_API_KEY!);
49
50
 
50
- // Step 1: geocode the birth city (required for any chart endpoint)
51
- const { data } = await roxy.location.searchCities({
52
- query: { q: 'London, UK' },
53
- });
54
- const { latitude, longitude, timezone } = data.cities[0];
51
+ // Step 1: geocode the birth city once. Every chart endpoint takes these three values.
52
+ const { data: place, error: lookupError } = await roxy.location.searchCities({ query: { q: 'London' } });
53
+ if (lookupError) throw lookupError;
54
+ const { latitude, longitude, timezone } = place.cities[0];
55
55
 
56
- // Step 2: Western natal chart. `timezone` can be the IANA string from the
57
- // location response. The server resolves it to the DST-correct offset for
58
- // the chart's own date.
56
+ // Step 2: a Western natal chart. `timezone` is the IANA string from the lookup
57
+ // ("Europe/London"); the server resolves it to the DST-correct offset for the
58
+ // date of the chart.
59
59
  const { data: chart } = await roxy.astrology.generateNatalChart({
60
60
  body: { date: '1990-01-15', time: '14:30:00', latitude, longitude, timezone },
61
61
  });
62
62
 
63
- // Vedic kundli uses the same inputs (timezone optional, defaults to 5.5 IST)
63
+ // Step 3: the same birth as a Vedic kundli. Same inputs, sidereal zodiac.
64
64
  const { data: kundli } = await roxy.vedicAstrology.generateBirthChart({
65
65
  body: { date: '1990-01-15', time: '14:30:00', latitude, longitude, timezone },
66
66
  });
67
67
  ```
68
68
 
69
- `createRoxy` sets the base URL (`https://roxyapi.com/api/v2`) and injects the auth header and SDK identification header on every request.
70
-
71
- ## Location first
72
-
73
- Every chart, horoscope, panchang, dasha, dosha, navamsa, KP, synastry, compatibility, and natal endpoint needs `latitude`, `longitude`, and (for Western) `timezone`. **Never ask users to type coordinates.** Call `roxy.location.searchCities({ query: { q: city } })` first, then feed the result into the chart method.
74
-
75
- ```typescript
76
- const { data } = await roxy.location.searchCities({ query: { q: 'Tokyo' } });
77
- const { latitude, longitude, timezone } = data.cities[0];
78
- // `timezone` is the IANA string ("Asia/Tokyo"). Pass it straight into any
79
- // chart endpoint and the server resolves it to the DST-correct offset for the
80
- // chart's date. If you prefer a decimal, `data.cities[0].utcOffset` also works.
81
- ```
69
+ `createRoxy` sets the base URL (`https://roxyapi.com/api/v2`) and injects the auth header and SDK identification header on every request. Every method returns `{ data, error, response }`; check `error` first, or pass `throwOnError: true` in the call options to have failures throw and `data` typed as always present (see Error handling).
82
70
 
83
71
  ## Domains
84
72
 
@@ -86,7 +74,7 @@ const { latitude, longitude, timezone } = data.cities[0];
86
74
  | Namespace | What it covers |
87
75
  |-----------|----------------|
88
76
  | `roxy.astrology` | Western astrology API for natal birth charts, daily, weekly, monthly, and yearly horoscopes with unique content per s... |
89
- | `roxy.vedicAstrology` | Vedic astrology (Jyotish) and KP API for kundli generation with 15 divisional charts (D1-D60), panchang with choghadi... |
77
+ | `roxy.vedicAstrology` | Vedic astrology (Jyotish) and KP API for kundli generation with the sixteen Shodasavarga divisional charts (D1 to D60... |
90
78
  | `roxy.forecast` | Astrology forecast API that merges upcoming transit aspects, sign ingresses, retrograde stations, new and full moons,... |
91
79
  | `roxy.humanDesign` | Human Design API that generates the full bodygraph from a birth moment: type, strategy, inner authority, profile, def... |
92
80
  | `roxy.chineseAstrology` | Chinese zodiac and BaZi astrology API: Four Pillars charts, Chinese zodiac signs and the Chinese lunisolar calendar f... |
@@ -109,280 +97,354 @@ const { latitude, longitude, timezone } = data.cities[0];
109
97
 
110
98
  ## Most-used endpoints
111
99
 
112
- The highest-demand endpoints by domain, in the order you are most likely to ship them. Each block shows the most-searched API call in that domain so you can pick the feature that drives the most user value first. Full endpoint catalog in the [API reference](https://roxyapi.com/api-reference).
100
+ The highest-demand endpoints by domain, in the order you are most likely to ship them. Every example below reads the same birth through a different domain, and every coordinate comes from one location lookup at the top: one API key, one lookup, and eighteen domains that compose into a single product instead of eighteen separate ones. Full catalog in the [API reference](https://roxyapi.com/api-reference).
101
+
102
+ ### Location first: one lookup feeds every chart
103
+
104
+ Every chart, horoscope, panchang, dasha, dosha, synastry and compatibility endpoint needs `latitude`, `longitude` and `timezone`. Never ask users to type coordinates. Look the city up once and reuse the result in every domain below.
105
+
106
+ ```typescript
107
+ // One lookup feeds every chart below. `timezone` is the IANA name from the city
108
+ // record; the server resolves it to the DST-correct offset for the date of each chart.
109
+ const { data: place, error } = await roxy.location.searchCities({ query: { q: 'New York' } });
110
+ if (error) throw error;
111
+ const { latitude, longitude, timezone } = place.cities[0];
112
+ const birth = { date: '1990-01-15', time: '14:30:00', latitude, longitude, timezone };
113
+
114
+ // A second person for the two-chart calls (synastry, Guna Milan, Human Design connection).
115
+ const { data: london, error: error2 } = await roxy.location.searchCities({ query: { q: 'London' } });
116
+ if (error2) throw error2;
117
+ const { latitude: lat2, longitude: lon2, timezone: tz2 } = london.cities[0];
118
+ const partner = { date: '1992-07-22', time: '09:00:00', latitude: lat2, longitude: lon2, timezone: tz2 };
119
+ ```
113
120
 
114
121
  ### 1. Western astrology API (natal chart, daily horoscope, synastry)
115
122
 
116
- The global astrology app market is $6.27B and almost entirely Western. These endpoints power zodiac dating apps, Co-Star-style natal chart products, daily horoscope features, and lunar-cycle wellness apps.
123
+ Natal chart products, daily horoscope features, dating and compatibility apps, and lunar-cycle wellness apps start here.
117
124
 
118
125
  ```typescript
119
- // Natal chart. The #1 Western query, called on every onboarding.
120
- const { data: natal } = await roxy.astrology.generateNatalChart({
121
- body: { date: '1990-01-15', time: '14:30:00', latitude: 40.7128, longitude: -74.006, timezone: -5 },
122
- });
126
+ // Natal chart. The most requested Western call, run once at onboarding.
127
+ // `birth` carries the latitude, longitude and timezone from the location lookup above.
128
+ const { data: natal } = await roxy.astrology.generateNatalChart({ body: birth });
129
+ // natal.planets[n].name, .sign, .house, .interpretation?.summary; natal.ascendant.sign; natal.aspects
123
130
 
124
- // Daily horoscope. Highest per-user call frequency in the catalog, drives DAUs and push.
131
+ // Daily horoscope. The highest per-user call frequency in the catalog: daily content, streaks, push.
125
132
  const { data: horoscope } = await roxy.astrology.getDailyHoroscope({ path: { sign: 'aries' } });
126
- // horoscope.overview, horoscope.love, horoscope.career, horoscope.luckyNumber
133
+ // horoscope.overview, horoscope.love, horoscope.career, horoscope.column, horoscope.events, horoscope.luckyNumber
127
134
 
128
- // Synastry. The dating-app pro-tier feature, full inter-aspect analysis between two charts.
135
+ // Synastry. Full inter-aspect analysis between two charts, the relationship feature of dating apps.
129
136
  const { data: synastry } = await roxy.astrology.calculateSynastry({
130
- body: {
131
- person1: { date: '1990-01-15', time: '14:30:00', latitude: 40.71, longitude: -74.01, timezone: -5 },
132
- person2: { date: '1992-07-22', time: '09:00:00', latitude: 51.51, longitude: -0.13, timezone: 1 },
133
- },
137
+ body: { person1: birth, person2: partner },
134
138
  });
135
139
  // synastry.compatibilityScore, synastry.interAspects, synastry.analysis.strengths
136
140
 
137
- // Moon phase. Viral for wellness, cycle-tracking, and meditation apps.
141
+ // Moon phase. A zero-setup GET for wellness, cycle-tracking and meditation apps.
138
142
  const { data: moon } = await roxy.astrology.getCurrentMoonPhase({});
143
+ // moon.phase, moon.illumination, moon.sign, moon.meaning?.description
139
144
  ```
140
145
 
141
146
  ### 2. Vedic astrology API (kundli, panchang, dasha, Guna Milan, KP)
142
147
 
143
- The depth moat. India astrology market: $163M in 2024, projected $1.8B by 2030 (49% CAGR). Kundli, panchang, dasha, dosha, and KP are the five Google-dominant queries for every matrimonial platform, kundli generator, and muhurat app.
148
+ Kundli generators, matrimonial matching, muhurta and panchang apps, and KP practitioners. The same `birth` object, read sidereally.
144
149
 
145
150
  ```typescript
146
- // Vedic kundli. Top India astrology keyword. Entry point for every Jyotish product.
147
- const { data: kundli } = await roxy.vedicAstrology.generateBirthChart({
148
- body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
149
- });
151
+ // Vedic kundli. The same birth read sidereally: `birth` reuses the location lookup above.
152
+ const { data: kundli } = await roxy.vedicAstrology.generateBirthChart({ body: birth });
153
+ // kundli.meta.Moon.rashi, kundli.meta.Moon.nakshatra, kundli.houses, kundli.combustion
150
154
 
151
- // Panchang. Tithi, nakshatra, yoga, karana, rahu kaal, abhijit muhurta in one call.
155
+ // Detailed panchang. Tithi, nakshatra, yoga, karana, rahu kaal and the muhurtas for a date and place.
152
156
  const { data: panchang } = await roxy.vedicAstrology.getDetailedPanchang({
153
- body: { date: '2026-04-22', latitude: 28.6139, longitude: 77.209 },
157
+ body: { date: '2026-10-01', latitude, longitude, timezone },
154
158
  });
159
+ // panchang.tithi, panchang.nakshatra, panchang.rahuKaal, panchang.abhijitMuhurta
155
160
 
156
- // Vimshottari dasha. Highest-value single-shot Vedic query.
157
- const { data: dasha } = await roxy.vedicAstrology.getCurrentDasha({
158
- body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
159
- });
161
+ // Vimshottari dasha. The mahadasha, antardasha and pratyantardasha running right now.
162
+ const { data: dasha } = await roxy.vedicAstrology.getCurrentDasha({ body: birth });
163
+ // dasha.mahadasha, dasha.antardasha, dasha.remainingInMahadasha
160
164
 
161
- // Mangal Dosha. Most-asked matrimonial question in India.
162
- const { data: dosha } = await roxy.vedicAstrology.checkManglikDosha({
163
- body: { date: '1990-01-15', time: '14:30:00', latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
164
- });
165
+ // Mangal Dosha. The most asked matrimonial check.
166
+ const { data: dosha } = await roxy.vedicAstrology.checkManglikDosha({ body: birth });
167
+ // dosha.present; dosha.severity and dosha.remedies are set only when present is true
165
168
 
166
- // Guna Milan. 36-point Ashtakoota matrimonial compatibility score.
169
+ // Guna Milan. The 36-point Ashtakoota score behind kundli matching, both people from the lookups above.
167
170
  const { data: milan } = await roxy.vedicAstrology.calculateGunMilan({
168
- body: {
169
- person1: { date: '1990-01-15', time: '14:30:00', latitude: 28.61, longitude: 77.20 },
170
- person2: { date: '1992-07-22', time: '09:00:00', latitude: 19.07, longitude: 72.87 },
171
- },
171
+ body: { person1: birth, person2: partner },
172
172
  });
173
+ // milan.total, milan.percentage, milan.isCompatible, milan.breakdown
173
174
 
174
- // KP ruling planets. Horary answers for "will X happen" questions in real time.
175
+ // KP ruling planets. Horary answers at the moment of the question, for the place looked up above.
175
176
  const { data: kp } = await roxy.vedicAstrology.getKpRulingPlanets({
176
- body: { latitude: 28.6139, longitude: 77.209, timezone: 5.5 },
177
+ body: { latitude, longitude, timezone },
177
178
  });
179
+ // kp.dayLord, kp.moonSublord, kp.rulingPlanets
178
180
  ```
179
181
 
180
- ### 3. Numerology API (life path, full chart, personal year)
182
+ ### 3. Astrology forecast API (transit forecast, cross-domain timeline)
181
183
 
182
- Commodity content with durable demand. `life path number calculator` is among the highest-volume spiritual searches globally. Works without birth time, the easiest domain to integrate.
184
+ Forecast feeds, transit alerts and timing tools. One call returns a dated, significance-scored event list; the timeline variant merges Vedic dasha boundaries and biorhythm critical days into the same list, which no single-domain API can do.
183
185
 
184
186
  ```typescript
185
- // Life Path. The #1 numerology keyword, every calculator page starts here.
186
- const { data: lp } = await roxy.numerology.calculateLifePath({
187
- body: { year: 1990, month: 1, day: 15 },
187
+ // Transit forecast. Transit-to-natal aspects, sign ingresses and retrograde stations over a window.
188
+ // `birthData` is the same `birth` object: date, time, latitude, longitude, timezone.
189
+ const { data: transits } = await roxy.forecast.forecastTransits({
190
+ body: { birthData: birth, startDate: '2026-10-01', endDate: '2026-10-31' },
188
191
  });
189
- // lp.number, lp.type ("single" | "master"), lp.meaning
192
+ // transits.count, transits.events[n].date, .type, .body, .target, .aspect, .significance
190
193
 
191
- // Full numerology chart. Premium one-shot: all six core numbers plus karmic, personal year.
192
- const { data: chart } = await roxy.numerology.generateNumerologyChart({
193
- body: { fullName: 'Jane Smith', year: 1990, month: 1, day: 15 },
194
- });
195
-
196
- // Personal Year. Annual forecast, drives January traffic spikes.
197
- const { data: pyear } = await roxy.numerology.calculatePersonalYear({
198
- body: { month: 1, day: 15, year: 2026 },
194
+ // Cross-domain timeline. The same window with Vedic dasha boundaries and biorhythm critical days merged in.
195
+ const { data: timeline } = await roxy.forecast.generateTimeline({
196
+ body: { birthData: birth, startDate: '2026-10-01', endDate: '2026-10-31' },
199
197
  });
198
+ // timeline.events[n].domain ('western' | 'vedic' | 'biorhythm'), .description, .significance
200
199
  ```
201
200
 
202
- ### 4. Tarot API (daily card, Celtic Cross, three-card, yes / no)
201
+ ### 4. Human Design API (bodygraph, connection)
203
202
 
204
- High search volume, evergreen. The tarot card database is the highest per-endpoint call count in the catalog because apps fetch once and cache.
203
+ Self-discovery apps, coaching bots and compatibility products. The full bodygraph is one call, and the Design side is solved on the exact 88-degree solar arc rather than approximated as calendar days.
205
204
 
206
205
  ```typescript
207
- // Daily card. Stickiest tarot feature. Seed per user for deterministic once-per-day behavior.
208
- const { data: card } = await roxy.tarot.getDailyCard({ body: { seed: 'user-42' } });
209
- // card.card.name, card.card.imageUrl, card.dailyMessage
206
+ // Bodygraph. Type, strategy, authority, profile, definition, centers, channels and all 26 gates in one call.
207
+ // Human Design needs only the birth instant, so it takes the date, time and timezone from the lookup above.
208
+ const { data: hd } = await roxy.humanDesign.generateBodygraph({
209
+ body: { date: birth.date, time: birth.time, timezone: birth.timezone },
210
+ });
211
+ // hd.type, hd.strategy, hd.authority, hd.profile, hd.definition, hd.incarnationCross.name, hd.centers, hd.channels, hd.gates
210
212
 
211
- // Celtic Cross. Professional-reader spread. Premium-tier, ten positions.
212
- const { data: cc } = await roxy.tarot.castCelticCross({
213
- body: { question: 'What should I focus on?', seed: 'user-42' },
213
+ // Connection. Two bodygraphs combined, each of the 36 channels classified by how the pair forms it.
214
+ const { data: connection } = await roxy.humanDesign.calculateConnection({
215
+ body: {
216
+ personA: { date: birth.date, time: birth.time, timezone: birth.timezone },
217
+ personB: { date: partner.date, time: partner.time, timezone: partner.timezone },
218
+ },
214
219
  });
220
+ // connection.totalChannels, connection.summary.electromagnetic, connection.combinedDefinition
221
+ ```
222
+
223
+ ### 5. Chinese zodiac API (BaZi four pillars, zodiac animal, almanac)
215
224
 
216
- // Three-card past-present-future. Most-drawn spread on every tarot platform.
217
- const { data: three } = await roxy.tarot.castThreeCard({
218
- body: { question: 'My next quarter', seed: 'user-42' },
225
+ BaZi readings, zodiac content and Tong Shu date pages. The school splits that make two calculators disagree (`dayBoundary`, `yearBoundary`, `hourClock`) are typed request parameters with named defaults.
226
+
227
+ ```typescript
228
+ // BaZi Four Pillars. The anchor call of the domain, from the same birth instant as every chart above.
229
+ // Each response echoes the `conventions` it was computed under, so a chart can be reproduced, not guessed.
230
+ const { data: bazi } = await roxy.chineseAstrology.generateBaziChart({
231
+ body: { date: birth.date, time: birth.time, timezone: birth.timezone },
219
232
  });
233
+ // bazi.pillars[n].position ('year' | 'month' | 'day' | 'hour'), .stem.element, .branch.animal, .tenGod.name
234
+ // bazi.dayMaster.element, bazi.zodiacAnimal, bazi.fiveElements, bazi.conventions
220
235
 
221
- // Yes / No. Impulse micro-query, highest conversion-to-first-call on tarot surfaces.
222
- const { data: answer } = await roxy.tarot.castYesNo({ body: { question: 'Should I take the offer?' } });
223
- // answer.answer ("Yes" | "No" | "Maybe"), answer.strength
236
+ // Chinese zodiac animal. Defaults `yearBoundary` to the Lunar New Year, the folk rule people mean
237
+ // when they ask which animal they are. Pass 'li-chun' for the classical BaZi boundary.
238
+ const { data: animal } = await roxy.chineseAstrology.calculateZodiacAnimal({ body: { date: birth.date } });
239
+ // animal.animal.name, animal.animal.element, animal.element (the year stem element), animal.interpretation
240
+
241
+ // Almanac day. The Tong Shu view of a date: day officer, mansion, clash animal, favours and avoids.
242
+ const { data: almanac } = await roxy.chineseAstrology.getAlmanacDay({ path: { date: '2026-10-01' } });
243
+ // almanac.dayPillar, almanac.dayOfficer, almanac.clashAnimal, almanac.favours, almanac.avoids
224
244
  ```
225
245
 
226
- ### 5. Human Design API (bodygraph in one call)
246
+ ### 6. Feng shui API (Kua number, flying star chart)
227
247
 
228
- The breakout 2026 self-discovery category. One call returns the full bodygraph from a birth moment: energy type, strategy, authority, profile, definition, incarnation cross, the 9 centers, defined channels, and all 26 gate activations. The Design side is solved on the exact 88-degree solar arc, not approximated as calendar days. No coordinates needed beyond the birth instant, so there is no location setup step.
248
+ Kua numbers with the Eight Mansions map, Xuan Kong flying star charts for any of the nine periods and 24 mountains, annual and monthly star plates, and the annual afflictions.
229
249
 
230
250
  ```typescript
231
- // Full bodygraph. Type, strategy, profile, and definition are always populated.
232
- const { data: hd } = await roxy.humanDesign.generateBodygraph({
233
- body: {
234
- date: '1990-07-04',
235
- time: '10:12:00',
236
- latitude: 40.7128,
237
- longitude: -74.006,
238
- timezone: -4,
239
- },
240
- });
241
- // hd.type, hd.strategy, hd.profile, hd.definition
242
- // hd.centers, hd.channels, hd.gates, hd.incarnationCross
251
+ // Kua number. One birth date and a gender give the personal directions everything else reads off.
252
+ const { data: kua } = await roxy.fengShui.calculateKuaNumber({ body: { date: birth.date, gender: 'female' } });
253
+ // kua.kua, kua.group ('east' | 'west'), kua.trigram.english, kua.sectors[n].direction, .nature, .rank
254
+
255
+ // Flying star natal chart. Period plus facing gives the nine palaces with base, mountain and water stars.
256
+ // Send `facing` (a mountain id like 'bing' or a compass label like 'S2') or `facingDegrees`, not neither.
257
+ const { data: stars } = await roxy.fengShui.generateFlyingStarChart({ body: { period: 9, facing: 'S2' } });
258
+ // stars.facing.label, stars.sitting.label, stars.structure.name, stars.palaces[n].palace, .base, .mountain, .water, .reading
243
259
  ```
244
260
 
245
- ### 6. Forecast API (cross-domain timeline)
261
+ ### 7. Mayan astrology API (Tzolkin day sign, full Maya chart)
246
262
 
247
- The first cross-domain, stateless forecast in the catalog. One call merges Western transit-to-natal aspects, sign ingresses, retrograde stations, Vedic Vimshottari dasha boundaries, and biorhythm critical days into a single significance-scored, time-ordered timeline. The window is clamped to a 90-day horizon. Forecast feeds, transit alerts, and timing tools are the buyers.
263
+ Maya day signs, the Haab and Long Count, and the Aztec tonalpohualli, every value a function of the date under a typed `correlation` convention echoed back in `conventions`.
248
264
 
249
265
  ```typescript
250
- // Merged timeline. Each event carries date, domain, type, description, and significance.
251
- const { data: timeline } = await roxy.forecast.generateTimeline({
266
+ // Tzolkin day sign. The most asked Maya question, answered from a date alone.
267
+ const { data: tzolkin } = await roxy.mesoamericanAstrology.calculateTzolkin({ body: { date: birth.date } });
268
+ // tzolkin.daySign, tzolkin.daySignName, tzolkin.number, tzolkin.trecena, tzolkin.reading
269
+
270
+ // Full Maya chart. Tzolkin, Haab, Long Count, Calendar Round, Lord of the Night, Year Bearer and the Cruz Maya.
271
+ const { data: maya } = await roxy.mesoamericanAstrology.generateMayanChart({ body: { date: birth.date } });
272
+ // maya.tzolkin, maya.haab, maya.longCount, maya.calendarRound, maya.yearBearer, maya.cross, maya.conventions.correlation
273
+ ```
274
+
275
+ ### 8. Vastu Shastra API (entrance analysis, room compliance)
276
+
277
+ Home and plot analysis from typed geometry. Every verdict carries a `source` object naming the text, chapter and verse it rests on, or a convention label where the texts are silent.
278
+
279
+ ```typescript
280
+ // Entrance analysis. Plot, facing and door in; the pada, its devata, the classical effect and the recommended padas out.
281
+ const { data: entrance } = await roxy.vastu.calculateEntrancePada({
282
+ body: { plot: { width: 30, depth: 40, unit: 'feet' }, facing: 'North', doorPosition: 0.4 },
283
+ });
284
+ // entrance.pada, entrance.devata, entrance.effect, entrance.auspiciousness, entrance.recommendedPadas, entrance.source
285
+
286
+ // Room compliance. A verdict per room with the verse or the convention it rests on, and a scored composite.
287
+ const { data: rooms } = await roxy.vastu.calculateRoomCompliance({
252
288
  body: {
253
- birthData: {
254
- date: '1990-07-04',
255
- time: '10:12:00',
256
- latitude: 40.7128,
257
- longitude: -74.006,
258
- timezone: -4,
259
- },
260
- startDate: '2026-06-01',
261
- endDate: '2026-06-30',
289
+ plot: { width: 30, depth: 40, unit: 'feet' },
290
+ facing: 'North',
291
+ rooms: [
292
+ { type: 'kitchen', direction: 'Southeast' },
293
+ { type: 'master-bedroom', direction: 'Southwest' },
294
+ { type: 'puja', direction: 'Northeast' },
295
+ ],
262
296
  },
263
297
  });
264
- // timeline.count, timeline.events
265
- // timeline.events[0].date, timeline.events[0].domain, timeline.events[0].description, timeline.events[0].significance
298
+ // rooms.score, rooms.rooms[n].type, .verdict, .idealDirections, .source
266
299
  ```
267
300
 
268
- ### 7. Chinese astrology API (BaZi four pillars, zodiac sign)
301
+ ### 9. Numerology API (life path, full chart, personal year)
269
302
 
270
- BaZi (Four Pillars of Destiny), the twelve-animal zodiac, and the lunisolar calendar with its almanac. The school splits that make two calculators disagree are typed request parameters with named defaults, echoed back in a `conventions` object on every response, so a chart can be reproduced rather than guessed at. The zodiac routes answer the high-volume consumer questions; BaZi and the almanac are where an app goes deeper.
303
+ Works from the birth date and name alone, no coordinates, which makes it the easiest domain to integrate.
271
304
 
272
305
  ```typescript
273
- // BaZi Four Pillars. The anchor call: the rest of the domain reads off these four pillars.
274
- // `timezone` takes the IANA name, resolved to the DST-correct offset for the birth date.
275
- const { data: bazi } = await roxy.chineseAstrology.generateBaziChart({
276
- body: { date: '1990-07-04', time: '10:12:00', timezone: 'America/New_York' },
277
- });
278
- // bazi.pillars[n].position ('year' | 'month' | 'day' | 'hour'), .stem.element, .branch.animal
279
- // bazi.pillars[n].tenGod.name, .hiddenStems, .naYin
280
- // bazi.dayMaster.element, bazi.zodiacAnimal, bazi.fiveElements, bazi.conventions, bazi.summary
281
-
282
- // Chinese zodiac sign. Defaults `yearBoundary` to 'lunar-new-year', the folk rule people mean
283
- // when they say which animal they are. Pass 'li-chun' to match the classical BaZi boundary.
284
- const { data: sign } = await roxy.chineseAstrology.calculateZodiacAnimal({
285
- body: { date: '1990-07-04' },
306
+ // Life Path. The most searched numerology number, from the birth date alone.
307
+ const { data: lifePath } = await roxy.numerology.calculateLifePath({ body: { year: 1990, month: 1, day: 15 } });
308
+ // lifePath.number, lifePath.type ('single' | 'master'), lifePath.meaning
309
+
310
+ // Full numerology chart. All six core numbers plus karmic lessons, pinnacles and the personal year in one call.
311
+ const { data: numerology } = await roxy.numerology.generateNumerologyChart({
312
+ body: { fullName: 'Jane Smith', year: 1990, month: 1, day: 15 },
286
313
  });
287
- // sign.animal.name ('Horse'), sign.animal.element ('Fire'), sign.animal.polarity
288
- // sign.element is the YEAR STEM element ('Metal'), not the element of the animal
289
- // sign.yearPillar, sign.interpretation
314
+ // numerology.coreNumbers.lifePath, .expression, .soulUrge, numerology.additionalInsights.personalYear
315
+
316
+ // Personal Year. The annual theme, the January feature of every numerology app.
317
+ const { data: personalYear } = await roxy.numerology.calculatePersonalYear({ body: { month: 1, day: 15, year: 2026 } });
318
+ // personalYear.personalYear, personalYear.theme, personalYear.advice
290
319
  ```
291
320
 
292
- ### 8. Feng shui API (Kua number, flying star chart)
321
+ ### 10. Kabbalah API (gematria, birth profile)
293
322
 
294
- Kua numbers with the full Eight Mansions map ranked best to worst, Xuan Kong flying star natal charts for any of the nine periods and 24 mountains, annual and monthly star plates, and the four annual afflictions with exact degree spans. Chinese years resolve at Li Chun, computed astronomically rather than assumed, so the annual charts change over on the real boundary.
323
+ Gematria of a Latin name under a declared transliteration convention, the 72 names, the Tree of Life, and a Hebrew birthday computed from the same birth instant as every chart above.
295
324
 
296
325
  ```typescript
297
- // Kua number: one birth date and a gender gives the personal directions everything else reads off.
298
- const { data: kua } = await roxy.fengShui.calculateKuaNumber({
299
- body: { date: '1990-07-04', gender: 'female' },
300
- });
301
- // kua.kua (8), kua.group ('east' | 'west'), kua.trigram.english ('Mountain')
302
- // kua.sectors[n].direction, .starName, .nature ('auspicious' | 'inauspicious'), .rank, .domain
303
-
304
- // Flying star natal chart. Period plus facing gives the nine palaces with base, mountain
305
- // and water stars. Send `facing` (a mountain id like 'bing' or a compass label like 'S2')
306
- // or `facingDegrees`, not neither.
307
- const { data: chart } = await roxy.fengShui.generateFlyingStarChart({
308
- body: { period: 9, facing: 'S2' },
326
+ // Gematria. A Latin name transliterated under a declared convention, ten ciphers, each with its tradition and source.
327
+ const { data: gematria } = await roxy.kabbalah.calculateGematria({ body: { text: 'Sarah' } });
328
+ // gematria.chosen.hebrew, gematria.values[n].id, .name, .value, .tradition; gematria.matches, gematria.conventions
329
+
330
+ // Birth profile. The Hebrew date and birthday, the three birth angels and the birth sephirah from the instant above.
331
+ const { data: kabbalah } = await roxy.kabbalah.generateBirthProfile({
332
+ body: { date: birth.date, time: birth.time, timezone: birth.timezone },
309
333
  });
310
- // chart.facing.label ('S2'), chart.sitting.label, chart.structure.name ('Double Star at Sitting')
311
- // chart.palaces[n].palace, .base, .mountain, .water, .reading
312
- // chart.mountainCenterStar, chart.waterCenterStar, chart.straddling
334
+ // kabbalah.hebrewDate, kabbalah.hebrewBirthday, kabbalah.angels, kabbalah.sephirah
335
+ ```
336
+
337
+ ### 11. Tarot API (daily card, three-card, Celtic Cross, yes or no)
338
+
339
+ The complete 78-card deck with meanings for love, career, health and spirit. Pass a `seed` per user for deterministic once-per-day draws.
340
+
341
+ ```typescript
342
+ // Daily card. Deterministic per (seed, date), so one user sees one card per day.
343
+ const { data: card } = await roxy.tarot.getDailyCard({ body: { seed: 'user-42' } });
344
+ // card.card.name, card.card.reversed, card.card.imageUrl, card.dailyMessage
345
+
346
+ // Three-card spread. Past, present, future: the most drawn spread on every tarot platform.
347
+ const { data: three } = await roxy.tarot.castThreeCard({ body: { question: 'My next quarter', seed: 'user-42' } });
348
+ // three.positions[n].name, .card.name, .interpretation; three.summary
349
+
350
+ // Celtic Cross. The ten-position professional reading.
351
+ const { data: celtic } = await roxy.tarot.castCelticCross({ body: { question: 'What should I focus on?', seed: 'user-42' } });
352
+ // celtic.positions[n].name, .card.name, .interpretation; celtic.summary
353
+
354
+ // Yes or no. One card, one answer, with its strength.
355
+ const { data: answer } = await roxy.tarot.castYesNo({ body: { question: 'Should I take the offer?' } });
356
+ // answer.answer ('Yes' | 'No' | 'Maybe'), answer.strength, answer.card.name
313
357
  ```
314
358
 
315
- ### 9. Biorhythm API (daily check-in, forecast, compatibility)
359
+ ### 12. Biorhythm API (reading, forecast)
316
360
 
317
- Zero competition domain. Steady search volume with the top Google result being a static calculator page. Pure land-grab for wellness, productivity, sports, and couples apps.
361
+ Ten cycle types across primary, secondary and extended cycles, for wellness, productivity, sports and couples apps.
318
362
 
319
363
  ```typescript
320
- // Daily biorhythm. Physical, emotional, intellectual, intuitive, plus seven extended cycles.
321
- const { data: bio } = await roxy.biorhythm.getDailyBiorhythm({
322
- body: { seed: 'user-1', date: '2026-04-23' },
364
+ // Biorhythm reading. All ten cycles for a date, from the same birth date as every chart above.
365
+ const { data: bio } = await roxy.biorhythm.getReading({ body: { birthDate: birth.date, targetDate: '2026-10-01' } });
366
+ // bio.cycles.physical.value, .phase; bio.energyRating, bio.overallPhase, bio.criticalAlerts, bio.interpretation
367
+
368
+ // Forecast. Every cycle for every day of a window, with the best and worst days named.
369
+ const { data: bioForecast } = await roxy.biorhythm.getForecast({
370
+ body: { birthDate: birth.date, startDate: '2026-10-01', endDate: '2026-10-31' },
323
371
  });
372
+ // bioForecast.summary.bestDay, .worstDay, .averageEnergy; bioForecast.days[n].date, .physical, .emotional, .intellectual, .isCritical
373
+ ```
374
+
375
+ ### 13. Ayurveda API (dosha constitution, dinacharya)
324
376
 
325
- // Multi-day forecast. Best-day / worst-day planner for calendar and coaching products.
326
- const { data: forecast } = await roxy.biorhythm.getForecast({
327
- body: { birthDate: '1990-01-15', startDate: '2026-04-01', endDate: '2026-04-30' },
377
+ The dosha profile read from a verified sidereal chart with the verse on each factor, a daily routine anchored on the local sunrise, and the six seasons from real solar ingresses. Every response carries `meta.disclaimer`.
378
+
379
+ ```typescript
380
+ // Constitution. The dosha profile read from the sidereal chart of the same birth, each factor with its verse.
381
+ const { data: constitution } = await roxy.ayurveda.calculateAyurvedicConstitution({ body: birth });
382
+ // constitution.composite.dominant, .type; constitution.factors[n].id, .input, .doshas, .source; constitution.meta.disclaimer
383
+
384
+ // Dinacharya. Brahma muhurta, the dosha periods and the routine for a date at the place looked up above.
385
+ const { data: dinacharya } = await roxy.ayurveda.getDinacharyaSchedule({
386
+ body: { date: '2026-10-01', latitude, longitude, timezone },
328
387
  });
388
+ // dinacharya.brahmaMuhurta, dinacharya.doshaPeriods, dinacharya.routine
329
389
  ```
330
390
 
331
- ### 10. I Ching API (daily hexagram, coin cast, 64-hexagram catalog)
391
+ ### 14. I Ching API (cast a reading, hexagram catalog)
332
392
 
333
- Meditation apps, decision-making tools, and wisdom chatbots. `i ching API` and `hexagram API` are the keywords.
393
+ All 64 hexagrams, 384 changing lines and 8 trigrams, for meditation apps, decision tools and wisdom chatbots.
334
394
 
335
395
  ```typescript
336
- // Cast a reading. Active divination, primary hexagram plus changing lines and transformed hexagram.
396
+ // Cast a reading. Three coins six times: the primary hexagram, the changing lines and the resulting hexagram.
337
397
  const { data: reading } = await roxy.iching.castReading({ query: { seed: 'user-42' } });
338
- // reading.hexagram, reading.changingLinePositions, reading.resultingHexagram
398
+ // reading.hexagram?.number, reading.hexagram?.english, reading.lines, reading.changingLinePositions, reading.resultingHexagram
339
399
 
340
- // Hexagram catalog. Cache once for all 64 hexagrams.
341
- const { data: hexagrams } = await roxy.iching.listHexagrams({});
342
- // hexagrams.hexagrams has 64 entries
400
+ // Hexagram catalog. Paginated, 20 per page by default; ask for all 64 once and cache them.
401
+ const { data: hexagrams } = await roxy.iching.listHexagrams({ query: { limit: 64 } });
402
+ // hexagrams.total, hexagrams.hexagrams[n].number, .english, .pinyin; fetch roxy.iching.getHexagram({ path: { number } }) for the judgment and lines
343
403
  ```
344
404
 
345
- ### 11. Crystals API (by zodiac, by chakra, birthstone)
405
+ ### 15. Crystal healing API (by zodiac, by chakra, birthstone)
346
406
 
347
- Crystal retail and metaphysical shops use these to build "crystals for [sign]" and "[chakra] chakra stones" pages.
407
+ Crystal retail and metaphysical content: "crystals for [sign]" and "[chakra] chakra stones" pages, plus the birthstone for each month.
348
408
 
349
409
  ```typescript
350
- // By zodiac. Highest-search crystal query pattern.
410
+ // By zodiac. The most searched crystal query pattern.
351
411
  const { data: bySign } = await roxy.crystals.getCrystalsByZodiac({ path: { sign: 'scorpio' } });
352
- // bySign.crystals is a list of { id, name, imageUrl, colors }. Use /crystals/{id} for full properties.
412
+ // bySign.crystals[n].id, .name, .imageUrl, .colors; fetch roxy.crystals.getCrystal({ path: { id } }) for full properties
353
413
 
354
- // By chakra. Second-highest crystal query pattern.
414
+ // By chakra. Wellness and yoga content pages.
355
415
  const { data: byChakra } = await roxy.crystals.getCrystalsByChakra({ path: { chakra: 'Heart' } });
416
+ // byChakra.crystals[n].name, .colors
356
417
 
357
- // Birthstone. Evergreen gift and jewelry SEO.
358
- const { data: birthstone } = await roxy.crystals.getBirthstones({ path: { month: 4 } });
418
+ // Birthstone. Evergreen gift and jewelry pages.
419
+ const { data: birthstone } = await roxy.crystals.getBirthstones({ path: { month: 1 } });
359
420
  ```
360
421
 
361
- ### 12. Dream interpretation API (symbol dictionary, search)
422
+ ### 16. Dream interpretation API (symbol dictionary, search)
362
423
 
363
- Thousands of dream symbols. `dream meaning` is among the highest-volume spiritual searches on Google. Journal apps, AI therapy chatbots, and self-discovery products are the buyers.
424
+ A 2,000+ symbol dream dictionary for journal apps, AI companions and self-discovery products.
364
425
 
365
426
  ```typescript
366
427
  // Symbol detail. Every "what does it mean to dream about X" page lands here.
367
428
  const { data: symbol } = await roxy.dreams.getDreamSymbol({ path: { id: 'flying' } });
368
429
  // symbol.id, symbol.name, symbol.meaning
369
430
 
370
- // Symbol search. Chatbots cache the dictionary locally after one call.
371
- const { data: results } = await roxy.dreams.searchDreamSymbols({ query: { q: 'flying' } });
372
- // results.symbols is an array of matching symbols
431
+ // Symbol search. Chatbots fetch the dictionary once and keep it locally.
432
+ const { data: symbols } = await roxy.dreams.searchDreamSymbols({ query: { q: 'water' } });
433
+ // symbols.symbols[n].id, .name
373
434
  ```
374
435
 
375
- ### 13. Angel Numbers API (1111, 222, 333 meanings plus universal lookup)
436
+ ### 17. Angel numbers API (1111, 222, 333 meanings plus universal lookup)
376
437
 
377
- Gen Z spiritual-tok fuel. `111 meaning`, `222 meaning`, `333 angel number` are evergreen viral queries with massive shareability.
438
+ Meanings for every common sequence, and a lookup that answers any positive integer through its digit root.
378
439
 
379
440
  ```typescript
380
- // By number. Every "meaning of 1111" page is backed by this.
441
+ // By number. Every "meaning of 1111" page is backed by this. The path param is a string.
381
442
  const { data: angel } = await roxy.angelNumbers.getAngelNumber({ path: { number: '1111' } });
382
- // angel.meaning.spiritual, angel.meaning.love, angel.affirmation
443
+ // angel.title, angel.coreMessage, angel.meaning.spiritual, angel.meaning.love, angel.affirmation
383
444
 
384
- // Universal lookup. Works for any positive integer via digit-root fallback.
385
- const { data: anyNumber } = await roxy.angelNumbers.analyzeNumberSequence({ query: { number: '4242' } });
445
+ // Universal lookup. Any positive integer, with the digit root carrying the answer when no curated entry exists.
446
+ const { data: sequence } = await roxy.angelNumbers.analyzeNumberSequence({ query: { number: '4242' } });
447
+ // sequence.digitRoot, sequence.isRepeating, sequence.knownMeaning (null when not curated), sequence.digitRootMeaning?.title
386
448
  ```
387
449
 
388
450
  ## Built for AI agents (Cursor, Claude Code, Copilot, Codex, Gemini CLI)
@@ -449,6 +511,8 @@ Supported: `astrology`, `vedicAstrology`, `forecast`, `humanDesign`, `chineseAst
449
511
 
450
512
  Every method returns `{ data, error, response }`. On 4xx / 5xx the error shape is `{ error: string, code: string }`. Switch on `code` for programmatic handling.
451
513
 
514
+ `data` and `error` are a discriminated pair, so `data` is typed as possibly undefined until `error` is checked; a `strict` project narrows with `if (error)` first. Pass `throwOnError: true` in any call to have failures throw instead, which makes `data` non-optional on that call.
515
+
452
516
  ```typescript
453
517
  const { data, error } = await roxy.astrology.getDailyHoroscope({
454
518
  path: { sign: 'aries' },
@@ -468,7 +532,9 @@ if (error) {
468
532
  | 401 | `invalid_api_key` | Key format invalid or tampered |
469
533
  | 401 | `subscription_not_found` | Key references non-existent subscription |
470
534
  | 401 | `subscription_inactive` | Subscription cancelled, expired, or suspended |
535
+ | 401 | `api_key_revoked` | Key was deleted from the account |
471
536
  | 404 | `not_found` | Resource not found |
537
+ | 4xx | `bad_request` and other status-derived codes | A client error the endpoint itself detected, such as a date window whose `endDate` precedes `startDate` |
472
538
  | 429 | `rate_limit_exceeded` | Monthly quota reached |
473
539
  | 500 | `internal_error` | Server error |
474
540
 
@@ -482,7 +548,7 @@ Every request and response is fully typed. IDE autocomplete shows available meth
482
548
  - [API Reference](https://roxyapi.com/api-reference)
483
549
  - [Pricing](https://roxyapi.com/pricing)
484
550
  - [MCP setup for AI agents](https://roxyapi.com/docs/mcp)
485
- - [Starter apps](https://roxyapi.com/templates)
551
+ - [Templates](https://roxyapi.com/templates)
486
552
  - [Python SDK](https://pypi.org/project/roxy-sdk/)
487
553
  - [Issues](https://github.com/RoxyAPI/sdk-typescript/issues)
488
554