1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "brand": {
12 "name": "Notion",
13 "aliases": [
14 "Notion.so"
15 ],
16 "domain": "notion.com"
17 },
18 "competitors": [
19 {
20 "name": "Coda",
21 "domain": "coda.io"
22 },
23 {
24 "name": "Confluence",
25 "domain": "atlassian.com"
26 },
27 {
28 "name": "Obsidian",
29 "domain": "obsidian.md"
30 }
31 ],
32 "prompts": [
33 "What is the best note-taking app for teams?",
34 "Best alternative to Confluence for a startup?"
35 ]
36};
37
38
39const run = await client.actor("vyse-ai/ai-brand-visibility-tracker").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49