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 "Pipedrive vs HubSpot for a 5-person sales team"
14 ],
15 "brandName": "Pipedrive",
16 "brandDomain": "pipedrive.com",
17 "competitors": [
18 {
19 "key": "HubSpot",
20 "value": "hubspot.com"
21 },
22 {
23 "key": "Salesforce",
24 "value": "salesforce.com"
25 },
26 {
27 "key": "Zoho CRM",
28 "value": "zoho.com"
29 }
30 ],
31 "engines": [
32 "chatgpt",
33 "perplexity",
34 "gemini"
35 ]
36};
37
38
39const run = await client.actor("signal_factory/ai-visibility-checker").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