1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "data": [
10 {
11 "name": " jane doe ",
12 "email": "JANE@Example.com",
13 "country": "US",
14 "revenue": "$12,500.00",
15 "active": "yes",
16 "signupDate": "2026-03-14",
17 },
18 {
19 "name": "Bob Smith",
20 "email": "bob@example.com",
21 "country": "GB",
22 "revenue": 400,
23 "active": "no",
24 "signupDate": "2026-05-02",
25 },
26 {
27 "name": "Ana Silva",
28 "email": "ana@example.com",
29 "country": "BR",
30 "revenue": "2,300",
31 "active": "yes",
32 "signupDate": "2026-06-19",
33 },
34 {
35 "name": " Chen Wei",
36 "email": "chen@example.com",
37 "country": "US",
38 "revenue": "n/a",
39 "active": "yes",
40 "signupDate": "2026-07-01",
41 },
42 {
43 "name": "Sam Lee",
44 "email": "sam@example.com",
45 "country": "US",
46 "revenue": 9800,
47 "active": "yes",
48 "signupDate": "2026-08-05",
49 },
50 ],
51 "transforms": [
52 {
53 "op": "trim",
54 "field": "name",
55 },
56 {
57 "op": "lowercase",
58 "field": "email",
59 },
60 {
61 "op": "cast",
62 "field": "revenue",
63 "to": "number",
64 },
65 {
66 "op": "addField",
67 "field": "summary",
68 "template": "{{name}} ({{country}}) - {{email}}",
69 },
70 ],
71 "filters": [
72 {
73 "field": "country",
74 "operator": "equals",
75 "value": "US",
76 },
77 {
78 "field": "active",
79 "operator": "equals",
80 "value": "yes",
81 },
82 {
83 "field": "revenue",
84 "operator": "greaterOrEqual",
85 "value": 1000,
86 },
87 ],
88 "exportFormats": [
89 "csv",
90 "xlsx",
91 ],
92}
93
94
95run = client.actor("nerolabs/dataset-filter-transform").call(run_input=run_input)
96
97
98print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
99for item in client.dataset(run.default_dataset_id).iterate_items():
100 print(item)
101
102