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 "best GEO tools for SaaS SEO",
16 "AI search visibility software"
17 ],
18 "brandName": "Semrush",
19 "domain": "semrush.com",
20 "competitors": [
21 "Ahrefs",
22 "Surfer SEO",
23 "Conductor"
24 ],
25 "country": "US",
26 "language": "en",
27 "maxPrompts": 5,
28 "timeoutSeconds": 30,
29 "proxyConfiguration": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ]
34 }
35};
36
37
38const run = await client.actor("tugelbay/google-ai-overview-tracker").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48