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 "searchType": "keyword",
13 "query": "bookshop.org",
14 "category": "book_store",
15 "urls": [
16 "https://www.trustpilot.com/review/bookshop.org"
17 ],
18 "site": "www.trustpilot.com",
19 "scrapeReviews": true,
20 "maxReviewsPerBusiness": 20,
21 "reviewLanguage": "all",
22 "reviewSort": "recency",
23 "verifiedOnly": false,
24 "reviewsSince": "any",
25 "fetchDetails": true,
26 "maxItems": 50,
27 "maxPages": 0,
28 "incrementalMode": false,
29 "emitUnchanged": false,
30 "emitExpired": false,
31 "maxNotifyListings": 50,
32 "proxyConfiguration": {
33 "useApifyProxy": true
34 }
35};
36
37
38const run = await client.actor("abotapi/trustpilot-reviews-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48