1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchQueries": [
12 "hotels in New York"
13 ],
14 "hotelUrls": [],
15 "checkInDate": "",
16 "checkOutDate": "",
17 "priceWindowEnd": "",
18 "adults": 2,
19 "children": 0,
20 "rooms": 1,
21 "currency": "USD",
22 "languageCode": "en",
23 "countryCode": "us",
24 "maxResults": 20,
25 "sortBy": "relevance",
26 "includePrices": true,
27 "includeReviews": false,
28 "proxyConfiguration": {
29 "useApifyProxy": true
30 }
31};
32
33
34const run = await client.actor("ahmed_jasarevic/google-hotels-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44