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 "regionPath": "California",
13 "tags": [
14 "backpacking"
15 ],
16 "urls": [
17 "https://www.alltrails.com/us/california"
18 ],
19 "followSubGrids": false,
20 "fetchDetails": false,
21 "minRating": 0,
22 "minReviews": 0,
23 "featuresFilter": [],
24 "maxItems": 20,
25 "maxPages": 0,
26 "incrementalMode": false,
27 "emitUnchanged": false,
28 "emitExpired": false,
29 "maxNotifyListings": 50,
30 "proxyConfiguration": {
31 "useApifyProxy": true,
32 "apifyProxyGroups": [
33 "UNBLOCKER"
34 ]
35 }
36};
37
38
39const run = await client.actor("abotapi/alltrails-hiking-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49