1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "schemaVersion": "1.0",
12 "analysisId": "acme-ai-sov-2026-q4",
13 "targetBrand": "Acme",
14 "competitors": [
15 "Beta",
16 "Gamma"
17 ],
18 "observations": [
19 {
20 "schemaVersion": "1.0",
21 "observationId": "1dd0242ec51569d105f1d541f97fec03202ff2632f507b5b03f45393a0985793",
22 "brand": "Acme",
23 "competitors": [
24 "Beta"
25 ],
26 "modelFamily": "ChatGPT",
27 "market": "US",
28 "language": "en",
29 "mentioned": true,
30 "position": 1
31 },
32 {
33 "schemaVersion": "1.0",
34 "observationId": "6d5d40cc4239b90a29a6b01f05afc95f6014e147653733a88c0b8b0cc2f9608b",
35 "brand": "Acme",
36 "competitors": [
37 "Beta",
38 "Gamma"
39 ],
40 "modelFamily": "ChatGPT",
41 "market": "US",
42 "language": "en",
43 "mentioned": false,
44 "position": null
45 },
46 {
47 "schemaVersion": "1.0",
48 "observationId": "02bb02668bb610c21e80f39887124fcbe21ba70cce9ea951f5545cfee30a11dd",
49 "brand": "Acme",
50 "competitors": [
51 "Gamma"
52 ],
53 "modelFamily": "Gemini",
54 "market": "US",
55 "language": "en",
56 "mentioned": true,
57 "position": 2
58 },
59 {
60 "schemaVersion": "1.0",
61 "observationId": "6d2f681dd1da0ee26756b2b6d918f20534226762040feaf0ef200c419008c7d7",
62 "brand": "Acme",
63 "competitors": [],
64 "modelFamily": "Gemini",
65 "market": "UK",
66 "language": "en",
67 "mentioned": true,
68 "position": 1
69 },
70 {
71 "schemaVersion": "1.0",
72 "observationId": "4ca3603e3fc5118141211654becfa32d6a52b8d9c175e750205f249ffadced9c",
73 "brand": "Acme",
74 "competitors": [
75 "Beta"
76 ],
77 "modelFamily": "Perplexity",
78 "market": "UK",
79 "language": "en",
80 "mentioned": false,
81 "position": null
82 },
83 {
84 "schemaVersion": "1.0",
85 "observationId": "75156e90a81c700b669dec421a50880014a91bc7a42a7a337d1f7655a3cb7cba",
86 "brand": "Acme",
87 "competitors": [
88 "Beta",
89 "Gamma"
90 ],
91 "modelFamily": "Perplexity",
92 "market": "US",
93 "language": "en",
94 "mentioned": true,
95 "position": 1
96 }
97 ],
98 "maximumSegmentsPerDimension": 10
99};
100
101
102const run = await client.actor("zinin/ai-visibility-competitor-share-of-voice").call(input);
103
104
105console.log('Results from dataset');
106console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
107const { items } = await client.dataset(run.defaultDatasetId).listItems();
108items.forEach((item) => {
109 console.dir(item);
110});
111
112