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 "netReservationOnly": false,
16 "sortBy": "default",
17 "urls": [
18 "https://www.hotpepper.jp/SA11/",
19 "https://www.hotpepper.jp/SA11/G001/",
20 "https://www.hotpepper.jp/SA11/G001/bgn2/",
21 "https://www.hotpepper.jp/SA11/Y055/G001/",
22 "https://www.hotpepper.jp/SA11/Y005/X020/G001/",
23 "https://www.hotpepper.jp/SA11/net1/",
24 "https://www.hotpepper.jp/SA11/rank/",
25 "https://www.hotpepper.jp/strJ000239981/",
26 "https://www.hotpepper.jp/strJ000239981/map/",
27 "https://www.hotpepper.jp/strJ000239981/report/",
28 "https://www.hotpepper.jp/strJ000239981/food/",
29 "https://www.hotpepper.jp/strJ000239981/?vos=nhppvccp99002"
30 ],
31 "includeReviews": false,
32 "maxReviewsPerShop": 20,
33 "maxItems": 20,
34 "proxy": {
35 "useApifyProxy": true
36 },
37 "incrementalMode": false,
38 "emitUnchanged": false,
39 "emitExpired": true
40};
41
42
43const run = await client.actor("abotapi/hotpepper-jp-scraper").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53