1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "brand": "Acme",
14 "engine": "Perplexity",
15 "query": "best CRM for SMB",
16 "citation_url": "https://acme.example/crm",
17 "source_domain": "acme.example",
18 "citationCount": 3,
19 "mentionCount": 1,
20 "observedAt": "2026-09-19"
21 },
22 {
23 "brand": "RivalCo",
24 "engine": "ChatGPT",
25 "query": "best CRM for SMB",
26 "citation_url": "https://rival.example/compare",
27 "source_domain": "rival.example",
28 "citationCount": 5,
29 "mentionCount": 1,
30 "observedAt": "2026-09-19"
31 }
32 ],
33 "previousItems": [
34 {
35 "brand": "Acme",
36 "engine": "Perplexity",
37 "query": "best CRM for SMB",
38 "citation_url": "https://acme.example/crm",
39 "source_domain": "acme.example",
40 "citationCount": 1,
41 "mentionCount": 1,
42 "observedAt": "2026-09-12"
43 }
44 ]
45};
46
47
48const run = await client.actor("quanmatrix/ai-answer-citation-share-of-voice-intelligence").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58