1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableCompanySearch": true,
12 "searchTasks": [
13 {
14 "query": "airbnb",
15 "maxResults": 10
16 },
17 {
18 "query": "stripe",
19 "maxResults": 10
20 }
21 ],
22 "searchMaxResults": 10,
23 "maxPagesPerTask": 3,
24 "enableCompanyDetails": true,
25 "enableCategoryBrowse": false,
26 "categoryMaxResults": 50,
27 "enableReviews": false,
28 "maxReviewsPerCompany": 30,
29 "enableScrapeByUrl": false,
30 "maxItems": 1000,
31 "concurrency": 8,
32 "proxyConfiguration": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ],
37 "apifyProxyCountry": "US"
38 }
39};
40
41
42const run = await client.actor("b2b_leads/trustpilot-real-time-data-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52