1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search": {
12 "query": "Kuala Lumpur",
13 "checkIn": "",
14 "checkOut": "",
15 "adults": 2,
16 "children": 0,
17 "childAges": "",
18 "rooms": 1,
19 "limit": 20,
20 "offset": 0,
21 "propertyType": "any",
22 "starRatingMin": "0",
23 "reviewScoreMin": "0",
24 "cityCenterDistance": "any"
25 },
26 "property": {
27 "propertyId": 87219375,
28 "propertyUrl": "",
29 "checkIn": "",
30 "checkOut": "",
31 "adults": 2,
32 "children": 0,
33 "childAges": "",
34 "rooms": 1,
35 "enrichPricing": false
36 },
37 "reviews": {
38 "propertyId": 61727253,
39 "propertyUrl": "",
40 "limit": 20,
41 "offset": 0,
42 "sortBy": "newest"
43 }
44};
45
46
47const run = await client.actor("crawlio/agoda-hotel-scraper").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57