1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "prompts": [
12 "best CRM for small business"
13 ],
14 "brand": "HubSpot",
15 "brandDomain": "hubspot.com",
16 "competitors": [
17 "Salesforce",
18 "Zoho CRM",
19 "Pipedrive",
20 "Freshsales"
21 ],
22 "engines": [
23 "chatgpt",
24 "perplexity",
25 "claude",
26 "gemini",
27 "copilot",
28 "google-ai-overviews",
29 "google-ai-mode"
30 ],
31 "country": "US",
32 "language": "en"
33};
34
35
36const run = await client.actor("mastertools/ai-visibility").call(input);
37
38
39console.log('Results from dataset');
40console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
41const { items } = await client.dataset(run.defaultDatasetId).listItems();
42items.forEach((item) => {
43 console.dir(item);
44});
45
46