-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
29 lines (24 loc) · 958 Bytes
/
example.js
File metadata and controls
29 lines (24 loc) · 958 Bytes
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
import { createRoxy } from '@roxyapi/sdk';
const roxy = createRoxy(process.env.ROXY_API_KEY);
/**
* Daily horoscope by zodiac sign: returns transit-driven content unique per sign.
* Forecast covers overview, love, career, health, finance, lucky number, lucky color, compatible signs, moon phase, energy rating.
*/
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('Love: ', data.love);
console.log('Career: ', data.career);
console.log('');
console.log('Lucky number:', data.luckyNumber);
console.log('Lucky color: ', data.luckyColor);
console.log('Moon phase: ', data.moonPhase);
console.log('Energy rating:', data.energyRating, '/ 10');
}
main().catch(console.error);