1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "jsonData": [
9 {
10 "adArchiveID": "100001",
11 "pageID": "111",
12 "pageName": "Example Skincare",
13 "isActive": True,
14 "startDate": 1782904000,
15 "endDate": 1795000000,
16 "collationCount": 5,
17 "publisherPlatform": [
18 "FACEBOOK",
19 "INSTAGRAM",
20 ],
21 "snapshot": {
22 "body": { "text": "Clear skin in 14 days" },
23 "title": "Glow Serum",
24 "linkUrl": "https://glowskin.com/serum",
25 "ctaText": "Shop now",
26 "displayFormat": "IMAGE",
27 "pageLikeCount": 52000,
28 },
29 },
30 {
31 "adArchiveID": "100002",
32 "pageID": "111",
33 "pageName": "Example Skincare",
34 "isActive": True,
35 "startDate": 1791976000,
36 "endDate": 1795000000,
37 "collationCount": 1,
38 "publisherPlatform": [
39 "FACEBOOK",
40 "INSTAGRAM",
41 ],
42 "snapshot": {
43 "body": { "text": "Clear skin in 14 days" },
44 "title": "Serum + Cream bundle",
45 "linkUrl": "https://glowskin.com/serum",
46 "ctaText": "Shop now",
47 "displayFormat": "VIDEO",
48 "pageLikeCount": 52000,
49 },
50 },
51 {
52 "adArchiveID": "100003",
53 "pageID": "111",
54 "pageName": "Example Skincare",
55 "isActive": True,
56 "startDate": 1794654400,
57 "endDate": 1795000000,
58 "collationCount": 1,
59 "publisherPlatform": [
60 "FACEBOOK",
61 "INSTAGRAM",
62 ],
63 "snapshot": {
64 "body": { "text": "Clear skin in 14 days" },
65 "title": "New: night mask",
66 "linkUrl": "https://glowskin.com/serum",
67 "ctaText": "Shop now",
68 "displayFormat": "IMAGE",
69 "pageLikeCount": 52000,
70 },
71 },
72 {
73 "adArchiveID": "100004",
74 "pageID": "111",
75 "pageName": "Example Skincare",
76 "isActive": False,
77 "startDate": 1777720000,
78 "endDate": 1795000000,
79 "collationCount": 1,
80 "publisherPlatform": [
81 "FACEBOOK",
82 "INSTAGRAM",
83 ],
84 "snapshot": {
85 "body": { "text": "Clear skin in 14 days" },
86 "title": "Glow Serum",
87 "linkUrl": "https://glowskin.com/serum",
88 "ctaText": "Shop now",
89 "displayFormat": "IMAGE",
90 "pageLikeCount": 52000,
91 },
92 },
93 ] }
94
95
96run = client.actor("weav3rx/facebook-winning-ads-finder").call(run_input=run_input)
97
98
99print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
100for item in client.dataset(run.default_dataset_id).iterate_items():
101 print(item)
102
103