1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "brand": "OpenAI",
12 "brandTerms": [
13 "openai.com",
14 "openai"
15 ],
16 "competitors": [
17 {
18 "name": "Anthropic",
19 "terms": [
20 "anthropic.com",
21 "claude.ai",
22 "anthropic"
23 ]
24 },
25 {
26 "name": "Google",
27 "terms": [
28 "gemini.google.com",
29 "gemini",
30 "google ai"
31 ]
32 }
33 ],
34 "keywords": [
35 "ai api pricing",
36 "enterprise llm platform"
37 ],
38 "searchSources": [
39 "google",
40 "reddit"
41 ],
42 "emailTo": [
43 "alerts@example.com"
44 ]
45};
46
47
48const run = await client.actor("taroyamada/ai-visibility-monitor-actor").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