1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "rows": [
10 {
11 "title": "Trailblazer 40L Hiking Backpack",
12 "sku": "NP-BP-040",
13 "price": "$89.99",
14 "inStock": True,
15 "rating": 4.6,
16 "url": "https://shop.northpeak.example/p/trailblazer-40?utm_source=feed",
17 "seller": {
18 "name": "NorthPeak Outfitters",
19 "country": "US",
20 },
21 "listedAt": "2026-10-28T09:15:00Z",
22 },
23 {
24 "title": "Summit Down Jacket",
25 "sku": "NP-JK-210",
26 "price": "$249.00",
27 "inStock": True,
28 "rating": 4.8,
29 "url": "https://shop.northpeak.example/p/summit-down-jacket",
30 "seller": {
31 "name": "NorthPeak Outfitters",
32 "country": "US",
33 },
34 "listedAt": "2026-10-29T16:40:00Z",
35 },
36 {
37 "title": "Ridge Trekking Poles (pair)",
38 "sku": "CL-TP-002",
39 "price": "$54.50",
40 "inStock": False,
41 "rating": 4.3,
42 "url": "https://cliffline.example/gear/ridge-poles",
43 "seller": {
44 "name": "Cliffline Gear",
45 "country": "CA",
46 },
47 "listedAt": "Oct 30, 2026",
48 },
49 {
50 "title": "Lumen 400 Headlamp",
51 "sku": "BR-HL-400",
52 "price": "$29.95",
53 "inStock": True,
54 "rating": 4.6,
55 "url": "https://www.brightway.example/headlamps/lumen-400",
56 "seller": {
57 "name": "Brightway Supply",
58 "country": "GB",
59 },
60 "listedAt": "2026-11-02 14:05",
61 },
62 {
63 "title": "Trailblazer 40L Hiking Backpack",
64 "sku": "np-bp-040",
65 "price": "$89.99",
66 "inStock": True,
67 "rating": 4.6,
68 "url": "https://shop.northpeak.example/p/trailblazer-40",
69 "seller": {
70 "name": "NorthPeak Outfitters",
71 "country": "US",
72 },
73 "listedAt": "2026-11-03T08:00:00Z",
74 },
75 {
76 "title": "Alpine 2-Person Tent",
77 "sku": "CL-TN-200",
78 "price": "$189.00",
79 "inStock": True,
80 "rating": 4.4,
81 "url": "https://cliffline.example/gear/alpine-2p",
82 "seller": {
83 "name": "Cliffline Gear",
84 "country": "CA",
85 },
86 "listedAt": "Nov 1, 2026",
87 },
88 {
89 "title": "Merino Hiking Socks (3 pack)",
90 "sku": "WB-SK-003",
91 "price": "$24.00",
92 "inStock": True,
93 "rating": 4.7,
94 "url": "https://woolbridge.example/socks/merino-3",
95 "seller": {
96 "name": "Woolbridge Co",
97 "country": "NZ",
98 },
99 "listedAt": "2026-10-27T11:20:00Z",
100 },
101 {
102 "title": "Canyon Water Filter",
103 "sku": "BR-WF-100",
104 "price": "",
105 "inStock": True,
106 "rating": None,
107 "url": "https://www.brightway.example/water/canyon-filter",
108 "seller": {
109 "name": "Brightway Supply",
110 "country": "GB",
111 },
112 "listedAt": "2026-11-04T10:00:00Z",
113 },
114 {
115 "title": "Glacier Insulated Bottle 1L",
116 "sku": "WB-BT-001",
117 "price": "$32.00",
118 "inStock": True,
119 "rating": 4.6,
120 "url": "https://woolbridge.example/bottles/glacier-1l",
121 "seller": {
122 "name": "Woolbridge Co",
123 "country": "NZ",
124 },
125 "listedAt": "Oct 31, 2026",
126 },
127 {
128 "title": "Basecamp Camp Stove",
129 "sku": "CL-ST-050",
130 "price": "$74.99",
131 "inStock": "yes",
132 "rating": 4.2,
133 "url": "https://cliffline.example/gear/basecamp-stove",
134 "seller": {
135 "name": "Cliffline Gear",
136 "country": "CA",
137 },
138 "listedAt": "2026-11-05 09:30",
139 },
140 ],
141 "transforms": [
142 {
143 "op": "cast",
144 "field": "price",
145 "to": "number",
146 },
147 {
148 "op": "compute",
149 "field": "priceWithTax",
150 "expression": "price * 1.2",
151 "round": 2,
152 },
153 {
154 "op": "extractDomain",
155 "field": "url",
156 "into": "shop",
157 },
158 {
159 "op": "dateFormat",
160 "field": "listedAt",
161 "format": "date",
162 },
163 ],
164 "filters": [
165 {
166 "field": "inStock",
167 "operator": "isTrue",
168 },
169 {
170 "field": "price",
171 "operator": "lessThan",
172 "value": 200,
173 },
174 ],
175 "dedupeFields": ["sku"],
176 "sortBy": [
177 "rating desc",
178 "price",
179 ],
180 "outputFields": [
181 "title",
182 "sku",
183 "price",
184 "priceWithTax",
185 "rating",
186 "shop",
187 "seller.name -> seller",
188 "listedAt",
189 ],
190}
191
192
193run = client.actor("saliga/dataset-filter-transform").call(run_input=run_input)
194
195
196print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
197for item in client.dataset(run.default_dataset_id).iterate_items():
198 print(item)
199
200