1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "ads": [
12 {
13 "id": "meta-1",
14 "headline": "Free delivery for teams",
15 "text": "Compare annual plans and see included services.",
16 "cta": "Compare plans"
17 },
18 {
19 "id": "meta-2",
20 "headline": " FREE delivery for teams ",
21 "text": "Compare annual plans with included support.",
22 "cta": "Compare plans"
23 },
24 {
25 "id": "search-1",
26 "headline": "Try the workflow demo today",
27 "text": "See the demo before you choose a plan.",
28 "cta": "Book a demo"
29 },
30 {
31 "id": "search-2",
32 "headline": "Try the workflow demo today",
33 "text": "See the demo before you choose a plan."
34 }
35 ],
36 "limits": {
37 "headlineCharacters": 24
38 },
39 "maxPhrases": 20,
40 "minPhraseAds": 2,
41 "phraseLength": 2,
42 "maxItems": 1
43};
44
45
46const run = await client.actor("danielmichalek/ad-headline-cta-intelligence").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56