How OpenSEO Tracks AI Visibility: Architecture, API Integration, and Core Metrics Explained

OpenSEO tracks AI visibility by integrating with the DataForSEO research API to monitor brand mentions across ChatGPT and Google AI Overview, extracting four quantitative metrics—visibility percentage, traffic estimates, average position, and keyword count—to benchmark competitor performance.

The open-source OpenSEO platform provides comprehensive AI visibility tracking through direct integration with DataForSEO's specialized endpoints. This functionality enables marketers to measure how frequently their domains appear in AI-generated search results compared to competitors, moving beyond traditional SERP rankings to capture citation-based brand presence.

DataForSEO API Integration Architecture

The tracking system centers on server-side tools that construct authenticated requests to DataForSEO's AI brand visibility endpoint. Located in src/server/mcp/tools/dataforseo-research-tools.ts, the implementation handles domain-specific queries and manages response parsing through typed schemas defined in src/types/schemas/ai-search.ts.

The architecture follows a three-stage pipeline:

  1. Request Construction – The DataforseoResearchTools class builds POST requests targeting the /ai/brand-visibility endpoint.
  2. Schema Validation – Incoming JSON payloads are validated against the ai-search.ts Zod schema to ensure type safety for the four core metrics.
  3. Sorting and Weighting – Results are sorted by visibility percentage by default, then fed into rank-tracking modules where visibility weights influence overall scoring algorithms.

Core AI Visibility Metrics

OpenSEO extracts four primary quantitative signals from the DataForSEO response payload. These metrics describe distinct dimensions of AI search presence:

  • visibility – Represents the share of AI mentions and citations a domain receives relative to all competitors in the query set. Expressed as a percentage (0–100), this metric indicates market share of voice within AI-generated results.
  • traffic_estimate – Approximates the organic traffic volume that AI-visible queries would generate monthly. This integer value helps quantify the business impact of AI search presence.
  • avg_position – Calculates the average SERP position of AI-visible results for the domain. Stored as a float, lower values indicate higher average rankings.
  • keyword_count – Counts distinct AI-search keywords that reference the domain, providing insight into the breadth of topical coverage.

Implementation: From API Response to UI

The data flows through distinct server and client layers, transforming raw API responses into actionable scorecards.

Server-Side Data Fetching

The fetchAiBrandVisibility function in src/server/mcp/tools/dataforseo-research-tools.ts handles authentication, request formatting, and initial data normalization:

// src/server/mcp/tools/dataforseo-research-tools.ts
export const fetchAiBrandVisibility = async (args: {
  domain: string;
  sortBy?: "visibility" | "traffic_estimate" | "avg_position" | "keyword_count";
}) => {
  const response = await DataforseoService.post("/ai/brand-visibility", {
    domain: args.domain,
  });

  const rows = response.results.map((row) => ({
    domain: row.domain,
    visibility: row.visibility,
    traffic_estimate: row.traffic_estimate,
    avg_position: row.avg_position,
    keyword_count: row.keyword_count,
  }));

  // Default sort by visibility
  const sorted = rows.sort(
    (a, b) => (args.sortBy ?? "visibility") === "visibility"
      ? b.visibility - a.visibility
      : 0,
  );

  return sorted;
};

Client-Side Scorecard Rendering

Processed metrics reach the frontend through the rank-tracking module. The VisibilityScorecard component in src/client/features/rank-tracking/rankTrackingScorecards.tsx calculates period-over-period changes:

// src/client/features/rank-tracking/rankTrackingScorecards.tsx
const VisibilityScorecard = ({
  visibility,
  visibilityPrevious,
}: {
  visibility: number | null;
  visibilityPrevious: number | null;
}) => {
  const visibilityDelta =
    visibility !== null && visibilityPrevious !== null
      ? visibility - visibilityPrevious
      : null;

  return (
    <Scorecard
      title="Visibility"
      value={visibility !== null ? `${visibility}%` : "–"}
      delta={visibilityDelta !== null ? `${visibilityDelta}%` : undefined}
    />
  );
};

Database Schema and Persistence

Longitudinal tracking requires persistent storage. The platform stores AI visibility metrics in SQLite or PostgreSQL via the telemetry layer defined in src/db/telemetry.schema.ts. This schema enables time-series analysis of visibility trends and correlation with traffic_estimate fluctuations across competitor sets.

Summary

  • OpenSEO queries the DataForSEO AI brand visibility endpoint to track mentions in ChatGPT and Google AI Overview.
  • Four core metrics—visibility, traffic_estimate, avg_position, and keyword_count—quantify AI search presence.
  • The fetchAiBrandVisibility function in dataforseo-research-tools.ts handles API integration, sorting, and initial data transformation.
  • Frontend components like rankTrackingScorecards.tsx calculate visibility deltas and render trend analysis for competitive benchmarking.
  • All metrics are persisted in telemetry.schema.ts for longitudinal tracking and historical comparison.

Frequently Asked Questions

What is AI brand visibility and how does OpenSEO measure it?

AI brand visibility represents how often a domain appears in citations and mentions within AI-generated search results like ChatGPT and Google AI Overview. OpenSEO measures this by querying the DataForSEO research API for brand-specific visibility data, then normalizing the results against competitor domains to calculate a percentage-based visibility score.

Which DataForSEO endpoint does OpenSEO use to fetch AI visibility data?

The system communicates with DataForSEO's /ai/brand-visibility endpoint through the DataforseoService client. This endpoint returns structured data containing the four core metrics—visibility, traffic_estimate, avg_position, and keyword_count—which are then parsed and validated against the ai-search.ts schema.

How does AI visibility tracking differ from traditional rank tracking in OpenSEO?

Traditional rank tracking focuses on SERP position and organic ranking fluctuations for specific keywords. The AI visibility workflow instead analyzes citation frequency, brand mention density, and platform-specific metrics from AI search sources, providing a measure of brand authority within generative search contexts rather than just positional rankings.

Where are AI visibility metrics stored and how are they queried?

Metrics are stored in the telemetry database layer defined in src/db/telemetry.schema.ts, supporting both SQLite and PostgreSQL backends. The schema maintains historical records of visibility measurements, enabling SQL-based queries for trend analysis, competitor comparison reports, and delta calculations shown in the rank-tracking dashboard.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →