-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.ts
More file actions
40 lines (35 loc) · 1.35 KB
/
example.ts
File metadata and controls
40 lines (35 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY!);
/**
* Daily horoscope by zodiac sign: transit-based forecast with house activations unique per sign.
* Returns overview, love, career, health, finance, lucky fields, active transits, moon data, energy rating.
* Part of the RoxyAPI Western astrology domain.
*/
async function main() {
const { data, error } = await roxy.astrology.getDailyHoroscope({
path: { sign: 'aries' },
});
if (error) throw new Error(error.error);
console.log('Sign:', data.sign);
console.log('Date:', data.date);
console.log('');
console.log('Overview:', data.overview);
console.log('');
console.log('Love: ', data.love);
console.log('Career: ', data.career);
console.log('Health: ', data.health);
console.log('Finance: ', data.finance);
console.log('Advice: ', data.advice);
console.log('');
console.log('Lucky number:', data.luckyNumber);
console.log('Lucky color: ', data.luckyColor);
console.log('Compatible signs:', data.compatibleSigns);
console.log('');
console.log('Moon sign: ', data.moonSign);
console.log('Moon phase:', data.moonPhase);
console.log('Energy rating:', data.energyRating, '/ 10');
console.log('');
console.log('Active transits:');
for (const t of data.activeTransits) console.log(' -', t);
}
main().catch(console.error);