1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "rows": [
10 {
11 "id": "r1",
12 "product": "Steel kettle",
13 "text": "Boils fast and the handle stays cool. Exactly what I wanted for the price.",
14 },
15 {
16 "id": "r2",
17 "product": "Steel kettle",
18 "text": "Started leaking from the base after two weeks, and support never answered my emails.",
19 },
20 {
21 "id": "r3",
22 "product": "Desk lamp",
23 "text": "Lovely warm light and easy to assemble, but the switch feels flimsy.",
24 },
25 ],
26 "textFields": ["text"],
27 "labels": [
28 "positive",
29 "negative",
30 "mixed",
31 ],
32 "model": "openai/gpt-4.1-mini",
33 "keepFields": ["id"],
34}
35
36
37run = client.actor("humble-echidna/ai-rows").call(run_input=run_input)
38
39
40print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
41for item in client.dataset(run.default_dataset_id).iterate_items():
42 print(item)
43
44