1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "offers": """Account,Source,Offer Id,Revision,Sku,Variant,Currency,Market,Kind,Amount,Decimals,Row Id,Approved At,Effective Start,Effective End,Effective End Inclusive,Display Start,Display End,Display End Inclusive,Exception Activation Id,Exception Amount,Exception Reason,Export Note
10fictional-account,approved-ledger,offer-1,rev-1,SKU-001,standard,USD,US,fixed_price,10.00,2,approval-1,2026-09-30T12:00:00Z,2026-10-01T00:00:00Z,2026-11-01T00:00:00Z,false,2026-10-01T00:00:00Z,2026-11-01T00:00:00Z,false,,,,Fictional extra column; not included in the report
11""",
12 "activations": """Account,Source,Offer Id,Revision,Sku,Variant,Currency,Market,Kind,Amount,Decimals,Row Id,Activation Id,Campaign Id,Starts At,Ends At,End Inclusive,Owner,Spend,Spend Period,Export Note
13fictional-account,approved-ledger,offer-1,rev-1,SKU-001,standard,USD,US,fixed_price,10.00,2,activation-row-1,activation-1,campaign-1,2026-10-01T00:00:00Z,2026-11-01T00:00:00Z,false,Fictional reviewer,10.00,2026-10,Fictional extra column; not included in the report
14fictional-account,approved-ledger,offer-1,rev-1,SKU-001,standard,USD,US,fixed_price,12.00,2,activation-row-2,activation-2,campaign-2,2026-10-01T00:00:00Z,2026-11-01T00:00:00Z,false,Fictional reviewer,10.00,2026-10,Fictional extra column; not included in the report
15fictional-account,approved-ledger,offer-1,rev-unmapped,SKU-001,standard,USD,US,fixed_price,10.00,2,activation-row-3,activation-3,campaign-3,2026-10-01T00:00:00Z,2026-11-01T00:00:00Z,false,Fictional reviewer,10.00,2026-10,Fictional extra column; not included in the report
16""",
17 "observations": """[
18 {
19 \"Account\": \"fictional-account\",
20 \"Source\": \"approved-ledger\",
21 \"Offer Id\": \"offer-1\",
22 \"Revision\": \"rev-1\",
23 \"Sku\": \"SKU-001\",
24 \"Variant\": \"standard\",
25 \"Currency\": \"USD\",
26 \"Market\": \"US\",
27 \"Kind\": \"fixed_price\",
28 \"Amount\": \"10.00\",
29 \"Decimals\": \"2\",
30 \"Row Id\": \"observation-1\",
31 \"Observed At\": \"2026-10-02T11:00:00Z\",
32 \"Export Note\": \"Fictional extra column; not included in the report\"
33 }
34]
35""",
36 "mapping": {
37 "ignore_unmapped_columns": True,
38 "offers": [
39 {
40 "source": "Account",
41 "target": "account",
42 },
43 {
44 "source": "Source",
45 "target": "source",
46 },
47 {
48 "source": "Offer Id",
49 "target": "offer_id",
50 },
51 {
52 "source": "Revision",
53 "target": "revision",
54 },
55 {
56 "source": "Sku",
57 "target": "sku",
58 },
59 {
60 "source": "Variant",
61 "target": "variant",
62 },
63 {
64 "source": "Currency",
65 "target": "currency",
66 },
67 {
68 "source": "Market",
69 "target": "market",
70 },
71 {
72 "source": "Kind",
73 "target": "kind",
74 },
75 {
76 "source": "Amount",
77 "target": "amount",
78 },
79 {
80 "source": "Decimals",
81 "target": "decimals",
82 },
83 {
84 "source": "Row Id",
85 "target": "row_id",
86 },
87 {
88 "source": "Approved At",
89 "target": "approved_at",
90 },
91 {
92 "source": "Effective Start",
93 "target": "effective_start",
94 },
95 {
96 "source": "Effective End",
97 "target": "effective_end",
98 },
99 {
100 "source": "Effective End Inclusive",
101 "target": "effective_end_inclusive",
102 },
103 {
104 "source": "Display Start",
105 "target": "display_start",
106 },
107 {
108 "source": "Display End",
109 "target": "display_end",
110 },
111 {
112 "source": "Display End Inclusive",
113 "target": "display_end_inclusive",
114 },
115 {
116 "source": "Exception Activation Id",
117 "target": "exception_activation_id",
118 },
119 {
120 "source": "Exception Amount",
121 "target": "exception_amount",
122 },
123 {
124 "source": "Exception Reason",
125 "target": "exception_reason",
126 },
127 ],
128 "activations": [
129 {
130 "source": "Account",
131 "target": "account",
132 },
133 {
134 "source": "Source",
135 "target": "source",
136 },
137 {
138 "source": "Offer Id",
139 "target": "offer_id",
140 },
141 {
142 "source": "Revision",
143 "target": "revision",
144 },
145 {
146 "source": "Sku",
147 "target": "sku",
148 },
149 {
150 "source": "Variant",
151 "target": "variant",
152 },
153 {
154 "source": "Currency",
155 "target": "currency",
156 },
157 {
158 "source": "Market",
159 "target": "market",
160 },
161 {
162 "source": "Kind",
163 "target": "kind",
164 },
165 {
166 "source": "Amount",
167 "target": "amount",
168 },
169 {
170 "source": "Decimals",
171 "target": "decimals",
172 },
173 {
174 "source": "Row Id",
175 "target": "row_id",
176 },
177 {
178 "source": "Activation Id",
179 "target": "activation_id",
180 },
181 {
182 "source": "Campaign Id",
183 "target": "campaign_id",
184 },
185 {
186 "source": "Starts At",
187 "target": "starts_at",
188 },
189 {
190 "source": "Ends At",
191 "target": "ends_at",
192 },
193 {
194 "source": "End Inclusive",
195 "target": "end_inclusive",
196 },
197 {
198 "source": "Owner",
199 "target": "owner",
200 },
201 {
202 "source": "Spend",
203 "target": "spend",
204 },
205 {
206 "source": "Spend Period",
207 "target": "spend_period",
208 },
209 ],
210 "observations": [
211 {
212 "source": "Account",
213 "target": "account",
214 },
215 {
216 "source": "Source",
217 "target": "source",
218 },
219 {
220 "source": "Offer Id",
221 "target": "offer_id",
222 },
223 {
224 "source": "Revision",
225 "target": "revision",
226 },
227 {
228 "source": "Sku",
229 "target": "sku",
230 },
231 {
232 "source": "Variant",
233 "target": "variant",
234 },
235 {
236 "source": "Currency",
237 "target": "currency",
238 },
239 {
240 "source": "Market",
241 "target": "market",
242 },
243 {
244 "source": "Kind",
245 "target": "kind",
246 },
247 {
248 "source": "Amount",
249 "target": "amount",
250 },
251 {
252 "source": "Decimals",
253 "target": "decimals",
254 },
255 {
256 "source": "Row Id",
257 "target": "row_id",
258 },
259 {
260 "source": "Observed At",
261 "target": "observed_at",
262 },
263 ],
264 },
265 "asOf": "2026-10-02T12:00:00Z",
266}
267
268
269run = client.actor("critd/campaign-offer-guard").call(run_input=run_input)
270
271
272print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
273for item in client.dataset(run.default_dataset_id).iterate_items():
274 print(item)
275
276