1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "startUrls": [{ "url": "https://www.trustpilot.com/review/amazon.co.uk" }],
10 "maxReviews": 10,
11 "googleSheets": {
12 "spreadsheetId": "",
13 "sheetName": "Trustpilot Reviews",
14 "credentialsJson": """{
15 \"type\": \"service_account\",
16 \"project_id\": \"your-project-id\",
17 \"private_key_id\": \"...\",
18 \"private_key\": \"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n\",
19 \"client_email\": \"your-service-account@your-project-id.iam.gserviceaccount.com\",
20 \"client_id\": \"...\",
21 \"token_uri\": \"https://oauth2.googleapis.com/token\"
22}""",
23 },
24 "browserFallbackMode": "http",
25 "trustScoreTrend": {
26 "enabled": True,
27 "historyKey": "TRUST_SCORE_HISTORY",
28 "reportKey": "TRUST_SCORE_TRENDS",
29 "maxSnapshots": 30,
30 },
31}
32
33
34run = client.actor("netdesignr/trustpilot-reviews-scraper-pro").call(run_input=run_input)
35
36
37print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
38for item in client.dataset(run.default_dataset_id).iterate_items():
39 print(item)
40
41