1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "reviews": [
9 {
10 "id": "r1",
11 "title": "Great value",
12 "text": "Excellent build quality and it arrived two days early. Easy to set up, highly recommend.",
13 "rating": 5,
14 },
15 {
16 "id": "r2",
17 "title": "Stopped working",
18 "text": "Broken after three weeks. Customer service refused a refund. Waste of money.",
19 "rating": 1,
20 },
21 {
22 "id": "r3",
23 "text": "It is ok for the price, nothing special.",
24 "rating": 3,
25 },
26 {
27 "id": "r4",
28 "title": "Ottimo prodotto",
29 "text": "Materiali solidi e spedizione veloce, lo consiglio.",
30 "rating": 5,
31 },
32 {
33 "id": "r5",
34 "text": "Not good. The packaging was damaged and the seller was slow to reply.",
35 "rating": 2,
36 },
37 ] }
38
39
40run = client.actor("jobdata_labs/review-sentiment-analyzer").call(run_input=run_input)
41
42
43print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
44for item in client.dataset(run.default_dataset_id).iterate_items():
45 print(item)
46
47