1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "locations": [
13 "東京"
14 ],
15 "keywords": [],
16 "urls": [
17 "https://travel.rakuten.co.jp/HOTEL/70818/70818.html",
18 "https://travel.rakuten.co.jp/yado/tokyo/",
19 "https://travel.rakuten.co.jp/yado/tokyo/tokyo.html",
20 "https://search.travel.rakuten.co.jp/ds/yado/osaka/",
21 "https://search.travel.rakuten.co.jp/ds/yado/tokyo/p2",
22 "https://kw.travel.rakuten.co.jp/keyword/Search.do?f_query=%90%56%8F%68",
23 "https://kw.travel.rakuten.co.jp/keyword/Search.do?f_query=%90%56%8F%68&f_next=2",
24 "https://travel.rakuten.co.jp/dayuse/",
25 "https://travel.rakuten.co.jp/dayuse/tokyo/",
26 "https://hotel.travel.rakuten.co.jp/hotelinfo/plan/10956",
27 "https://travel.rakuten.co.jp/HOTEL/11011/review.html"
28 ],
29 "sortBy": "recommended",
30 "sortResultsBy": "site_order",
31 "fetchDetails": true,
32 "fetchReviews": false,
33 "maxReviews": 20,
34 "maxItems": 20,
35 "maxPages": 0,
36 "proxy": {
37 "useApifyProxy": true
38 },
39 "incrementalMode": false,
40 "emitUnchanged": false,
41 "emitExpired": false,
42 "ignoreFieldsForChanges": []
43};
44
45
46const run = await client.actor("abotapi/rakuten-travel-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56