1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "brandName": "HubSpot",
12 "brandAliases": [
13 "HubSpot CRM"
14 ],
15 "brandDomain": "hubspot.com",
16 "competitors": [
17 {
18 "name": "Salesforce",
19 "aliases": [
20 "Salesforce Starter"
21 ],
22 "domain": "salesforce.com"
23 },
24 {
25 "name": "Pipedrive",
26 "domain": "pipedrive.com"
27 },
28 {
29 "name": "Zoho CRM",
30 "aliases": [
31 "Zoho"
32 ],
33 "domain": "zoho.com"
34 }
35 ],
36 "prompts": [
37 "What is the best CRM for a small business?",
38 "Which CRM is easiest to set up for a 5 person sales team?"
39 ]
40};
41
42
43const run = await client.actor("forgeloop/ai-brand-visibility").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53