1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6    token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11    "search": "grill",
12    "searchLocation": "Los Angeles",
13    "endPageForPhotos": 1,
14    "reviewSort": "relevance_desc",
15    "startUrls": [
16        "https://www.yelp.com/biz/maxs-restaurant-glendale-glendale-3",
17        "https://www.yelp.com/search?find_desc=max&find_loc=Los+Angeles%2C+CA",
18        "https://www.yelp.com/collection/qGqt9YpsLBCH5nruuVCK2A/Food",
19        "https://www.yelp.com/collections/user?userid=a_UbCGv_MTAHFs3P_zxUDA",
20        "https://www.yelp.com/events/la/browse?start_date=20230215",
21        "https://www.yelp.com/events/monterey-park-monterey-park-strong-star-ballroom-shooting-community-resources"
22    ],
23    "maxItems": 20,
24    "endPage": 1,
25    "startPageForReviews": 1,
26    "endPageForReviews": 1,
27    "extendOutputFunction": ($) => { return {} },
28    "customMapFunction": (object) => { return {...object} },
29    "proxy": {
30        "useApifyProxy": true
31    }
32};
33
34
35const run = await client.actor("epctex/yelp-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42    console.dir(item);
43});
44
45