1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "items",
10 "items": [
11 {
12 "query": "best product analytics tools for b2b saas",
13 "engine": "Perplexity manual export",
14 "locale": "US",
15 "answer": "RivalMetrics is frequently recommended for B2B SaaS product analytics. Northstar BI is also mentioned.",
16 "citations": [
17 {
18 "title": "RivalMetrics customer story",
19 "url": "https://rivalmetrics.com/customers/b2b-saas",
20 },
21 {
22 "title": "Product analytics software rankings",
23 "url": "https://g2.com/categories/product-analytics",
24 },
25 ],
26 },
27 {
28 "prompt": "is acme analytics good for product teams",
29 "platform": "ChatGPT manual audit",
30 "market": "US",
31 "aiAnswer": "Acme Analytics is a possible product analytics option, but buyers often compare it with RivalMetrics.",
32 "sources": [{
33 "title": "Third-party product analytics roundup",
34 "url": "https://example-review-site.com/product-analytics",
35 }],
36 },
37 {
38 "keyword": "acme analytics implementation guide",
39 "provider": "Google AI Overview export",
40 "country": "US",
41 "overview": "Acme Analytics provides implementation guidance for product teams, including event tracking and activation reporting.",
42 "organicResults": [
43 {
44 "title": "Acme Analytics implementation guide",
45 "url": "https://docs.acmeanalytics.com/implementation",
46 },
47 {
48 "title": "Acme Analytics product analytics blog",
49 "url": "https://blog.acmeanalytics.com/product-analytics-guide",
50 },
51 ],
52 "mentionedBrands": ["Acme Analytics"],
53 },
54 ],
55 "brandProfile": {
56 "brandName": "Acme Analytics",
57 "domains": ["acmeanalytics.com"],
58 "competitors": [
59 "RivalMetrics",
60 "Northstar BI",
61 ],
62 "targetMarkets": ["US SaaS"],
63 "targetKeywords": [
64 "product analytics",
65 "AI visibility",
66 ],
67 "priorityTopics": [
68 "B2B SaaS analytics",
69 "implementation guides",
70 ],
71 "ownedSources": [
72 "docs.acmeanalytics.com",
73 "blog.acmeanalytics.com",
74 ],
75 "preferredCitations": [
76 "g2.com",
77 "capterra.com",
78 "docs.acmeanalytics.com",
79 ],
80 "avoidKeywords": ["guaranteed ranking"],
81 },
82 "scrapedAt": "2026-07-08T00:00:00.000Z",
83}
84
85
86run = client.actor("rotvuvo/ai-search-visibility-gap-scorer").call(run_input=run_input)
87
88
89print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
90for item in client.dataset(run["defaultDatasetId"]).iterate_items():
91 print(item)
92
93