1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "currentItems": [
10 {
11 "id": "ad1",
12 "title": "Free trial - AI CRM",
13 "impressions": 420000,
14 "clicks": 16800,
15 "engagementRate": 4.2,
16 "activeDays": 8,
17 "adsCount": 6,
18 "offerStrength": 88,
19 "ctaStrength": 82,
20 },
21 {
22 "id": "ad2",
23 "title": "Save 20% annual plan",
24 "impressions": 160000,
25 "clicks": 3900,
26 "engagementRate": 2.1,
27 "activeDays": 31,
28 "adsCount": 3,
29 "offerStrength": 66,
30 "ctaStrength": 58,
31 },
32 ],
33 "previousItems": [{
34 "id": "ad1",
35 "title": "AI CRM",
36 "impressions": 280000,
37 "clicks": 9200,
38 "engagementRate": 3.4,
39 "activeDays": 5,
40 "adsCount": 4,
41 "offerStrength": 72,
42 "ctaStrength": 70,
43 }],
44}
45
46
47run = client.actor("quanmatrix/facebook-ads-creative-offer-intelligence").call(run_input=run_input)
48
49
50print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
51for item in client.dataset(run.default_dataset_id).iterate_items():
52 print(item)
53
54