Sub topic 9
How tools collect responses: APIs versus interface capture
Every metric in this tutorial starts as a stored AI response. A tracking tool gets that response in one of two main ways. It calls a model through an API, or it drives the real chat interface that a person would use. The choice changes what the numbers mean, so you need to know which one a tool uses before you trust its mention rate, citation rate, or share of voice.
This chapter assumes you know the tracking workflow (prompts, runs, parsing, metrics), the difference between a mention and a citation, and why one prompt can give different answers on different runs.
Why the collection method matters
A visibility number describes the responses the tool collected. It describes your real audience only if those responses look like what your audience sees. The collection method decides how close that match is.
Two things can differ between a collected response and a real user's response:
- The system around the model. A consumer product adds its own instructions, retrieval, safety layers, and formatting to the model.
- The context of the request. Real users have accounts, locations, languages, chat history, and saved memory.
Neither collection method reproduces a real user perfectly. Each one gives up something different.
Method 1: API collection
An API (application programming interface) lets software send a prompt to a model provider and get structured data back. Most tools that use this method send the same prompt many times and store every reply.
What you get
- A clean response body, usually as text or JSON.
- Control over settings such as the model version, the temperature (a setting that controls how random the output is), and the maximum length.
- A predictable price per request.
- Easy repetition. Running a prompt 40 times is a loop.
What can go wrong
- The API is not the product. A plain model call often has no web search at all. The consumer product may search the web and attach citations, while the same model through the API answers from training data only. A tool must switch on the provider's search or grounding feature (a feature that lets the model fetch live web pages) to get comparable behavior. Even then, the product may differ from the API in ways the provider does not document.
- Citation formats differ. Some APIs return a separate list of source URLs. Others embed links in the text. A parser must handle each provider on its own terms.
- Some engines have no suitable API. Google AI Overviews, for example, appear inside a search results page. Tools usually cannot get them from a model API.
- Model versions drift. A provider can update a model behind a stable name. If the tool does not record the exact version, a change in your metrics may come from the model and not from anything you did.
Method 2: Interface capture
Interface capture means loading the real website or app in an automated browser, entering the prompt, waiting for the answer, and saving what appears. This is often called scraping. Some tools do it with their own browser fleets. Others buy the result from a data provider.
What you get
- The answer a user would see, including product-specific features such as inline source cards, shopping blocks, and AI Overviews on a search page.
- Citations as they are displayed, which is closer to the click path a user follows.
- Coverage of engines that have no public API.
What can go wrong
- It is fragile. The page layout changes without warning. A parser that reads the old layout can silently return empty citation lists, which looks like a drop in visibility.
- It is slower and costs more per response. Browsers are heavier than API calls, so tools often take fewer repeat runs.
- Sites resist automation. Bot detection, login walls, and rate limits can block or distort collection. Terms of service may also forbid automated access, so check a vendor's compliance position.
- The profile is artificial. A logged-out browser from a data-centre address does not match a signed-in user in a specific city. Location and personalisation settings can change the answer.
Side-by-side comparison
| Property | API collection | Interface capture |
|---|---|---|
| Matches what users see | Approximately, if search features are enabled | Closely, for the profile used |
| Engine coverage | Limited to engines with an API | Wider, including AI Overviews |
| Cost per response | Lower | Higher |
| Repeat runs | Easy to scale | Slower and more costly |
| Output structure | Clean and consistent | Needs parsing that can break |
| Stability over time | Versioned, with deprecation notices | Breaks when the page changes |
| Control over settings | High | Low |
| Terms of service risk | Low | Higher |
How a collection pipeline fits together
Whichever method a tool uses, the stored record should look the same afterwards. The parser and the metrics code then do not care how the response arrived.
Record the metadata
A stored response is only useful if you can tell how it was made. Without that, you cannot explain a change in the metrics later. Keep these fields with every run:
- The engine and the exact model or product version, if known.
- The collection method (API or interface).
- Whether web search was on.
- The timestamp, the country or region, and the language.
- Whether the session was logged in, and whether any chat history or memory was present.
- The raw response, not just the parsed result, so you can re-parse it when your rules change.
The following Python sketch shows a record that keeps this metadata, plus a check that refuses to compare two periods collected in different ways.
from dataclasses import dataclass, field
from datetime import datetime, timezone
@dataclass
class RunRecord:
prompt: str
engine: str
method: str # "api" or "interface"
search_enabled: bool
region: str
answer: str
cited_urls: list = field(default_factory=list)
collected_at: datetime = field(
default_factory=lambda: datetime.now(timezone.utc)
)
def setup_key(self):
"""Fields that must match for two runs to be comparable."""
return (self.engine, self.method, self.search_enabled, self.region)
def comparable(period_a, period_b):
keys_a = {r.setup_key() for r in period_a}
keys_b = {r.setup_key() for r in period_b}
return keys_a == keys_b
last_month = [RunRecord("best crm", "engine-x", "api", True, "US", "Acme and Globex.")]
this_month = [RunRecord("best crm", "engine-x", "interface", True, "US", "Globex.")]
print(comparable(last_month, this_month)) # False: the method changedWhen comparable returns False, a change in mention rate may come from the switch in method. Treat it as a break in the series, not as a trend.
Hybrid approaches
Many tools use both methods. They may use APIs for broad, repeated sampling and interface capture for a smaller set of engines that matter most, such as AI Overviews. This is reasonable, but it creates a trap: two metrics shown on one dashboard may come from different methods. Ask the vendor to label the method for each engine, and avoid adding or averaging numbers across methods without saying so.
Edge cases to watch for
- Silent method changes. A vendor may move an engine from API to interface capture, or the reverse, and your trend line will jump. Ask for a change log.
- Cached or reused responses. Some tools store a response and show it for several days. Repeated identical results can come from caching, not from a stable model.
- Partial citation capture. Interface capture may record only the sources visible without clicking. An API may return more or fewer. Compare citation rates only within one method.
- Parsing drift. If a page layout changes and your citation count falls to zero overnight, check the parser before you blame the content.
- Personalisation. A logged-out capture can differ from what a signed-in customer sees. Treat the tool's result as one defined profile, not as "what users see".
Questions to ask a vendor
- Which engines do you collect through an API, and which through the interface?
- Is web search enabled for API collection, and how do you confirm it matches the product?
- How many runs per prompt do you take, and do you report uncertainty?
- Which location, language, and login state do you use?
- Do you keep raw responses, and can I export them?
- How do you detect and report parser breaks or method changes?
Exercise
A tool reports that your citation rate for one engine fell from 22% to 0% overnight, while your mention rate stayed close to its earlier value. Name the most likely cause to check first, and one metadata field that would help you confirm it.
Show answer
Check first for a parsing or collection break, such as a page layout change in interface capture or an API change that moved the citations field. The mention rate is read from the answer text, so it still worked, while the citation list came back empty. The collection method and the timestamp, along with the raw stored response, let you see whether the sources were present in the raw data and the parser missed them.
Exercise
A vendor says it collects ChatGPT data through an API and AI Overviews through interface capture. Your manager wants one combined "AI visibility" average across both. Give two reasons to be careful.
Show answer
The two numbers come from different methods, so they may differ in search settings, location, login state, and number of runs. Averaging them also hides that the engines behave differently, and a change in either method's setup would move the combined figure without any change in real visibility. Report each engine and method separately.