1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchType": "auto",
12 "findDesc": "pizza",
13 "findLoc": "New York, NY",
14 "maxResults": 3,
15 "market": "us",
16 "sortBy": "recommended",
17 "start": 0,
18 "enrichDetails": true,
19 "includeReviews": false,
20 "reviewLimit": 20,
21 "reviewOffset": 0,
22 "includePhotos": false,
23 "photoLimit": 10,
24 "includePresentation": false,
25 "includeMobileSubsurfaces": false,
26 "mobileSubsurfaces": [],
27 "communityQuestionsFirst": 5,
28 "registerDevice": false,
29 "phoneCountry": "US",
30 "provider": "app_api",
31 "workerBaseUrl": ""
32};
33
34
35const run = await client.actor("lentic_clockss/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