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 answer engine optimization tools",
13 "best AI visibility tracker",
14 "how to optimize for Google AI Overviews"
15 ],
16 "brandName": "Semrush",
17 "domain": "semrush.com",
18 "competitors": [
19 "Ahrefs",
20 "Surfer SEO",
21 "Conductor"
22 ],
23 "country": "US",
24 "language": "en",
25 "maxPrompts": 3,
26 "timeoutSeconds": 20,
27 "proxyConfiguration": {
28 "useApifyProxy": true,
29 "apifyProxyGroups": [
30 "RESIDENTIAL"
31 ]
32 }
33};
34
35
36const run = await client.actor("tugelbay/google-ai-overview-tracker").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