1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "creatives": [{
10 "id": "creative-1",
11 "brand": "Example Brand",
12 "body": "Turn your ad creatives into measurable insights.",
13 "cta": "Learn More",
14 "assetUrl": "https://images.unsplash.com/photo-1556742049-0cfed4f6a45d",
15 "assetType": "image",
16 }],
17 "csvInput": """id,brand,body,cta,assetUrl,assetType
18creative-1,Example Brand,Turn your ad creatives into measurable insights.,Learn More,https://images.unsplash.com/photo-1556742049-0cfed4f6a45d,image""",
19 "ads": [{
20 "libraryID": "example-ad-1",
21 "brand": "Example Brand",
22 "body": "Turn your ad creatives into measurable insights.",
23 "ctaText": "Learn More",
24 "format": "image",
25 "images": [{ "url": "https://images.unsplash.com/photo-1556742049-0cfed4f6a45d" }],
26 "active": True,
27 "runTimeDays": 21,
28 "multipleVersions": False,
29 "similarAdCount": 1,
30 "totalPlatforms": 1,
31 }],
32 "maxAds": 100,
33 "maxConcurrency": 2,
34 "maxVideoFrames": 8,
35 "videoFrameIntervalSeconds": 2,
36}
37
38
39run = client.actor("whoareyouanas/creative-intelligence").call(run_input=run_input)
40
41
42print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
43for item in client.dataset(run["defaultDatasetId"]).iterate_items():
44 print(item)
45
46