UI Inspect
API Reference

Comparisons

API endpoints for visual comparisons — the core of UI Inspect.

Comparisons are the fundamental unit of visual testing. Each comparison represents a screenshot compared against a baseline image.

comparison.list

List comparisons with optional filtering.

TypeQuery
AuthProtected

Input:

{
  status?: "pending" | "resolved" | "archived";
  projectId?: string;
}

comparison.byId

Get a single comparison with full details.

TypeQuery
AuthProtected

Input: { id: string }


comparison.create

Create a single comparison.

TypeMutation
AuthProtected

Input:

{
  projectId: string;
  componentName: string;
  viewport?: string;
  diffsFound?: number;
  diffsFixed?: number;
  confidence?: number;
  designImageUrl?: string;
  implementationImageUrl?: string;
  analysisData?: object;    // Smart diff results
  a11yData?: object;        // Accessibility audit
  contrastData?: object;    // Contrast check results
}

comparison.batchCreate

Create multiple comparisons at once. Used by the CLI during builds.

TypeMutation
AuthProtected

Input:

{
  projectId: string;
  buildId?: string;
  comparisons: Array<{
    componentName: string;
    viewport?: string;
    diffsFound?: number;
    diffsFixed?: number;
    confidence?: number;
    designImageUrl?: string;
    implementationImageUrl?: string;
    analysisData?: object;
  }>;
}

comparison.updateStatus

Update the status of a comparison.

TypeMutation
AuthProtected

Input:

{
  id: string;
  status: "pending" | "resolved" | "archived";
}

comparison.batchUpdateStatus

Update status of multiple comparisons at once.

TypeMutation
AuthProtected

Input:

{
  ids: string[];
  status: "pending" | "resolved" | "archived";
}

comparison.updateIgnoreRegions

Define regions to ignore during comparison.

TypeMutation
AuthProtected

Input:

{
  id: string;
  regions: Array<{
    x: number;
    y: number;
    width: number;
    height: number;
    label?: string;
  }>;
}

comparison.applyFix

Mark specific diffs as fixed within a comparison.

TypeMutation
AuthProtected

Input:

{
  id: string;
  diffIds: number[];
}

comparison.catalog

Get a catalog of all unique components across comparisons.

TypeQuery
AuthProtected
InputNone

Response:

Array<{
  name: string;
  latestStatus: string;
  latestConfidence: number;
  totalComparisons: number;
  totalDiffs: number;
  totalFixed: number;
  projects: string[];
  fixRate: number;
}>;

comparison.weeklyStats

Get comparison counts grouped by day for the current week.

TypeQuery
AuthProtected
InputNone

Response:

Array<{
  day: string; // "Mon", "Tue", etc.
  date: string; // ISO date
  comparisons: number;
}>;

comparison.trendStats

Get trend data over a configurable time range.

TypeQuery
AuthProtected

Input:

{
  days?: number;  // 7-365, default: 30
}

Response:

Array<{
  date: string;
  comparisons: number;
  diffs: number;
  fixed: number;
  resolved: number;
  regressionRate: number;
}>;

comparison.reportStats

Get aggregate report statistics.

TypeQuery
AuthProtected
InputNone

Response:

{
  totalComparisons: number;
  totalDiffs: number;
  totalFixed: number;
  fixRate: number;
  projectStats: Array<{
    projectId: string;
    projectName: string;
    comparisons: number;
    diffs: number;
    fixed: number;
  }>;
}

On this page