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 "urls": [
13 "https://www.local.ch/de/s/restaurant/zurich",
14 "https://www.local.ch/de/s/pizza",
15 "https://www.local.ch/de/q/zuerich/restaurant",
16 "https://www.local.ch/de/q?what=restaurant&where=zuerich",
17 "https://www.local.ch/de/s/restaurant/zurich?page=2",
18 "https://www.local.ch/de/s/restaurant/zurich?sorting=rating",
19 "https://www.local.ch/de/d/zuerich/8004/restaurant/restaurant-milano-rPs42JlyMK6zuDlCzLm1MA",
20 "https://www.local.ch/de/d/rPs42JlyMK6zuDlCzLm1MA",
21 "https://www.local.ch/fr/s/restaurant/geneve",
22 "https://www.local.ch/en/q/zurich/restaurant",
23 "https://www.local.ch/de/s/restaurant/8001",
24 "https://www.local.ch/de/s/restaurant/zh",
25 "https://local.ch/de/s/restaurant/zurich",
26 "https://www.local.ch/de/entries/XlOM3DSqSoeHWjGtRZozEw/vcard"
27 ],
28 "maxPages": 0,
29 "maxListings": 20,
30 "proxy": {
31 "useApifyProxy": true,
32 "apifyProxyGroups": [
33 "RESIDENTIAL"
34 ],
35 "apifyProxyCountry": "CH"
36 },
37 "incrementalMode": false,
38 "emitUnchanged": false,
39 "emitExpired": false
40};
41
42
43const run = await client.actor("abotapi/local-ch-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